Getting Started with AndroidDo you have an idea for the next revolutionary or “magical” mobile application that will change the world? Do you want this application to run on the premier open mobile operating system, Google® Android? Are you not sure where to start or what tools you need? Do you want your application compatible with all the various Android handsets on the market?
If you answered yes to those questions, you are in the right place! This blog post will give you some basic information and point you towards sources to help you in designing your application.
Android is all about openness. So it should be no surprise that the tools needed to create Android applications are open source and available for the 3 main desktop operating systems, allowing you the freedom to develop your application in the environment that works best for you. Google has come up with a great guide to get the tools you need to get started with Android. It has instructions and links to download and install all the tools you’ll need to develop your new awesome Android application.
Alternatively, Motorola has developed a package called MOTODEV Studio for Android that packages everything you need to get started developing with Android in one package. Included with this package is the MOTODEV Studio for Android plug-in. This plug-in gives you tools that will allow you to sign and export you application so that it is ready for the Android market. You also get tools that allow you to take screen shots of your application in the emulator as well as manage files and database in your emulators or connected devices and much more. If you already have Eclipse installed on your machine and don’t want to download the entire MOTODEV Studio for Android package, you can download and install just the plug-in to your existing Eclipse environment.
Once you have the tools installed and configured you need to have a good grip on some Android fundamentals. Google has a great guide to get you started and will give you a good overview of Android application development.
Application Design Tips
Fragmentation - if you have read about Android development before you’re sure to have run across what people describe as the fragmentation of the Android platform. In about 18 months Android has gone from version 1.1 to 2.1 and is now installed on over 60 different device models. At the time that this blog post was written over half of the Android devices where running a version prior to 2.0. Those 60 devices also have varying screen sizes, screen densities and hardware capabilities. All these factors need to be kept in mind when designing your application.
So how do you design your application to use the newest features of Android while keeping it compatible with older versions of the platform? Reflection is a great solution to this problem. A specific example of this is the Contacts model. The Contacts model for pre-2.0 versions of Android is very different from 2.0+ version. You can still call the older API’s from the new versions of the OS but will not be able to take advantage of the new features that are available to users of the newer OS. In this solution, you would create two wrapper classes one of which would implement the older version of the API while the other class would implement the new version of the API. Once you determine which version of the API your application is currently running you can use reflection to initiate the compatible Contacts wrapper class. For more details about Android and Reflection, see this article.
Views - in an Android application, the user interface is built using View and ViewGroup objects. There are many types of views and view groups, each of which is a descendant of the View class. See this guide from Google for more information about Android Views and UI.
One important thing about the Views for your UI is that they need to be as efficient as possible. There is a real cost to initializing and inflating your layouts and if they are inefficient that cost will be high. It becomes especially bad when you use an inefficient layout in a ListView that contains multiple instances of your view. Check out this series of blog posts by Romain Guy, an engineer on the Google Android project. In this blog series Romain explains how to create efficient views and how to you use the SDK Tools to get some insight into what your views look like to Android:
Motorola has some best practices (with links) for user interfaces with Android that is also very useful:
A very helpful tool for creating the XML for your views is DroidDraw.org. This website allows you to drag and drop common layouts and widgets onto a screen and then generate the XML needed to create that view. While it’s not perfect, it does allow you to very quickly get a base outline of what you want your view to be and then allow you to customize it for you needs. And it’s much better than the one default layout editor that comes with Eclipse.
In a future Android blog post we will look specifically at implementing OAuth in your Android application.
Kelly Klein is a Developer for Fellowship Technologies. He has been with Fellowship Technologies since March 2009. As a side project with Funkypants Software he developed the Fellowship One for Android application. He is passionate about serving the Church through technology.
Posted In: Tips,
- Include Requirements & Contribution Sub Types
- User Case Story from Hope Community Church
- Group Search Categories and More
- Account Creation
- Single Sign On Functionality Exposed
- API Communication Value Changes
- API Enhancement: Create and Edit Groups!
- API Enhancement: Requirements Exposed
- Resource Versioning
- Enter Visitor Data via Your Church Website
- Fellowship One & Planning Center Online
- API Libraries and Sample Code
- Building a custom login for your church website using the API
- Roll Foward!
- The Agile Triangle
- Conversation Paralysis
- Picture this, image updates & creates through the REST API
- A REST API double shot : Groups and Events realms
- Increasing Software Delivery by 500%
- Quick people API realm update
- Introducing the new REST API giving realm
- Raising the bar…
- Building a Deployment Pipeline
- The World of Dev Craft
- Running Tests in Parallel with Selenium
- Abstracting Your Code to Remove Duplication
- Documentation in an Agile Environment
- Drowning in Debt
- Intro to Ruby on Rails
- API Strategy & Roadmap
- Staging/Sandbox Environment is Back up!
- Downtime in Sandbox/Staging Environment
- Android & OAuth
- F1 API Static Library with Objective-c
- Programming in F#
- NoSQL: HuMONGOus Benefits (Part 2)
- Our Scrum Team Structure
- SaaS & BI - The History & Future
- Getting Started with Android
- NoSQL: Leaving Schema Behind (Part 1)
- Your Feedback…and a $25 Gift Card!
- A Scrum Ceremony? Is this a wedding or something?
- Variables in PHP
- Data Exchange API Fixes
- F1 Check-in on the iPad
- Be the first to get the news & tips!
- An Introduction to PHP
- Working with Pop Up Windows in Selenium
- List Comprehension
- Source Control: A Time Machine For Your Source Code
- Developer Conference…Lower Price, Same Great Content!
- The Quality Assurance Team
- How does Fellowship Technologies manage complex projects?
- Developer Conference coming in May!
- Sandbox Refresh Complete
- Sandbox Refresh This Week
- Updates coming to the REST API
- Sandbox Environment Down Time
- F1Touch :: Fellowship One On The Go
- Under the Hood
- Sandbox Refresh Complete
- Sandbox Refresh Tomorrow (Oct. 2nd)
- Fellowship One Developer Forums
- Ten Commandments of API Consumption
- REST API Enhancements / Fixes deployed to Sandbox and Production 09.09.09
- Data Exchange URL cut-over complete
- Important Data Exchange URL changes
- Ron Nom Nom
- How to get started using the REST API