Wednesday, July 11, 2012

Location Finder - My first experience with Android

I started my career as a Java EE developer. Recently, my attention was drawn to the domain of hand-held devices. That was intriguing for me . Well, being a Java developer Android was a fine choice. 
I began by:
  • Learning the basics
  • Developing a project with Android
    • Define the boundaries of the project
    • Code and test
After spending some time on the basics I decided to get my hands dirty. My project is called Location Finder.

Objective:
  • Pinpointing all the points of interest in a radius given by the user on a map. Point of interest could be a specific keyword such as restaurant or a more broad one such as food which might include restaurants, confectioneries or etc.
  • All points of interest should be clickable. After clicking the overlaid icons, name and address of the place must be shown in a dialog box to the user.
So, my choice was a program capable of advising a user of nearest point of interest.

For this project I used 2 API's from Google. Google Map, Google Places and of course GPS on the device. There are so many good tutorials on how to integrate Google map into your code so I'm not going to delve in to that. I think this is sufficient to say that you have to sign up with the service and include a key in your View in order to use Google map services. That key is given by Google.

Business process is demonstrated below:
Diagram 1-Location finder activity diagram
  The diagram is created by Violet uml editor.

MainController class loads my main layout. It incorporates a very simple UI with one EditText,  a SeekBar and 2 TextViews acting as labels. Finally we have 2 Buttons (Find and Cancel). The design is depicted in the class diagram.


Diagram 2-Location finder class diagram

When the find button is clicked an Intent triggers the onCreate method of GMapActivity. The detail can be followed on the diagram 3 which is one possible sequence diagram of this application.
Diagram 3-Location finder sequence diagram

Source Code:

No comments :