Now we are going to take a step back from the code and start to think about the system design.

One of the nice things about the Android system architecture and APIs is that the general workflow is well established and, in my opinion, well thought out. I find that the main Android App Components map quite nicely to high level design concepts.

To my mind an Android ‘Activity’ (or possibly a set of related activities) maps quite nicely, conceptually to a User Story, i.e. we should be able to describe in a sentence at a high level what user requirement an Activity satisfies. An Activity should satisfy the Single Responsibility  Principle.

An Activity also defines a User’s interaction for that particular story.

‘Stuff’ that we need to do in the background to satisfy the needs or our Activities can be realised through ‘Services’.

Activities and Services should be nicely self contained. The links between our Components are realised though ‘Intents’.

Activities

From our initial specification  we can quite easily derive a set of Activities that the application needs to perform.

  • The User should be able to Select the Mode of the application (sighting or capture).
  • The User Should be able to View All Sightings.
  • A Sighting user should be able to Add a Sighting.
  • The User should be able to View a Map of All Sightings.
  • A Capture User should be able to View All Missing Animals.
  • A Capture User should be able to Confirm a Sighting.
  • A Capture User should be able to Record a Capture.

Below is a highly UML standards compliant diagram showing the Activities and their transitions.

Note: Not shown is that all Activities can transition back to the Main Activity, also Android maintains a ‘back stack’ that remembers the history of transitions and allows the user to move back through this stack.

Activities and Transitions

Activities and Transitions

Services

  • Read Animal data (web service).
  • Write Animal data (web service).
  • Fetch location from device hardware (Google Play Services API).
  • Fetch map data (Google Play Services API).
  • Receive and notify external update messages (Google Play Services API).

Intents

Starting an activities or calling services will be managed by Intents, we can see from above the Intents required for Activity transitions, additionally Intents will be dispatched to call the services as required.

 

Back To: Testing the webapp from an Android app.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: