You are on page 1of 41

CHILL-OUT LONDON ANDROID APP

Project Developmental Report

Cardiff Metropolitan University


Module Supervisor: Nigel Kermode
London School of Commerce
In partial fulfillment of requirements or a !e"ree of #$c %Computin"& $emester ' %Au"ust ( )*+,&

Submitted by:

Mawuko Kwame Agbemenyah

Abstract:
With the emergence and increasing popularity of smart phones there has been significant growth in marketing and mobile applications development for android over the past few years demands for easy access to location based services have increased over the span of the introduction of android application for use by smart phone owners and businesses! "his pro#ect aims at developing an application that will provide a location based service for android platform the application is to help in the services of locating pubs and restaurants across $ondon! "his pro#ect will help me learn the basics of application development and e%ploitation of programming languages such as #ava and implementing the concepts of location&based systems' e%periment with the different S(Ks available for the android platform and integrating all that into in a useful and interactive mobile application!

TABLE OF CONTENTS
*ntroduction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!+ $iterature ,eview!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!,esearch Methodology and "echnology Used!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!./ ,eferences!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!0/

List of Figures
2igure . $3S as an intersection of "echnologies 43rimi&Combe )//)5!!!!!!!!!!!!!!!!!!!!!!+ 2igure ) Shows the 6eographic interface of maps on smart devices!!!!!!!!!!!!!!!!!!!!!!!!!!7 2igure 1 *nitial Screen of the (evelopment!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.1 2igure 0 *nserting the logo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.0 2igure + Splash screen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.0

2igure 8 9ome :age U* interface for the ;pplication!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.+ 2igure < 2igure ,estarant :age!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.8 =MU$;">, ;C"*?*"*=S!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.<

2igure 7 $ogo as Splash screen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.< 2igure ./ ;:: 9ome :age in =mulator!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.2igure .. ;:: restaurant navigation page in =mulator!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.7

2igure .) M(+ Keys and 2ingerprint!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)/

Introduction
1.1 Overview

Smart phones and the internet connectivity have changed communication and the lifestyle of users! "hese phones allow access to the internet wherever a user is to find information on events and places! *nformation is ac@uired from the internet through these devices either on events such as 4cinema parties5 or places such as 4pubs restaurants and routes5! $ooking for a pub or restaurant to dine where there are good meals services and offers for the $ondoner there is the needs to know the location of the user so as to help limit the vast geographical location given the actual location and the nearest pubs and restaurant! "his search restriction can be done through $ocation 3ased Service 4$3S5! "his service is available for devices through mobile network and utiliAing the ability to make use of location on mobile device! ;ccording to the *nternational >pen 6eospatial Consortium $3S is a wireless *: service which uses geographic information to serve mobile device user! "hese definitions described 4$3S5 to be an intersection of three technologies' this is shown in the figure below

Figure 1 LBS as an intersection o Techno!ogies "Brimi#Combe $%%$&

9istorically there have been instances of communication geo&location services in posters and adverts on events and activities but these forms of communication are usually one&way communications! $3S give the possibility of a two way communication and interaction traffic in which the user tells the service provider his actual conte%t like the kind of information he needs from his position and preferences! "his helps the provider of such services to deliver well informed response to the user! +

*n an in&depth look into the activities of most $ondoners there is a trend in behaviour and lifestyle pattern that runs throughout every week! Most $ondoners devote their time to work during the weekdays and catch up with friends and fun on 2riday nights or in the evenings! *n that there are always plans to meet up at pubs or a particular restaurant either a day before or discussed at work! :ubs mostly studied these behaviours and have strategiAed to get the most of this weekend potential of making the most out of the period as business turns back to dry or normal after the onset of another week! "he app Chill&>ut $ondon studied this phenomenon and tries to bridge the gap between people and businesses such as pubs and restaurants as there is the tendency of attracting potential customers if they are aware of the products or service packages available to them throughout the week on their mobile through the app!

1.2

Aims

"he aim of this pro#ect is to develop a location based system application for android smart phones to allow users to have access to the location of pubs and restaurants providing real&time userBs location through a geographical environment provided by 6oogle maps!

1.

Ob!ectives

