Android Application Development 74
stoolpigeon writes "Google's mobile OS Android has received plenty of press. As with a lot of Google products, there was much anticipation before any devices were even available. Now a number of phones are available, with many more coming out world-wide in the near future. Part of the lure of Android is the openness of the platform and the freely available tools for development. The SDK and accompanying Eclipse plug-in give the would be creator of the next great Android application everything they need to make their idea reality. The bar to entry in the official Google Android Marketplace is very low and it doesn't seem to be much of a stretch to predict that the number of developers working on Android is only going to grow. As with any hot technology the number of books will grow as well and O'Reilly's Android Application Development has jumped into the fray, promising to help budding Android developers what they need to get started." Read on for the rest of JR's review.
The book begins with a brief introduction to Android followed by detailed instructions on procuring and installing the Android SDK. Space is given to Windows, Linux and Mac. The install is relatively simple on all three platforms, extra information is provided for Ubuntu users but no others distributions. Extra care is taken to help Windows users with items they may not use regularly, such as environmental variables. This is all pretty basic and gives the book very much of a 'for beginners' feel. Before I had the book I had already installed the SDK and Eclipse plug-in on Windows, Ubuntu and Fedora without any issues beyond getting a current version of Eclipse for the Ubuntu machine. The version I already had from the Ubuntu repositories was not able to run the plug-in. It's a short chapter and if someone really struggles with it, they probably should shift their focus from learning to code to learning how to use their platform of choice. This does set the tone though, that this is a book for those who are very new to development. Android Application Development: Programming with the Google SDK | |
author | Rick Rogers, John Lombardo, Zigurd Mednieks, Blake Meike |
pages | 332 |
publisher | O'Reilly Media Inc. |
rating | 7/10 |
reviewer | JR Peck |
ISBN | 978-0-596-52147-9 |
summary | Programming with the Google SDK. |
Chapter two steps the reader through the ever present "Hello World" and gives an overview of the structure of Android applications. Chapter three introduces the example application that will be used for the rest of the book. There is a lot of repetition here on just what directories and files make up the guts of an Android program. I was quickly worried ( the first four chapters are only fifty-six pages in ) that maybe four authors had been too many. The repetition made it feel as if separate work had been combined without enough editing to remove what was redundant. Fortunately this got better, though there was still a strange proclivity to list files while referring to earlier chapters that explained their purpose. This would be helpful to anyone jumping right into the middle of the book, but the index also serves the same purpose and saves space for more valuable content, as opposed to explaining the purpose of AndroidManifest.xml repeatedly.
Once I moved into the fifth chapter, Debugging Android Applications and the following chapters, things got better. The pace picked up and the repetition dropped off for the most part. The book did not become incredibly difficult, trying to be everything to everyone, but did maintain an introductory style. At the same time the example application makes use of many Android features that are likely to be used by developers. How to set up and use tools was covered step by step. This is very nice but did cause some issues for the authors due to the rapid pace of development on Android. A visit to the book's errata page will show that many readers struggled with changes to the SDK tool set that came out very shortly after the book. The authors say that future editions will fix these issues, but this creates a dilemma for that reader needing introductory level materials. They are more dependent upon the book than a more advanced user and so these issues can be very trying. Based on the responses to the errata posts it became trying for the authors as well. This isn't a knock on the book itself but rather a limitation of the delivery method.
Once the reader is digging down into the example application the team approach to writing the book does become an asset. The authors bring a number of skills to the table that closely resemble the players that would be necessary to a team developing a real-world application. The reader is now being pulled into an example that benefits from the knowledge of each and does a good job of exploring the range of options an Android developer has available. This includes core functionality, UI options and how to best take advantage of the platform while at the same time taking performance and user expectations into account. I felt like I was getting something beyond the excellent documentation provided by Google. This is where I felt the book stood strongest.
Working with a single, large example application was a move that probably helped move things along on writing the book and I think it's an interesting approach. The problem is of course, that means that this example must be right. Right for the task and technically correct. Small issues in the code are inevitable but now their impact is book wide. The changes to the platform just made it just that much more difficult to sort out. On the whole I still found this to be a better approach primarily due to the fact that it gives the features highlighted a better sense of context. Stand-alone examples are often good at highlighting technical features but completely ignore the issues necessary to using the feature in a larger piece of code.
I'm a fan of O'Reilly books. Interestingly enough this doesn't mean that I'll gloss over issues with what they produce. The result is actually the inverse, in that I go into all their titles with a high level of expectation with regards to quality on every level. This may mean that though I strive to be neutral when I look at a book, I'm probably a little tougher on O'Reilly titles. This made my rough start with Android Application Development a bit jarring. The repetition and what felt like sloppy editing are not what I expect. I was quickly given a sense that this book may have been rushed to publication a little sooner than it should have been. As I moved deeper into the book, things improved and while I think there were still editorial issues, things did seem to smooth out to some degree.
There is an interesting tension that exists purely do to the nature of print books. I don't like to bring up print versus electronic in reviews as I don't think it is on topic, but here it is unavoidable. The book is aimed at people that need a little more hand holding and help getting going. It does a good job of providing step by step instructions, the problem is that some of those steps have changed. I don't think anything in the code itself needs to be different, but the tools have changed enough that getting the code to run in a development environment against the new SDK is different. That means that portion of the book is no longer of as much value without going to other sources to find the new steps.
That said, warts and all I found this to be a helpful way to get my feet wet with Android. I really look forward to future versions as I think just a little more time and work will move this from my 'good' list to my 'great' list. Making things a little tighter and cleaning up the few typos and errors would certainly make this an 8 instead of an 7, which is really substantial in my mind. I'm no super developer and I need stuff like this, that can take things a little more slowly and make it all clear. I think this guide is great for those of us in that category as long as the reader is o.k. with hopping to external sources for the information they'll need to get the newer tool set working.
You can purchase Android Application Development: Programming with the Google SDK from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
for android users: (Score:5, Informative)
cyanogenmod + enochx = much more visually appealing, many features added to your phone.
Rooting is not as complicated as it used to be - meanwhile, there are lots of sites out there on programming an android phone with great info, even google's. [android.com]
Re: (Score:2)
+1 on this.
My G1 runs incredibly well and consistently with CM + Enoch. I can't believe what a difference it is from my corporate phone (identical G1 but running T-Mobile's latest ROM).
Re: (Score:2)
damn, what company do you work for that lets you have a G1 for a corporate phone? I'm stuck at a workplace that sticks with blackberry only, etc.
Re: (Score:2)
That's because a BlackBerry lets them control their company data. And decide to allow/deny every little function of the device.
Unfortunately, with phones, fun != good for business. Though they sometimes overlap.
Solidity of the platform? (Score:5, Insightful)
The one really big hurdle which Android faces and which WinMo and iPhone have worked around is the problem of a moving target. Since Android is a work in progress, with OEMs deciding which version to release, there is only a core set of functionality that could be expected to exist across all versions on all phones. Now, this core set of functionality may be very large and useful, but without a rigorous breakdown of the differences between devices it still feels like a crapshoot.
Attention to this "always in beta" aspect of developing on the Android platform would have been nice. Of course, Google just wants people developing apps and not worrying about how things may change. Unfortunately, this is a serious concern for developers of enterprise applications, and it may end up being Android's Achilles Tendon in the long run.
Re: (Score:2)
You don't really need ram. With a swap and storing apps on the SD card, the ram just makes the OS run smoother. Rooted, my phone runs just as smooth as hero (and can run the hero build).
Of course the hardware will result in continual improvements to performance, but the ram by itself doesn't do what people think it does in this case.
Re: (Score:2)
Here's the issue with the RAM on my G1 and of course I'm running Cyanogenmod. I have Debian on it in a bootstrap environment. In order really use it, I need to first start it up in the terminal, start some Window manager inside of debian and get vncserver going. Then I start the vncviewer on Android to be able to see the desktop. About the time I start a program in debian, the phone runs out of RAM and the terminal gets killed. There goes debian, et al. More ram would cure that problem. Also, Opera g
Re: (Score:2)
you're trying to run debian on the droid. Until we have some better ARM accelerating that in itself is quite hard. Custom firmware is different than straight up debian.
I agree more ram is better period but you know, there are better mobile devices for that purpose. Plenty.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
every iphone and ipod touch runs the latest OS. only difference is touch users have to pay for a major release.
my wife's iphone 3G came with 2.1 and i'm going to upgrade it to 3.1.2 soon because some apps are requiring 3.1 at the minimum due to new functionality introduced.
Re: (Score:1)
Actually, applications developed on earlier API levels (as Android calls them) are always forward compatible with newer API levels. Sure, APIs may be deprecated and replaced with newer interfaces, like any platform, but it won't cause your app to break as you are implying.
With the new Android SDK things like different screen sizes are being allowed, which I consider a boon. The one thing that always bugged me about BlackBerry was the different screen sizes and device capabilities. Now Android developers h
Re: (Score:2)
Actually, Android's "always in beta" has been a boon for users. The package management system is a boon for developers. I bought my phone nearly one year ago and periodically it tells me there is a system update. After the update things are usually much better. It shouldn't be a concern for enterprise developers familiar with developing for Linux - upgrades are handled very automatically, and distributing and installing software is easy. It really isn't much more different than writing for any stack -
Re: (Score:2)
The one really big hurdle which Android faces and which WinMo and iPhone have worked around is the problem of a moving target.
What does this mean? Do you have any understanding of what you're talking about? Please explain to us how these other platforms "worked around" this issue.
Re: (Score:2)
Having to download Eclipse IDE (not the full version) and a plugin is refreshing to the developer and the way it should be done.
Re: (Score:2)
Re: (Score:3, Informative)
* The un-restrictive terms of Android's license have allowed corporations using Android to place restrictions on their own customers. As an example, tethering (PC or laptop internet connectivity via the cell phone) is forbidden by T-Mobile USA, and the Android Market has de-listed such applications for T-Mobile customers.[109] This also means that the apps can be carrier-specific as chosen by Google.[110]. (As a note, users can still download any application that is hosted on
Re: (Score:2)
you know, i didn't check who posted that wikipedia article and assumed that it was someone showing the previous poster that it was the companies releasing the phone, not the platform that wasn't 100% open. hahaha he rebutted his own post! :D
Re: (Score:1, Interesting)
Android is not open, parts of it are still locked down. Not even the SDK is open. How is it that all of the carriers all have their own flavor planned, and all of which are going to create limitations for the consumer, not empower them. This is the same system we are both talking about right? OH wait, AT&T must have a pure android flavor planned right? they are going
Re: (Score:2)
I understand what you are saying and all but as far as Android goes, it is open source. You can go right now and download the source code, compile it for the device of your choice, sell millions of them with a high quality OS and not pay a dime in licensing costs. You can't say that for WinMo or whatever else. Maybe Symbian, I haven't looked. People like Cyanogen, Hikaru, etc., can go and get it, tweak it out the wazoo and as long as they aren't distributing closed source apps with it, can release it to
Re: (Score:2)
Re: (Score:2)
This is not true. Here in Australia I've been able to start my HTC Dream (G1 for you yanks) outside Three's (Hutchinson telco in Australia) coverage, both in zero coverage and roaming coverage.
The rest of your post is pointless complaining. APK's from any source can be installed bypassing telco app control and an android rom can be replaced with a community ROM if the
Re: (Score:2)
Re: (Score:3, Informative)
This is an issue with US telco's not with And
O'reilly books (Score:4, Informative)
IMO, O'Reilly's once stellar reputation has gone downhill since the days when they only had a handfull of titles. I think these days in the rush to churn out a Learning/Mastering/Pocket Reference/Nutshell book for every language and variant thereof their editors miss quite a bit. Now you have to scrutinize their books just as much as the other publishers (although they haven't quite hit the abomination level that the Whatever-Language "Bible" books are that Wiley publishes).
Re: (Score:1)
Google != Android (Score:4, Insightful)
Just a reminder: Google and Android are not affiliated in any way any longer except that Google is a member of the Open Handset Alliance (OHA).
Google bought Android the company, developed Android the OS, then spun it off under control of the OHA, in which they are one participating member.
When a phone company develops hardware using Android, the operating system is open source/freely available. They can customize it. But if they want to bundle applications on it, say Google Maps, they have to license those apps from Google. Android is not Google, Google is not Android.
For what it's worth, I run a G1 with Cyanogen's latest mod. I have no Google apps that I care about anymore.
Re: (Score:2)
Do you use maps?... what do you use?
Do you use mail?... what do you use?
Re: (Score:2, Interesting)
peoplesChoice = People + OpenMeshPoint2PointNetwork + OpenSoftware + OpenHardware;
Start making it, or Microsoft/Danger says "all your data are belong to us"
Re: (Score:3, Interesting)
Open software / hardware, sure, lovely.
And the "open mesh point-to-point network" idea is cute too, but doesn't work so well for VOIP and voice (too many hops, ick!) and doesn't work at all unless there's a bunch of people in the area doing it: lots of Silicon Valley hops, sure, but how do you string over the mountains even to a place as close as Santa Cruz? and what's the point if you can't ?
So I don't see that replacing my network carrier any time soon. Mesh-huggers. Gaah.
Re: (Score:2, Interesting)
Just as our modern "Free" internet is, a new wireless network would have to operate on a variety of technologies. A mesh would actually work out great for metro areas in terms of simple data, handset to handset, but there would have to be more powerful fixed site connections to allow continuity across the lager scope of the project. There is a Ukrainian guy who made a nice point to point with (i think) off
Re: (Score:2)
I believe Santa Cruz Operation is not supported. :)
Re: (Score:2)
doesn't every app the uses the google (map) SDK require the google components? that's a large percent of the apps. AFAIK, there's no replacement for things like the google SDK, and even if there was, nobody is writing software to utilize it.
regardless. cyanogen != no google. in 5 steps you can get the latest cyanogenmod with google components, in a google-approved manner.
Re: (Score:2)
The OS is open source, some of the Apps are not. It's no different than some developing a closed source app for Linux and expecting to be paid for it, which is perfectly in line with every open source licensing system in the world.
Re: (Score:1)
Re: (Score:2)
You shouldn't be an unmitigated idiot and asshole, but you are.
Sometimes shit happens.
Re:Ummm...NOT Open Source (Score:5, Informative)
And your proof of this claim is...what, exactly?
Perhaps you are referring to an incident from about 2-3 weeks ago, when a ROM modder was sent a cease-and-desist letter by Google for including closed-source applications in his Android ROMs. The consensus opinion is that Google was legally right but clumsy in how they handled this incident. However, misrepresenting what happened helps nobody.
Better yet, bash factually.
In the interest of full disclosure, per my sig, I'm involved in the Android development community.
Re: (Score:2)
It's only open source until Google decides that they don't want someone else using the "Open Source" code and files a court injunction as was done last week
What? Last week's situation was caused by someone distributing proprietary software that did not have permission. Google could not have stopped Cyanogen had the mod not included Google's proprietary software. Google deserves no ire for their actions, and Cyanogen's response was 100% class. Android is coming of age quickly.
Re: (Score:1)
I am a co-author... (Score:4, Informative)
I am a co-author of this book. Feel free to ask me about it. If I can't answer, I'll make sure your questions get to the other co-authors and/or our editor.
Re: (Score:3, Informative)
That's not really a subject of the book. And I don't have any access to Google's decision-making on that, but one of my co-authors and I created a system that, like Android, used Java on handsets, so we explored this issue in some depth:
1. Making a good JIT is very difficult. Open source JITs, at the time we were putting a Java on ARM-based systems, provided very little performance improvement over an interpreter.
2. Other system components, like the graphics stack and garbage collector have very large impac
Re: (Score:2)
Re: (Score:2)
The book does not cover code obfuscation. I have also not tried obfuscation for Android projects.
Android applications are distributed as archives -.apk files - made mostly of Dalvik bytecode files - .dex files. While you can "dump" a dex file to human readable code, I do not know of a dex to Java decompiler, nor a dex to Java bytecode reverse translator.
This thread in the Android developers group...
http://groups.google.com/group/android-developers/browse_thread/thread/dcc5808b002a47fc?tvc=2 ...includes an
More (great) Android Books (Score:2, Informative)
First off, let me admit that I have not yet read the Book reviewed here, but from reading the review, it sounds like it is targeted mainly to the "new to programming" crowd.
I have started my Android Development career by reading Mark Murphy's "Busy Coder's" books, and gotten a lot of details out of his Tutorial book.
http://commonsware.com/books.html [commonsware.com]
I'm not affiliated with him, but I'd like to really recommend his books to any developer who has an existing background in either Java and wants to quickly get p
Re: (Score:2)
App Store? (Score:2)
Once you've built your app, how do you market it on the Google app store? Do you need a license or registration to upload it? How do you upload it? Does it have to be signed or otherwise processed after it's an executing binary? How do you get paid? How do you include a GPL or other license, and the source code if required/desired?
Those details of "development" are going to be the greatest incentive, or inhibitor, to developers. Especially like me.
Re: (Score:2)
Once you've built your app, how do you market it on the Google app store? Do you need a license or registration to upload it? How do you upload it? Does it have to be signed or otherwise processed after it's an executing binary? How do you get paid? How do you include a GPL or other license, and the source code if required/desired?
Those details of "development" are going to be the greatest incentive, or inhibitor, to developers. Especially like me.
You generate a key and sign your binary. Applicable links would be : http://developer.android.com/guide/publishing/app-signing.html [android.com] and: http://developer.android.com/guide/publishing/publishing.html [android.com]
I recently developed an app for Android. It took a moderate amount of Java programming knowledge and a week or two to crank out a working application (working in my spare time). I figure that's a pretty resounding endorsement of the SDK.
Re: (Score:2)
Marketing is entirely up to you, there is no "staff pick" or other kind of rigged personality contest. Advertise by any method you see fit, you can even direct link to the Android marketplace by URL or QR code from another web site or even a print or web ad using a QR code. QR codes on Cyrket [cyrket.com] are useful as I can brows the market on my PC and then use a bar code scanner to take my phone straight to the installer page on the marketplac
Re: (Score:2)
Just a few nits to pick:
Google does have a "featured apps" section. I'm not sure how they determine what gets featured, but it does exist.
Uploading the binary is as simple as filling out a web form -- just fill in the details, select the binary, and hit submit.
Google does require you to sign your binaries. It's a simple process, it can be done either from the plugin in Eclipse or manually.
Google does vet the app store, just not the same way as Apple does theirs. When you upload an app, you have to ve
Re: (Score:2)
Is Nokia maemo / N900 an android killer? (Score:4, Interesting)
I have to hand it to Google for trying to break the proprietary locked cell phone one trick pony problem, but so far everything I have seen indicates that we just have another locked up OS. This is free software for the handset makers, not the end user.
What we want and need is a fully Linux, no bs platform, no hidden anything. So far, the nokia n900 looks like it will do that. Especially with the announcement of the qt libraries will be in the next versions of maemo.
I am sick of being treated like a criminal for jail-breaking / accessing my own hardware and software that I payed lots of money to own and use as I see fit. F*** Google and all their handset Android makers. I am voting with my dollars and my companies dollars, and going with a full linux distro I can customize as needed for my business.
Now I just hope Nokia does not get stupid and drop the ball. They seem to have a tendency to loose their momentum.
new to development (Score:1)
Definitely an easy platform to develop for. (Score:1)