Hey HN, I wrote a 9-part series on how starting Android from the perspective of an iOS developer.
tl;dr I walk you through how I ported one of my iOS apps. There are UIKit references and such, but anyone can pick this up and learn something (I cover parsing JSON from the file system, serializing objects, HTTP requests...yknow, all the useful stuff).
I've never written anything of this scale, so criticisms are welcome!
Just 2 months ago I was searching for exactly this. This is going to be really useful for a lot of people, thank you. No time to read it now but it's on my Instapaper list.
Brilliant -- I've built a couple of Android apps so far, and found that poring through the SDK, while valuable, is somewhat a steep curve to those of us who don't enjoy Java.
Seeing the language documented one function at a time also loses out on how the components interact, design patterns that make sense, and other considerations that I am certain this will help with.
If you don't have the time to rewrite your app manually, there is another way: it's possible to recompile an iOS app to run natively on Android using the NDK. This is tricky to set up, but I can do it for you: http://www.apportable.com
Love this! The biggest learning curve for me is the lack of a decent layout editor. I know I'm supposed to be teh hardcorez, but Interface Builder is really nice for at least getting your items to line up right.
I was actually thinking about adding this as an epilogue. I'll summarize my thoughts real quick:
- Biggest difference is making interfaces, both in terms of tools and higher level philosophy. Having Linear/Relative/Table/etc Layouts is a really foreign concept to iOS developers, who are used to just using two sets of pixel dimensions (320x480 or 768x1024). Once you get some practice with them it's not a big deal, but its definitely one of those things that originally made me stop learning Android dev on my first try. At the same time, it's necessary to have all these different ways of laying out data to cope with the device fragmentation. There are tools built into Eclipse and elsewhere (DroidDraw) that give you a graphic representation of what you're doing, but they're not as tightly integrated into the development process as Interface Builder is to iOS.
- Related to that point, I feel like it's just a lot easier to do complex and custom interfaces on iOS. I haven't delved too deep into this on Android, but all of the really awesome Quartz features for manipulating and animating views just don't exist (although I heard 3.0 is trying to change that).
- Dealing with touches is something much more deeply ingrained in iOS than in Android; from what I've heard, it's actually non-existant in pre-2.0 APIs. I believe there's just not concept of a UIResponder-esque chain of handling events, which sucks because those form the backbone of really cool interfaces that iOS apps are known for.
- All that being said, it was actually pretty enjoyable once I got the hang of it. Things like ArrayAdapters are really useful and my code was more modular because of them. Now, if Apple got around to bringing all the Bindings and NSObjectController magic to iOS...
tl;dr the Android SDK (pre 3.0) seems better suited for business-as-usual apps than the gorgeous interfaces you find on the App Store.
Hmm, not exactly a ringing endorsement. It's interesting how so many Android fans call the fragmentation issues FUD, but developers consistently confirm it as a real problem. Supporting multiple devices like that is a headache for the small developers that make up the majority of mobile app development.
Most Android tutorials are written by Android/Java veterans, so I used to find them hard to follow.
This one is great because it's written by a (former) beginner, for beginners. Nice work!
Thanks for sharing. The Android sdk samples dont actually include any parsing/reading data from file examples, so this is useful even for non-iOS devs.
tl;dr I walk you through how I ported one of my iOS apps. There are UIKit references and such, but anyone can pick this up and learn something (I cover parsing JSON from the file system, serializing objects, HTTP requests...yknow, all the useful stuff).
I've never written anything of this scale, so criticisms are welcome!