"he ob#ectives of this application are: "o investigate advantages limitations and challenges of developing a mobile android application! "o study development process of a fully functional location based application! 2or the ;pp to displaying pub or restaurant and the status updates! 2ind new and interesting places events and activities! Know what offers the pubs and restaurants have to help users know what the money in their pocket is really worth!

<

Literature "eview
"his chapter describes the applications and processes necessary to develop this app some of which are ;N(,>*( ;(" SC$ite and $3S Components 46oogle Map5! Chill&>ut $ondon is a concept to develop an application for the android platform that could help the users to find list of pubs and restaurants and their location on the app! "his pro#ect will help pubs and restaurant owners to create an application based advertising and promotion of their business through the services of the app and get the end user to be able to indicate their activities around on the app as feeds and response! "his pro#ect will make use of ;ndroid (evelopment "ool kit 4;("5 SC$ite and 6oogle Map to implement this application!

1.1 Android A#$


"he ;ndroid (evelopment "ools 4;("5 is a plug&in for =clipse *(= which was designed to provide a very powerful and integrated working environment for software and android applications! ;(" is an e%tension to the capabilities of =clipse which let you easily and @uickly set up ;ndroid pro#ects creates a User *nterface 4U*5 application add packages on the ;ndroid 2ramework ;:* debug your applications using the ;ndroid S(K tools and even e%port signed or unsigned !apk files in other to distribute your application! ;pplications (eveloping in =clipse using the ;(" is the fastest and is highly recommended! With guided pro#ect set&up it provides tools integration custom DM$ editors and debug output pane the ;(" gives you an incredible boost in developing ;ndroid applications!

1.2 S%Lite
SC$ite database server allows users to add access and process data which is stored in the computer database! *t is a ,elational (atabase Management System 4,(MS5 that stores data in tables rather than storing data in a massive storage in order to increase speed and fle%ibility! "o use relational database it is necessary to understand some basic concept of database! SC$ 4Structured Cuery $anguage5 is a standardiAed language to access database!

1.

&oogle 'a( A)I *e+

6oogle Map ;ndroid ;pplication :rogramming *nterface 4;:*5 is a 6oogle application which gives access to 6oogle Maps servers the 6oogle map ;:* key is a code passed in by programs to call ;:* to identify the program that calls it its developer or user it is used to track and control how it is being used and also serve both as a uni@ue and a secret token for a giving access to data downloading map display and response to map gestures! "his also authentication and has a set of access rights associated with it to allows you to use ;:* calls to add markers polygons and overlays to a basic map and to change the userEs view of a particular map area! "hese ob#ects provide additional information for map locations and allow user interaction with the map! "he ;:* allows you to add these graphics to a map: *cons anchored to specific positions on the map 4Markers5! Sets of line segments 4:olylines5! =nclosed segments 4:olygons5! 3itmap graphics anchored to specific positions on the map 46round >verlays5! Sets of images which are displayed on top of the base map tiles 4"ile >verlays5! ;n ;:* specifies how some software components should interact with each other! *n practice most often an ;:* is a library that includes specifications for routines data structures ob#ect classes and variables!

Figure $ Shows the 'eogra(hic inter ace o ma(s on smart )e*ices

"esearch 'ethodolog+ and $echnolog+ ,sed


"he methodology used for the pro#ect is the iterative and incremental approach through which the application is developed! "his was done through a Flearning by doingG approach as this is my first android application development! ; clear pro#ect re@uirements was set to guide through the process! ; step by step process was taken to ensure a satisfactory development and result! ;n iterative and incremental method can be a representation as a cyclical model and progress in the development of a

Chill&>ut $ondon was developed using eclipse and android development tools such as the android S(K and ;(" tools to render and implement the designing and developmental transitions of the app!

./

;ndroidBs openness has made it a favourite for consumers and developers alike driving strong growth in app consumption! =asily optimiAe a single binary for phones tablets and other devices! ;ndroid gives you everything you need to build best&in&class app e%periences! *t gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devicesHfrom phones to tablets and beyond! ;ndroid also gives you tools for creating apps that look great and take advantage of the hardware capabilities available on each device! *t automatically adapts your U* to look its best on each device while giving you as much control as you want over your U* on different device types! Iou declare your U* in lightweight sets of DM$ resources one set for parts of the U* that are common to all form factors and other sets for optimAations specific to phones or tablets! ;t runtime ;ndroid applies the correct resource sets based on its screen siAe density locale and so on! "o help you develop efficiently the ;ndroid (eveloper "ools offer a full Java *(= with advanced features for developing debugging and packaging ;ndroid apps! Using the *(= you can develop on any available ;ndroid device or create virtual devices that emulate any hardware configuration! .!+ billion downloads a month and growing! 6et your apps in front of millions of users at 6oogleEs scale! >pen marketplace for distributing your apps 6oogle :lay is the premier marketplace for selling and distributing ;ndroid apps! When you publish an app on 6oogle :lay you reach the huge installed base of ;ndroid!

;s an open marketplace 6oogle :lay puts you in control of how you sell your products! Iou can publish whenever you want as often as you want and to the customers you want! Iou can distribute broadly to all markets and devices or focus on specific segments devices or ranges of hardware capabilities! Iou can monetiAe in the way that works best for your businessHpriced or free with in&app products or subscriptionsHfor highest engagement and revenues! Iou also

..

have complete control of the pricing for your apps and in&app products and can set or change prices in any supported currency at any time! 3eyond growing your customer base 6oogle :lay helps you build visibility and engagement across your apps and brand! ;s your apps rise in popularity 6oogle :lay gives them higher placement in weekly KtopK charts and rankings and for the best apps promotional slots in curated collections!

.)

Figure + ,nitia! Screen o the -e*e!o(ment

Figure . ,nserting the !ogo

Figure /

S(!ash screen

.0

Figure 0 1ome 2age 3, inter ace or the A((!ication

.+

Figure 4

5estarant 2age

.8

Figure 6

EM3LATO5 ACT,7,T,ES

Figure 8 Logo as S(!ash screen

Figure 1% A22 1ome 2age in Emu!ator

.-

Figure 11

A22 restaurant na*igation (age in Emu!ator

.7

Figure 1$ M-/ Keys an) Finger(rint

)/

1. .1
import import import import

Source code for the develo(ment


android.app.Activity; android.content.Intent; android.media.MediaPlayer; android.os.Bundle;

package com.chilloutlondon;

public class Splash extends Activity { MediaPlayer mplayerSplash; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mplayerSplash = MediaPlayer.create(this, R.raw.alive); mplayerSplash.start(); setContentView(R.layout.activity_splash); Thread logoTimer = new Thread(){ public void run(){ try { short logoTimer = 0; while (logoTimer <5000){ sleep (100); logoTimer = (short) (logoTimer +100); } startActivity(new Intent("com.chilloutlondon.EMPTYSCREEN")); } catch (InterruptedException e) { e.printStackTrace(); } finally { finish(); } } }; logoTimer.start(); }; @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); mplayerSplash.release(); } // TODO Auto-generated catch block

@Override protected void onPause() { super.onPause(); mplayerSplash.pause(); } @Override protected void onResume() { super.onResume(); mplayerSplash.start(); } @Override protected void onStart() { super.onStart(); } @Override protected void onStop() { super.onStop(); }

// TODO Auto-generated method stub

// TODO Auto-generated method stub

// TODO Auto-generated method stub

// TODO Auto-generated method stub

@Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); } }

))

1. .2

"-S$A,"A.$ /A0A CO#-S

package com.chilloutlondon; import android.app.Activity; import android.os.Bundle; public class Restaurant extends Activity{ @Override protected void onCreate Bundle saved!nstance"tate# { $$ %O&O Auto'generated method stub super.onCreate saved!nstance"tate#; setContent(ie) R.layout.restaurant#; * *

)1

1. .

'-., /A0A CO#-S

package com!chilloutlondon' import android!app!;ctivity' import android!content!*ntent' import android!os!3undle' import android!view!?iew' import android!widget!3utton' public class Menu e%tends ;ctivity L M>verride protected void onCreate43undle saved*nstanceState5 L NN ">(> ;uto&generated method stub super!onCreate4saved*nstanceState5' setContent?iew4,!layout!menu5' 3utton b,estaurant O 43utton5 find?iew3y*d4,!id!2eatures5' b,estaurant!set>nClick$istener4new ?iew!>nClick$istener45 L M>verride public void onClick4?iew v5 L NN ">(> ;uto&generated method stub start;ctivity 4new *ntent4Kcom!chilloutlondon!,=S";U,;N"K55' P P5' P P

)0

package com.ma)uko.chilloutlondon; import import import import import +ava.util.,ist; android.R; android.app.Activity; android.os.Bundle; android.util.,og; $-- Called )hen activity is .irst

public class ChillOut&atabase extends Activity { created. -$ private static .inal "tring &A%ABA"/01A2/ 3 4ChillOut&atabase.db4; private static .inal "tring &A%ABA"/0%AB,/ 3 4main%able4; private static .inal int &A%ABA"/0(/R"!O1 3 5; public public public public static static static static .inal .inal .inal .inal "tring 6/70!&340id4; "tring 6/701A2/341A2/4; int 1A2/0CO,821 3 5; "tring 6/70,OCA%!O134,OCA%!O14;

$--!ndex keys .or )here clauses. -$

public static .inal "tring 6/70%79/34%79/ O: ACCO22O&A%!O14; public static .inal "tring 6/70no34182B/R O: ROO2"4; public static .inal "tring 6/70CO"%34CO"%4; public static .inal "tring 6/70"/R(!C/"34"/R(!C/"4; @Override public void onCreate Bundle saved!nstance"tate# { super.onCreate saved!nstance"tate#; setContent(ie) R.layout.expandable0list0content#; &atabase;andler db 3 ne) &atabase;andler this#; * * *

)+

package com.ma)uko.chilloutlondon; import +ava.util.Array,ist; import +ava.util.,ist; import import import import import android.content.Content(alues; android.content.Context; android.database.Cursor; android.database.s<lite."=,ite&atabase; android.database.s<lite."=,iteOpen;elper;

public class &atabase;andler extends "=,iteOpen;elper { private (ersion private private private private private static .inal int &A%ABA"/0(/R"!O1 3 5; static static static static static .inal .inal .inal .inal .inal "tring "tring "tring "tring "tring $$ All "tatic variables and $$ &atabase $$ &atabase 1ame $$ Contacts table name $$ Contacts %able Columns names

&A%ABA"/01A2/ 3 4contacts2anager4; %AB,/0CO1%AC%" 3 4contacts4; 6/70!& 3 4id4; 6/701A2/ 3 4name4; 6/709;01O 3 4phone0number4;

public &atabase;andler Context context# { super context> &A%ABA"/01A2/> null> &A%ABA"/0(/R"!O1#; * @Override public void onCreate "=,ite&atabase db# { "tring CR/A%/0CO1%AC%"0%AB,/ 3 4CR/A%/ %AB,/ 4 ? %AB,/0CO1%AC%" ? 4 4 ? 6/70!& ? 4 !1%/@/R 9R!2AR7 6/7>4 ? 6/701A2/ ? 4 %/A%>4 ? 6/709;01O ? 4 %/A%4 ? 4#4; db.exec"=, CR/A%/0CO1%AC%"0%AB,/#; * $$ Creating %ables

@Override public void on8pgrade "=,ite&atabase db> int old(ersion> int ne)(ersion# { $$ 8pgrading database db.exec"=, 4&RO9 %AB,/ !: /A!"%" 4 ? %AB,/0CO1%AC%"#; $$ &rop older table i. existed

)8

onCreate db#; * void addContact Contact contact# { "=,ite&atabase db 3 this.getBritable&atabase #; Content(alues values 3 ne) Content(alues #; values.put 6/701A2/> contact.get1ame ##; $$ Contact 1ame values.put 6/709;01O> contact.get9hone1umber ##; $$ Contact 9hone $$ !nserting Ro) db.insert %AB,/0CO1%AC%"> null> values#; db.close #; $$ Closing database connection * $$ @etting single contact Contact getContact int id# { "=,ite&atabase db 3 this.getReadable&atabase #; Cursor cursor 3 db.<uery %AB,/0CO1%AC%"> ne) "tringCD { 6/70!&> 6/701A2/> 6/709;01O *> 6/70!& ? 43E4> ne) "tringCD { "tring.valueO. id# *> null> null> null> null#; i. cursor F3 null# cursor.move%o:irst #; Contact contact 3 ne) Contact !nteger.parse!nt cursor.get"tring G##> cursor.get"tring 5#> cursor.get"tring H##; $$ return contact return contact; * $$ @etting All Contacts public ,istIContactJ getAllContacts # { ,istIContactJ contact,ist 3 ne) Array,istIContactJ #; $$ "elect All =uery "tring select=uery 3 4"/,/C% - :RO2 4 ? %AB,/0CO1%AC%"; "=,ite&atabase db 3 this.getBritable&atabase #;

$$ Create tables again

)<

Cursor cursor 3 db.ra)=uery select=uery> null#; $$ looping through all ro)s and adding to list i. cursor.move%o:irst ## { do { Contact contact 3 ne) Contact #; contact.set!& !nteger.parse!nt cursor.get"tring G###; contact.set1ame cursor.get"tring 5##; contact.set9hone1umber cursor.get"tring H##; $$ Adding contact to list contact,ist.add contact#; * )hile cursor.move%o1ext ##; * $$ return contact list return contact,ist;

$$ 8pdating single contact public int updateContact Contact contact# { "=,ite&atabase db 3 this.getBritable&atabase #; Content(alues values 3 ne) Content(alues #; values.put 6/701A2/> contact.get1ame ##; values.put 6/709;01O> contact.get9hone1umber ##; $$ updating ro) return db.update %AB,/0CO1%AC%"> values> 6/70!& ? 4 3 E4> ne) "tringCD { "tring.valueO. contact.get!& ## *#;

$$ &eleting single contact public void deleteContact Contact contact# { "=,ite&atabase db 3 this.getBritable&atabase #; db.delete %AB,/0CO1%AC%"> 6/70!& ? 4 3 E4> ne) "tringCD { "tring.valueO. contact.get!& ## *#; db.close #; *

)-

$$ @etting contacts Count public int getContactsCount # { "tring count=uery 3 4"/,/C% - :RO2 4 ? %AB,/0CO1%AC%"; "=,ite&atabase db 3 this.getReadable&atabase #; Cursor cursor 3 db.ra)=uery count=uery> null#; cursor.close #; $$ return count return cursor.getCount #;

* *

package com.ma)uko.chilloutlondon; public class Contact { $$private variables int 0id; "tring 0name; "tring 0phone0number; $$ /mpty constructor public Contact #{ * public Contact int id> "tring name> "tring 0phone0number#{ this.0id 3 id; this.0name 3 name; this.0phone0number 3 0phone0number; * public Contact "tring name> "tring 0phone0number#{ this.0name 3 name; this.0phone0number 3 0phone0number; * public int get!& #{ return this.0id; *

$$ constructor

$$ constructor

$$ getting !&

)7

