Iphone Apps To Android Apps. How Hard Can It Be?
Iphone Apps To Android Apps. How Hard Can It Be?
Author
Discussion

simba1

Original Poster:

547 posts

231 months

Wednesday 21st April 2010
quotequote all
No, I'm not an expert or even an IT technician but I've been using Linux (Ubuntu) on both my work laptop and home PC for the last 4 years and at times had had to use Linux software (RPM) easily by using a script (alien) to convert them to a Debian version that can easily be installed in my computer. Now, iphone is running on some sort of Linux and so are the android Phones, so how hard can it be to slightly modify the codes so they can run on the 2 Linux versions.

randlemarcus

13,646 posts

262 months

Wednesday 21st April 2010
quotequote all
Same difference as Unix for big Sparc tin, and unix for Intel tin.

Hugely different underlying hardware, then you have the *nix flavours, then you have the vendor control bits.

There are development environments that make it easier to write code for the major platforms, but they're costly and it still takes lots of thought.

tinman0

18,231 posts

271 months

Wednesday 21st April 2010
quotequote all
simba1 said:
No, I'm not an expert or even an IT technician but I've been using Linux (Ubuntu) on both my work laptop and home PC for the last 4 years and at times had had to use Linux software (RPM) easily by using a script (alien) to convert them to a Debian version that can easily be installed in my computer. Now, iphone is running on some sort of Linux and so are the android Phones, so how hard can it be to slightly modify the codes so they can run on the 2 Linux versions.
Firstly, iPhone isn't Linux. Based on OSX which is machten which is BSD derived. Linux is really it's own family.

Secondly, from what I read, Android is as far removed from Linux as it gets. Cyberface mentioned that the whole permissions system is stripped out, and from what I can tell, Android is no longer in the Linux tree anymore. Famously got thrown out in December 09 iirc because it's just getting a bit too fragmented from the Linus kernel core.

Thirdly, APIs on both platforms will be different. So it won't just be about recompiling a piece of source. (Well you could, but it'll break rather quickly).

cyberface

12,214 posts

288 months

Wednesday 21st April 2010
quotequote all
iPhone is NOT running on some form of Linux.

It's OS X, which in the real world is a BSD userland on an xnu Mach-based microkernel.

Very different kernel technology to Linux.

Yes, the CLI open-source stuff should port reasonably easily (that's what Cydia is on the jailbroken iPhone - basically a Debian apt port) - but expecting *apps* (as in what the non-techie calls an 'app' i.e. the GUI application) to port from one system to another?

They're as different as Windows and OS X, or Windows and Linux, or OS X and Linux. All run their apps using an object-oriented GUI framework (or set of frameworks). Whilst you may be able to abstract most of this if you intend *from the start* to write a multi-platform application (look at spoonjuice's 'The Plateau' for an example of this, runs on iPhone and Android, and one of my favourite games), but if you didn't consider multi-platform at the start, you'll have a hell of a job rewriting all the GUI code.

If all you're trying to do is to recompile mtr or netcat for the unix command line... well knock yourself out, it's easily possible, and already been done (Cydia on an jailbroken iPhone, it's a Debian package, install. Android is harder esp. v2.1 where all the userland has disappeared, but if you create an ext2 filesystem within a file on the FAT32 SD card, and then install a base Linux directory structure in there, with links in and out of the two filesystems, then you can get a similar Debian ports system working - Saurik (Jay Freeman) did a bit of work on this on Android, since he too is getting annoyed with Apple's interference - he is the guy behind Cydia, FWIW).

But it sounds like you're talking 'I've got a Bloomberg app on my iPhone. I want it on my Android phone. How Hard Can It Be?' - the answer is 'pretty much a total rewrite, mate'. Sorry. I wish it was easier too, as I'd desperately love a proper Bloomie app on my Nexus One. The iPad Bloomberg app crashes *very* regularly.

Just because they're Unix and running on similar hardware doesn't make them identical to code for... your first mistake is thinking that the iPhone OS X is actually a flavour of Linux - it's nowhere near. The userlands allow the two platforms to share command line Unix tools - that's no problem - but GUI apps are a different kettle of catfish.



ETA - tinman0 - yep, Android 2.1 feels nothing like Linux at all. You need a busybox to do *anything*, there is no shell, the userland is bare. This may have something to do with filesystems - the SD card is formatted FAT32, and you can't really run Linux properly on FAT32 so there are some major limitations to how everything has been set up. Saurik did some work on this, and concluded that you needed to create an ext2 filesystem in a file on the SD card, then use fusefs to allow the root FS to talk to the ext2 FS on the SD card, and then set up a bunch of links to allow a 'full' Linux folder structure on the 'expanded' SD-card hosted FS. He then got a rudimentary Debian ports system running, but all his time is taken dealing with Cydia by the looks of things. Authentication and user control? fk knows what the hell Google did with that - each app runs as its own user, they're all numeric, and no passwords seem to exist anywhere. It's a damn sight less of a Linux than my ancient Sharp SL-5000D PDA!!! However earlier versions of Android may be more familiar - Plotloss may be able to chime in, he's used the earlier versions heavily IIRC.

