Mobile Academy: Android and Eclipse

Posted on October 31, 2012


T2 Android & Eclipse This is an intro­duc­tion to Android SDK tools using the Eclipse IDE for those inter­ested in building Apps. You will get an over­view of the basic soft­ware layers and applic­a­tion archi­tec­ture; a walk through of coding a basic applic­a­tion, simple debug­ging and a quick look at avail­able Lib­raries. Enough to get you started on your first Android App. Kevin McDonagh 27/9, 8pm (Thurs)

This session is run by the veritable Kevin MacDonagh who has been running the Londroid since before android devices were on the market!

for a job he runs Novoda a “specialist” android consultancy, so lets just say he knows his schtuff.
He is often asked “how much does an app costs”.  This is like asking how much a house costs …
However you can mitigate the costs through priorities,  so for example do not do native if you just want exposure eg use phonegap or similar cross platform HTML5 based solution.
£800 with a student programmer through £15,000 for a boutique, costs can go from 35k to 150k if you want more, and employ a larger supplier.  [I know that some of the huge technical suppliers will often charge 6 figures just for the design, let alone the delivery.  So the costs really can vary greatly]
There are over 680 Android  devices on the market,   So do not worry about supporting them all because you can’t , narrow down by your demographic.  Eg remove the 400 Asian only phones …
Your end goal should be about 6 phones for testing and core deliverables.  With care these will also cover the ground for the various major screen sizes and versions of Android.
There are four main application types in an android Application:
  • Actives,
    these do all the actual work,
    a good design has a lot of small activities
  • Content providers
    Provide a rest interface to abstracted data sources
  • Broadcast receivers
    These are registered to take part in tasks happening on the phone,  eg camera, location, sensors, messaging, etc.
  • Services
    These are long running tasks,  may be scheduled, or tied to a broadcast receiver.
Activities which are the major part of your application have a defined life cycle.  All activities are disposable, this is because Android is a low resource environment.  This means that you must design your activities to deal with being reaped (killed, without notice).  Reasons for being reaped could be because of a call, playing music. Other app takes your resources etc.
So make sure you save data and state at key moments, and the activities are re-entrant.
Applications can be paused, restarted, frozen, or stopped, and therefore you must be prepared for any of these states.
For example if the device is rotated, then your activity will be destroyed and restarted.
Here is a diagram showing the transitions of these states.
Your application needs a way to communicate with the Os and to tell it what it is interested in,  this is achieved by registering Intents: an open way of saying to the system is that you expect to use services, these are explicit intentions.  Eg registering an intent for the share button, so that you are called when the user selects share.
Registering on the share button or pother common tasks is a good way to get people to use your app, as you can be called from many different places, tying into the customer’s habits.
Look in the sdk for samples because there are loads, and this will prevent you having to learn to do all of this for yourself.
Hierarchy viewer, is a useful tool and is run up by command line.
In a project you use adapters or modifiers in the values folder, and the phone will look for the directory with that modifier.  The list of modifiers are listed on
Adapters wrap around data models
it is also important to understand that you will need to be Asynchronous
Being Asynchronous
•Loader and CursorLoader
General piece of advice: go with the idioms of android, because this is what the user expects.  Also Google (Play store) will only feature apps who use the google design guidelines.
Here is a blueprint of a well designed application.
Kevin goes on to say that Android is becoming a Common system and is starting to appear in TVs, Cars, cameras and wide range of other electronic run equipment, like robots, factory tools,  and will be used for many different actions.