public void set!& int id#{ this.0id 3 id; * public "tring get1ame #{ return this.0name; * public void set1ame "tring name#{ this.0name 3 name; * public "tring get9hone1umber # return this.0phone0number; * public void set9hone1umber "tring phone0number#{ this.0phone0number 3 phone0number; * *

$$ setting id

$$ getting name

$$ setting name

$$ getting phone number

$$ setting phone number

1/

1. .1

2'L CO#- FO" $3- #-0-LO)'-.$

MENU XML CODES


IRelative,ayout xmlnsKandroid34httpK$$schemas.android.com$apk$res$android4 xmlnsKtools34httpK$$schemas.android.com$tools4 androidKlayout0)idth34match0parent4 androidKlayout0height34match0parent4 toolsKcontext34.ChillOut&atabase4 J IButton androidKid34@?id$button54 style34EandroidKattr$button"tyle"mall4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arentRight34true4 androidKlayout0align9arent%op34true4 androidKlayout0toRightO.34@?id$buttonL4 androidKbackground34@dra)able$pubs4 androidKmin;eight3455Gdp4 androidKminBidth345MGdip4 androidKtext34@string$9ubs4 $J IButton androidKid34@?id$buttonL4 style34@id$button54 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arentBottom34true4 androidKlayout0align9arent,e.t34true4 androidKlayout0align9arent%op34true4 androidKbackground34@dra)able$accm4 androidKgravity34center0verticalN.ill0verticalNcenter0horiOontalNcenterNclip0vertical4 androidKmax;eight34PGGdip4 androidKmaxBidth34LGdip4 androidKtext34@string$accm4 androidKtext"tyle34bold4 $J IButton