Edited by cyberface on Wednesday 21st April 22:57

Crafty_

14,220 posts

231 months

Wednesday 21st April 2010
quotequote all
Your problem is that Apple, in their infinite wisdom have put restrictions on iPhone apps, basically if they are not written natively for the iPhone OS the app will be rejected. This more or less means that every iPhone app needs to be written in objective C.

I think Jobs has dropped a b*****k on this one, but hey who cares ? smile

I expect things to go the Android way over the next 18 months. Especially when you see the phones are cheap or free on a new contract, but iPhones still have to be paid for.

More reading: http://www.theregister.co.uk/2010/04/16/does_apple...

tinman0

18,231 posts

271 months

Wednesday 21st April 2010
quotequote all
Crafty_ said:
Your problem is that Apple, in their infinite wisdom have put restrictions on iPhone apps, basically if they are not written natively for the iPhone OS the app will be rejected. This more or less means that every iPhone app needs to be written in objective C.

I think Jobs has dropped a b*****k on this one, but hey who cares ? smile
Why? Any programmer worth their weight will use C anyway. So a few Flash programmers will have less to do. That's not a bad thing.

It's a bit like programmers heavily relying on Perl and fast processors, when C is a hundred times quicker.

There's also a bit of double standards going on as well.

Firstly, Flash is a dreadful piece of crap. It's not an open standard, and it shouldn't be as heavily used on the internet as it is. The internet was about relatively open standards, but Flash is nothing of the sort. It's a commercial package that costs the earth.

Secondly, nerds respect programmers, and programmers use C. They might use Perl for scrappy things, but any programmer worth his pay uses C. So the only people who get thrown off the iPhone platforms are the ones that don't know C, and considering they are the ones who write the farting apps, there is no loss there. Java is just encapsulated C, so those guys shouldn't have a problem adapting either.

simba1

Original Poster:

547 posts

231 months

Wednesday 21st April 2010
quotequote all
Thanks for all the replies so far and as I said, I'm no better than a layperson where all the tech is concerned. Actually I cannot really understand the replies but grasp that they are as different as apples are to oranges. I do find it strange that my htc hero phone, supposedly running a Linux OS, has no support for any Linux OS I know and to root it I had to reinstall XP and dual boot on my Ubuntu PC.

cyberface

12,214 posts

288 months

Wednesday 21st April 2010
quotequote all
Well, Objective-C is a bit of a jump from old-school C greybeards... it's got a very strictly enforced model-view-controller OO paradigm for apps, and that can feel very weird indeed coming from a plain portable-C programming background.

Eh, what do I know, I'm not a programmer. But you can't write much more than a CLI app or background service in plain C on the iPhone - for all GUI apps you'll need the whole Objective-C MVC stuff, the weird parameter passing (message handling, more like) - it's just *alien* stuff. Well it was to this non-programmer.

I'd rather write an iPhone app in Ruby, myself smile There's a RubyCocoa link to the UI frameworks...

Crafty_

14,220 posts

231 months

Thursday 22nd April 2010
quotequote all
tinman0 said:
Crafty_ said:
Your problem is that Apple, in their infinite wisdom have put restrictions on iPhone apps, basically if they are not written natively for the iPhone OS the app will be rejected. This more or less means that every iPhone app needs to be written in objective C.

I think Jobs has dropped a b*****k on this one, but hey who cares ? smile
Why? Any programmer worth their weight will use C anyway. So a few Flash programmers will have less to do. That's not a bad thing.

It's a bit like programmers heavily relying on Perl and fast processors, when C is a hundred times quicker.

There's also a bit of double standards going on as well.

Firstly, Flash is a dreadful piece of crap. It's not an open standard, and it shouldn't be as heavily used on the internet as it is. The internet was about relatively open standards, but Flash is nothing of the sort. It's a commercial package that costs the earth.

Secondly, nerds respect programmers, and programmers use C. They might use Perl for scrappy things, but any programmer worth his pay uses C. So the only people who get thrown off the iPhone platforms are the ones that don't know C, and considering they are the ones who write the farting apps, there is no loss there. Java is just encapsulated C, so those guys shouldn't have a problem adapting either.
Ok, for arguments sake..
Im a java programmer, or c#..
I have a system that has a web interface and I want to make mobile phone apps. The code for the app is a subset of the existing system, so I don't want to spend time and money re-writing it into objective C and maintaining it as separate code to my existing code - I want to re-use what I already have.

Until this week I could use mono or similar and pretty soon I have my app.
Except I can't do that now, so I look at the costs to re-write - not worth it.
At the same time I see people ditching blackberrys and iPhones for Android devices.

No brainer.

I dunno why you are ranting about flash, no-one mentioned it, apart from Jobs whining on. again.