5 ms·
Show HN: Beginning Android for iOS Developers
- 10char 16y agoHey 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!
- sjs 16y agoJust 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.
- RossM 16y agoI've never done any iOS development but I have a feeling this is going to help me with the things I can't seem to find guidance for - thank you!
- chopsueyar 16y agoThank you and good job!
- 2mur 16y agoThis looks very helpful. Thanks!
- reader5000 16y agoThanks 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.
- bmelton 16y agoBrilliant -- 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. Thank you for sharing.
- defrex 16y agoDoes anyone know of anything in reverse (iOS for Android developers)?
- mirkules 16y agoHow do we "release" objects...? Just kidding, awesome tutorial, I was looking for something like this, thanks.
- bignoggins 16y agoHow did you like developing for Android vs iOS?
- 10char 16y agoI 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.
- bonch 16y agoHmm, 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.
- saidulislam 16y agolight but still a very good article. it would be nice to have something the other way :-) Android to iOS
- Nemisis7654 16y agoYes, I was thinking this exact same thing.
- collinjackson 16y agoIf 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 http://www.apportable.com
- bonaldi 16y agoIs this just spam, or do you have links to the technical details? It sounds like it could be a huge boon to lots of iOS devs.
- collinjackson 16y agoI posted a brief explanation and demo installer at http://www.cocos2d-iphone.org/archives/1350 http://www.cocos2d-iphone.org/archives/1350. I'm using http://www.cocotron.org/ http://www.cocotron.org/ and http://www.gnustep.org/ http://www.gnustep.org/ to provide the missing platform libraries.
- jwwest 16y agoLove 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.
- bonch 16y agoIf you like it now, check out what's in OS X Lion and (inevitably) iOS with regards to keeping interface objects lined up. No more struts and springs.
- sthatipamala 16y agoMost 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!
- pshapiro 16y agoI'm a "veteran" iOS/Cocoa developer who has just started his first Android project a few days ago. Coincidence? :)
- frozenflame 16y agoIt feels trite to reiterate so many other commenters but I really liked your take on Android development and would like to see more.
- orangecat 16y agoJoining the choir, this is fantastic. I've been writing Android apps for a year, and still got several useful pointers out of it.