1.

androidKid34@?id$:eatures4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0above34@?id$buttonQ4 androidKlayout0align9arentRight34true4 androidKlayout0belo)34@?id$button54 androidKlayout0toRightO.34@?id$buttonL4 androidKbackground34@dra)able$restaH4 androidKmin;eight3455Gdp4 androidKminBidth345MGdip4 androidKtext34@string$Resta54 $J IButton androidKid34@?id$buttonQ4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0above34@?id$buttonR4 androidKlayout0align,e.t34@?id$:eatures4 androidKlayout0alignRight34@?id$:eatures4 androidKbackground34@dra)able$events4 androidKmin;eight3455Gdp4 androidKminBidth34HGGdip4 androidKtext34@string$events4 $J IButton androidKid34@?id$buttonR4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align,e.t34@?id$buttonQ4 androidKlayout0align9arentBottom34true4 androidKlayout0align9arentRight34true4 androidKbackground34@dra)able$resta54 androidKmin;eight345GGdip4 androidKminBidth345MGdip4 androidKtext34@string$Others4 $J I$Relative,ayoutJ

1)

R/"%A8RA1% A2, CO&/ IExml version345.G4 encoding34ut.'P4EJ IRelative,ayout xmlnsKandroid34httpK$$schemas.android.com$apk$res$android4 androidKlayout0)idth34match0parent4 androidKlayout0height34)rap0content4 androidKorientation34horiOontal4 J IButton androidKid34@?id$button54 androidKlayout0)idth34555dp4 androidKlayout0height34)rap0content4 androidKtext34@string$:avorites4 $J IButton androidKid34@?id$buttonH4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arent%op34true4 androidKlayout0toRightO.34@?id$button54 androidKtext34@string$:eatures4 $J IButton androidKid34@?id$buttonQ4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arentRight34true4 androidKlayout0align9arent%op34true4 androidKlayout0toRightO.34@?id$buttonH4 androidKtext34@string$Categories4 $J IButton androidKid34@?id$buttonR4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arent,e.t34true4 androidKlayout0align9arentRight34true4 androidKlayout0belo)34@?id$button54 androidKlayout0margin%op34RLdp4

