Monday, September 27, 2010

UI Development in Android

UI development in Android is fun. It’s fun because the unattractive features in some other platforms are absent from Android. Swing, for example, has to support desktop applications as well as Java applets. Thus, the Java Foundation Classes (JFC) contains so much functionality that it’s frustrating to use and difficult to navigate. JavaServer Faces (JSF) is another example. JSF, a common framework used to build web applications, is actually built on top of JavaServer Pages (JSP) and servlets. So you have to know all of the underlying frameworks before you can begin working with JSF. Fortunately, this type of baggage carried by other platforms does not exist in Android. With Android, we have a simple framework with a limited set of out-of-the-box controls. The available screen area is generally limited. This, combined with the fact that the user usually wants to do one specific action, allows us to easily build a good user interface to deliver a good
user experience.

The Android SDK ships with a host of controls that you can use to build user interfaces for your application. Similar to other SDKs, the Android SDK provides text fields, buttons, lists, grids, and so on. In addition, Android also provides a collection of controls that are appropriate for mobile devices.

Sunday, September 19, 2010

Signing and Publishing Your Application

Writing and running Android applications for your own amusement is all well and good, but the point of creating new applications is to share them with others, whether you charge money for them or give them away for free. Google has created Android Market just for that purpose. Anyone with a connected Android phone can open the Android Market application and immediately download any of hundreds (soon to be
thousands) of applications expressly designed for Android. These applications range from the very practical (Navigation, Timesheets, File Managers, etc.) to the downright silly (applications that make rude noises for the fun of it). There are a number of steps any application developer will go through in preparing and submitting an application to Android Market:

1. Thoroughly test the application—at least with the Android emulator, but also with as many actual Android devices as you can lay your hands on. There is no substitute for testing applications on real phones under real mobile network conditions to prove that they work as you intend. The last thing you want is thousands of people upset with you because your application doesn’t work the way they expect it to.

2. Decide whether you’d like to add an End User License Agreement (EULA) to your application. This is normal practice in the industry (it’s the “click to accept” license that you see when you download an application, even on desktops), and is strongly advised.

3. Create the icon and label you want displayed for your application in the Application Launcher, and attach them to your application.

4. Clean up the application for release: turn off debugging, get rid of any extraneous print or logging statements that you had in for debug, and take a final look at the code to clean it up.


5. Make sure you’ve included a version number and a version name in your manifest file, and of course, bump the version number if this is a new version of a previously released application.

6. Create a signing certificate, and, if needed, a Map API Key.

7. Recompile your application for release using Android Tools.

8. Sign your application using jarsigner and your signing certificate.

9. Retest your signed application to be sure no errors were entered during the process.