IPhone Development: Android SDK from an iPhone Developer's Perspective
iphonedevelopment.blogspot.com
iphonedevelopment.blogspot.com
This is silly, and tells me the author didn't think past the SDK. The Intent framework is what allows me to take a photo with the regular camera app (the one that pops up when I press the shutter button) and select "Facebook" from the "Share" menu. The Facebook app hooks up automatically. The iPhone app has to have its own "take photo" gadget, otherwise you end up having to browse through your photos trying to find the one you just took. This kind of integration is everywhere in Android.
That said, some of the other complaints are spot on. It's absolutely true that the amount of "dumb XML boilerplate" in Android is too high, and there are a bunch of tasks and states that can only be accessed through static configuration, and not managed dynamically by the app. Likewise the application lifecycle (which is inherently more complicated on Android because of the ability to run in the background) is more complicated than it needs to be, and frankly poorly documented. On the whole it's an OK framework; it's not great.
If I wanted to do what he wants to do in his example, I would do exactly that - create the views I want/need, throw them in a list, then rotate/display them in whatever order I needed.
Personally, I cannot get excited about iPhone development. While the UI Builder truly is top notch, the whole thing seems geared towards building great UIs to so people can consume content in a mobile-friendly way. Android OTOH, while limited in UI, gives you the freedom to make whatever you want. Sadly, the author hasn't discovered that and makes absolutely no mention of things like Services, BroadcastReceivers or the other ways you can hook into the system.
People may say that doesn't matter, but that's because they can't miss something they've never had. My Android app is one of the top ones in it's category and has no equivalent on the iPhone because it can't be written for non-jailbroken ones. The one I am currently working also cannot be written for the iPhone (whether it will be popular remains to be seen. Mostly, I just want to finish it and use it myself)
For my first "hello world" apps I wound up coding the views entirely by hand and skipping the .xib
The same scenario has repeated itself for many years: a newbie gets annoyed at IB and says "I'm just gonna do it all in code!" and all the graybeards say "ur doin it rong."
It's obvious that your UI is easier to modify and update using IB than hacking it in and out of the view controller code.
Back to the original thread, I do give a little credit to Android to having the option of UI editing done inside of Eclipse. It's not perfect, it's a little hacky, but the concept of slapping down a UI element like a button, naming it, and then having it automatically compile and show up in the editor autocomplete is a powerful thing. The first time it happened it honestly was a nice surprise.
While this is a great feature for reasoning about your xibs, it can probably seem unnecessarily confusing to someone new to Cocoa.
The iPhoneRant blog reflected my experience pretty well with posts like this:
http://www.iphonerant.com/2009/06/xcode-is-flaky-interface-b...
http://www.iphonerant.com/2009/06/hahahahaha-wow.html
Quotes: "Programming the iPhone means managing a hodgepodge of view and view controllers and nav controllers and where the hell was I? It really doesn't allow your brain to just think about what the software is supposed to do. The fact that no one's come out with a good source to teach this stuff is very telling--it's unteachable. You have to slog through it, and when you get it to work, you're done. You can't necessarily explain how you got there or why it works. And it doesn't lend itself to being teachable, which is a good reason all the books on iPhone programming stink."
"The XCode environment is flaky and shit-filled. Little things add up, like the fact that you can't just select a file in the top frame and save it with command-S. No, you get a beep. Can't do that. You have to CLICK IN THE LOWER WINDOW, on the code, and then hit save. Because, otherwise you might save a few clicks and make things easy and intuitive."
I've actually got an App in the store. When I started I figured I'd do this silly little thing as a proof-of-concept and then go on to more ambitious ideas but I gave up because iPhone programming was just so unpleasant I couldn't bring myself to do it anymore.
I commented on UIBuilder here: http://blogjack.net/2009/06/why-do-iphone-development-tools-...
And on the early DRM experience here: http://blogjack.net/2008/07/iphone-20-woes.html
My hope is that one day Apple produces an Apple-worthy development environment.for iPhone OS. XCode/UIBuilder isn't it.
For a few other examples of things you can't do on iPhone:
http://www.twofortyfouram.com/product.html allows a background service to change phone settings dependent on conditions like your current location, time of day, or battery level.
http://slidescreenhome.com replaces the standard home screen with a completely different, and information-centric view.
http://pandora.com is the most obvious example, or any media player application far that matter, for when you want to listen to something other than your mp3 library while using your phone.
Like usual, the Java everywhere approach of it makes it pretty painful when you have a config file error, as a full 1/3 of those are not really validated with something that will tell you that you made an error.
The business case of "No reviewers" makes it a more predictable platform by leaps and bounds over the iphone though. Having done multiple month projects which apple than sat on for 7 weeks without approving or rejecting after months of being "suggested" to add expensive features (such as in app purchases), I can completely see it being better for companies doing "questionable" things (for apple's overly controlling view of questionable), but otherwise, it's a PAINFUL market, as even if you're the only person in a space, there is likely a guy writing an open source version of your app which he'll then release for free.
What I'd REALLY like to see is someone make a app layer that runs on top of the formal API what was about 2x more consistent and 4x less "javay" in both graphical layout and the amount of hand edited XML files you have to do. I'm thinking about trying http://phonegap.com/ and the http://code.google.com/p/android-scripting/ to see if they're better alternatives than pure java for customers looking for android solutions.
Then again, android is more powerful than the sandboxed version of the Apple API that they let you use, but that power comes at a cost of a great increase in complexity.
So maybe Android would be just my thing.
Is it possible that having programmed for the Newton using Newton Toolkit/NewtonScript spoils you for all other mobile development environments?
Of course, the DRM and signing up for the developer program is a complete pain, but waiting and following instructions means it's only a minor hindrance. Even if it's a big philosophical discomfort with the platform.
Maybe I need to work longer at it to discover all the pitfalls?
I tend to have a "knack" for breaking software - which is why I've done QA for a lot of my career. It's clear there exist people who got the iPhone DRM to work once and it just kept working after that; I don't know how they managed it or what if anything I did differently. As a workaround, I eventually got in the habit of treating the iPhone SDK much the way people used to treat word processors back in the day. That is: save often and make frequent backup copies of the whole project. When your project stops working for some mysterious reason, go back to the previous version that did work. In short, I applied "cargo cult" programming techniques.
I did ultimately manage to put an app in the iPhone store but that experience soured me on further iPhone development. Though I might try using Corona sometime.
Corona looks interesting. I could make fun of the spelling mistake on their home page though.
I find the iphone sdk rather obtuse in working with arrays & dictionaries, slicing and dicing strings around and parsing XML with.
I would be very hesitant to use a mobile platform that allowed neither background services nor mounting as a drive (w/o risk of bricking the device). Not to mention one that is closed source. But then my apps are targeted at R&D, not mass market. For mass market apps, the iPhone probably has the advantage.
You don't need to write Java to write Android apps.
http://www.ibm.com/developerworks/opensource/library/os-ecli...
That one had me laughing out loud. Ah.. Good ol' Java, I remember you. Anyway, as an iPhone dev looking to branch out into Android, I found this piece immensely useful, though I'm sure mileage may vary.
The author puts the case that doing interfaces in iPhone is easier, does anyone else have anything to share on the matter?
The only good thing about Eclipse (IMO) is the in-line error handling, otherwise it's just overly bloated, slow, and clunky.
What kinda nonsense is that? I like your OpenGL Tutorials A LOT, but can't take you seriously on that one.
I guess things like Charles Nutter's duby language (and other alternative JVM langs) can really make a much more pleasant experience.