11

androidKmin;eight34QHGdp4 androidKminBidth345MGdip4 androidKtext34@string$2y0Current0,ocation4 $J IButton androidKid34@?id$buttonL4 androidKlayout0)idth34)rap0content4 androidKlayout0height34)rap0content4 androidKlayout0align9arent,e.t34true4 androidKlayout0align9arentRight34true4 androidKlayout0belo)34@?id$buttonR4 androidKmin;eight34LGdp4 androidKminBidth345MGdip4 androidKtext34@string$1earest0"tation4 $J I$Relative,ayoutJ

10

1. .4

A.#"OI# 'A.IF-S$

IExml version345.G4 encoding34ut.'P4EJ Imani.est xmlnsKandroid34httpK$$schemas.android.com$apk$res$android4 package34com.chilloutlondon4 androidKversionCode3454 androidKversion1ame345.G4 J Iuses'sdk androidKmin"dk(ersion34P4 androidKtarget"dk(ersion345S4 $J Iapplication androidKallo)Backup34true4 androidKicon34@dra)able$ic0launcher4 androidKlabel34@string$app0name4 androidKtheme34@style$App%heme4 J Iactivity androidKname34com.chilloutlondon."plash4 androidKcon.igChanges34orientationNkeyboard;iddenNscreen"iOe4 androidKlabel34@string$app0name4 androidKtheme34@style$:ullscreen%heme4 J Iintent'.ilterJ Iaction androidKname34android.intent.action.2A!14 $J Icategory androidKname34android.intent.category.,A81C;/R4 $J I$intent'.ilterJ I$activityJ Iactivity androidKname34com.chilloutlondon.2enu4 androidKcon.igChanges34orientationNkeyboard;iddenNscreen"iOe4 androidKlabel34@string$app0name4 androidKtheme34@style$:ullscreen%heme4 J Iintent'.ilterJ

1+

Iaction androidKname34com.chilloutlondon./29%7"CR//14 $J Icategory androidKname34android.intent.category.&/:A8,%4 $J I$intent'.ilterJ I$activityJ Iactivity androidKname34com.chilloutlondon.Restaurant4 androidKcon.igChanges34orientationNkeyboard;iddenNscreen"iOe4 androidKlabel34@string$app0name4 androidKtheme34@style$:ullscreen%heme4 J Iintent'.ilterJ Iaction androidKname34com.chilloutlondon.R/"%A8RA1%4 $J Icategory androidKname34android.intent.category.&/:A8,%4 $J I$intent'.ilterJ I$activityJ I$applicationJ I$mani.estJ

18

'OO'LE MA2S ,M2LEMENTAT,ON


package com.chillmaps; import import import import android.os.Bundle; android.app.Activity; android.vie).2enu; android.map;

public class 2ainActivity extends mapActivity { 2apController mapControl; @eo9oint @eo9; 2ap(ie) map(; @Override protected void onCreate Bundle saved!nstance"tate# { super.onCreate saved!nstance"tate#; setContent(ie) R.layout.activity0main#; map(3 2ap(ie)# .ind(ie)By!d R.id.map(ie)#; map(.displayToomControls true#; map(.setBuilt!nToomControls true#; double lat 3RG.P; double longi 3 LQ.UUU; @eo9 3 ne) @eo9oint int# lat -5/U#> int# longi -5/U# #;

mapControl 3 map(.getController #; mapControl.animate%o @eo9#; mapControl.setToom 5Q#; * private 2ap(ie) .ind(ie)By!d Ob+ect map(ie)# { $$ %O&O Auto'generated method stub

1<

return null; * private void setContent(ie) int activity2ain# { $$ %O&O Auto'generated method stub * public boolean isRoute&isplayed # { $$ !n.late the menu; this adds items to the action bar i. it is present. return .alse; * *

1-

2A9" A1&RO!& 2A1!:/"%

IExml version345.G4 encoding34ut.'P4EJ Imani.est xmlnsKandroid34httpK$$schemas.android.com$apk$res$android4 package34com.chillmaps4 androidKversionCode3454 androidKversion1ame345.G4 J Iuses'sdk androidKmin"dk(ersion34P4 androidKtarget"dk(ersion345S4 $J Iuses'permission androidKname34android.permission.!1%/R1/%4$J Iapplication androidKicon34@dra)able$ic0launcher4 androidKlabel34@string$app0name4J Iuses'library androidKname34com.google.android.maps4 $J Iactivity androidKname34com.chillmaps.2ainActivity4 androidKlabel34@string$app0name4 J Iintent'.ilterJ Iaction androidKname34android.intent.action.2A!14 $J Icategory androidKname34android.intent.category.,A81C;/R4 $J I$intent'.ilterJ I$activityJ I$applicationJ I$mani.estJ

17

"eferences
Meier ,! )/./! Professional Android 2 Android Development. . ed! *ndianapolis: Wiley :ublishing :ress! www!android!comNsearchNinde%!htmlQ@Otechnology )/.1! http: !!!.android."om sear"h inde#.html$%&te"hnolo'(. R>nlineS ;vailable at: http:NNwww!android!comNsearchNinde%!htmlQ@Otechnology R;ccessed .) July )/.1S! www!developer!android!comNsdkNinde%!html )/.1! http: developer.android."om sd) inde#.html. R>nlineS ;vailable at: http:NNdeveloper!android!comNsdkNinde%!html R;ccessed .) June )/.1S! www!developers!google!com )/.1! https: developers.'oo'le."om maps do"*mentation android . R>nlineS ;vailable at: https:NNdevelopers!google!comNmapsNdocumentationNandroidN R;ccessed .< June )/.1S!

A22EN-,9

0.

You might also like