RESEARCH ON MOBILE LOCATION SERVICE DESIGN BASED ON “ANDROID” Presented By : Harish Kumar Upadhyay Roll 31 ,IT ‘A’ SOE,CUSAT 1
THE PAPER WAS ORIGINALLY PRESENTED BYXIANHUA SHU, ZHENJUN DU, RONG CHENSCHOOL OF INFORMATION SCIENCE AND TECHNOLOGYDALIAN MARITIME UNIVERSITYDALIAN, CHINA 2
OVERVIEW OF SEMINAR1) INTRODUCTION TO ANDROID2) ANDROID ARCHITECTURE3) ANATOMY OF AN ANDROID APPLICATION4) LOCATION BASED MOBILE SERVICE DESIGN5) CONCLUSION 3
Q)HOW MANY OF YOU FACED THE INTERVIEW QUESTION “TELL ME THE RECENT ADVANCEMENT IN THE FIELD OF TECHNOLOGY”?ANS : TWO OF THE BEST POSSIBLE CHOICES WOULD HAVE BEEN1) “GEOLOCATION” AND 2) “ANDROID” 4
INTRODUCTION TO ANDROID : This is not physics ! This is not chemistry ! This is not mathematics ! This certainly is not biology ! We will see today “ ANDROIDOLOGY “. 5
Introduction to Android
INTRODUCTION TO ANDROID : Q) WHAT IS ANDROID ?ANS: ANDROID MEANS “A ROBOT WITH A HUMAN APPEARANCE”Android is an operating system for mobile devices suchas smartphones and tablet computers. It is developed bythe Open Handset Alliance led by Google It is built on top of modified linux kernel .This is the best thingabout ANDROID is it is free and open source Which means theOS and its source code is available for free download andediting.openhandsetalliance.com . Applications are java based and can be created using ecllipseas IDE. C/C++ can be used for creating libraries but they cannotbe used for coding application .They are not supported . 7
INTRODUCTION TO ANDROID :• The Open Handset Alliance (OHA) is a businessalliance of firms to develop open standards for mobile devices.Member Firms Include Google, HTC,Sony, Dell, Intel, Motorola, Qualcomm, TexasInstruments, Samsung, LG, T-Mobile, Nvidia, and Wind RiverSystems and others. 8
INTRODUCTION TO ANDROID :Google products gmail,gtalk,google chrome ,chrome OS ,bing , google + has already caught the attention of usersbecause of its easier interface and usability .And Android isone of them .The conception of the Android platform is attracting moreand more programmers in mobile computing fields 9
INTRODUCTION TO ANDROID :• THE ANDROID PHONES CAN BE CUSTOMIZED AS PERTHE USER CONVENIENCE. THE OPEN HANDSET ALLIANCE RELEASED THEGOOGLE ANDROID SDK ON NOVEMBER 12, 2007. THE ANDROID SDK PROVIDES POWERFUL TOOLSAND APIS NECESSARY TO DEVELOP APPLICATIONS ONTHE ANDROID PLATFORM USING THE JAVAPROGRAMMING LANGUAGE 10
INTRODUCTION TO ANDROID :. ANDROID PLATFORM IS OF OPEN SYSTEMARCHITECTURE(LAYERED STRUCTURE WITH EACH LAYEREXISTING AS INDIVIDUAL ).IT SUPPORTS A VERYPOWERFUL BROWSER. IT USES A DALVIK VIRTUAL MACHINE HEAVILYOPTIMIZED FOR MOBILE DEVICES.THE JAVA CODES ARECONVERTED TO BYTECODE.THE BYTECODE TO .CLASSTYPE FILE UNDERSTANDABLE BY JAVA VIRTUAL MACHINEAND THEN TO .DEX FILE BY “DX” TOOL.. ANDROID PLATFORM WILL NOT ONLY PROMOTE THETECHNOLOGY (INCLUDING THE PLATFORM ITSELF) OFINNOVATION, BUT ALSO HELP TO REDUCEDEVELOPMENT COSTS . 11
INTRODUCTION TO ANDROID :. ANDROID ALSO SUPPORTS GPS, VIDEOCAMERA,COMPASS, AND 3D-ACCELEROMETER AND PROVIDESRICH APIS FOR MAP AND LOCATION FUNCTIONS.USERS CAN FLEXIBLY ACCESS, CONTROL ANDPROCESS THE FREE GOOGLE MAP AND IMPLEMENTLOCATION BASED MOBILE SERVICE IN HIS MOBILESYSTEMS AT LOW COST. A TABLET NAMED “AAKASH” WAS RELEASED ONSATURDAY BY AN INDIAN COMPANY –DATAWIND .THISIS THE CHEAPEST TABLET EVER MADE.IT COSTS INR2576 . THIS TABLET IS BASED ON “ANDROID 2.2”. 12
INTRODUCTION TO ANDROID :• It enables reuse and replacement of components and an efficient database support and support various wireless communication means The conception of the Android platform is attracting more and more programmers in mobile computing fields. There are over 1,50,000 applications and the android market is growing every day, evey hour every minute and every second .Even at the time of presentation someone in some part of the world migth be creating some android application . 13
INTRODUCTION TO ANDROID : 14
INTRODUCTION TO ANDROID : 15
ANDROID ARCHITECHTURE 16
ANDROID ARCHITECTURE 17
ANDROID ARCHITECTURE APPLICATIONS Contact Quick Home Maps Phone Browser s Fix APPLICATION FRAMEWORK Activity Telephony Content View Manager Manager Provider System Package Resource Location Manager Manager Manager LIBRARIES ANDROID RUNTIME SQLite Dalvik Virtual Core Libraries Machine LINUX KERNEL Capstone Team#5 : Googles Android Mobile Application 9:42:16 AM 5/12/2012 18
Android SDK installation1)DOWNLOAD THE SDK AND COMPATIBLE SDK.2)INSTALL THE PACKAGES AND THEENVIRONMENT(HERE 3.2)3)CREATE “AVD” SELECTING THE TARGET .4)SET THE PROPERTIES IN THE ADVANCED SETTINGOF YOUR COMPUTER TO THE PATH TOOLS/5)AVD MUST BE CONFIGURED START THE SDKMANAGER FROM THERE YOU GET THE MESSAGE NO AVDDEVICE FOUND CREATE A NEW ONE THEREAFTER6)COMMAND FOR RUNNING THE “AVD” EMULATOR @AVDNAME E.G. EMULATOR @HARISH 19
Android SDK installation EMULATOR @AVD 20
Android applications have common structureViews such as lists,grids, text boxes, An Activity Manager thatbuttons, and even manages the life cycle ofan embeddable web applications and provides abrowser common navigation backstackContent Providers A Notification Manager thatthat enable enables all apps to displayapplications to custom alerts in the statusaccess data from barother applications(such as Contacts), A Resource Manager,or to share their providing access to non-own data code resources such as localized strings, graphics, and layout files
ANATOMY OF ANDROID APPLICATION 22
These are the 4 building blocks ofandroid application . Activity IntentReceiver Service ContentProviderNot everyapplication needs to have all four, but a user’s application willbe written with some combination of these. Once the user hasdecided what components are needed for the application, theyshould be listed in a file called AndroidManifest.xml, which iswhere the components of the application are declared and whattheir capabilities and requirements are
Activities• usually a single screen.• Each implemented as single class.• most apps consists of multiple screens ,each screen will be an activity .• When we switch from one activity to another ,the older one is paused and put on stack .It is called back again on resume .• Android uses a special class called Intent to move from screen to screen.
Intents Home Picasa Photo GalleryContacts “Pick photo” GMail Client component makes a Chat System picks best request for a specific action New components can use component for that actionBloggerBlogger existing functionality
IntentReceivers You can use an IntentReceiver when you want code in your application to execute in reaction to an external event, for example, when the phone rings, or when the data network is available, or when its midnight. Intent receivers do not display a UI, although they may display Notifications to alert the user if something interesting has happened. Intent receivers are also registered in AndroidManifest.xml, but you can also register Your application does not have to be running for its intent receivers to be called; the system will start your application, if necessary,
Services A Service is code that is long-lived and runs without a UI (IN BACKGROUND).A good example of this is a media player playing songs from a play list. In a media player application, there would probably be one or more activities that allow the user to choose songs and start playing them.
ContentProviders A content provider, however, is useful if you want your applications data to be shared with other applications. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider.
LOCATION BASED SERVICE DESIGN 29
Common uses of location in apps1) Plotting a point on a map.2) Navigation/directions to a point on a map.3) Finding a local point of interest (nearest ATM ,nearby restaurants. Etc.4) Vehicle/traffic tracking5) Local weather. And countless other things . Flexible map display and control functions and locationsupport are provided in Android for mobile system design
Location base service• LBS stands for location based service .• Location based service is forcasted to be a big revenue .(Revenue expected to be 10 billion by 2015 . So it is expected to grow at a high rate.KEY CONCEPTS :1) How do we get the current location2) Using google map API extension.
Location Technologies network-basedTOA ( Time of Arrival) Base Station 1 Mobile T=distance 1 1 Base Station 2 T=distance 2 2 Base Station 3 =distance 3 T3 32
HOW LOCATION WORKS ?* Android provides a location framework - Determine the device’s location * It can be a combination of GPS and Network Location(Cell tower and /wi-fi) or just one technology We then use the Android Location-Based API to collectuser current position and display that location on the screen,and use Google Maps to display the current user location onthe cell phone.
Location Technologies handset-based EOTD (Enhanced Observed Time Difference) Difference 1-3 Base Station 1 Difference 1-2 Clock time 1 Mobile Clock time 2 Base Station 3 Clock time 3 Base Station 2 Difference 2-3 34
LOCATION BASED MOBILE SERVICE DESIGNLOCATION TECHNOLOGIES :
GETTING CURRENT LOCATION :- The Android has a LocationManager- Implement a LocationListener- Call requestLocationUpdates() passing your LocationListener - Can define GPS/Network Location Provider at the same time LocationManager will use callback methods implemented in LocationListener when : -Location is changed - Status of location service changes For improving performance -getLastKnownLocation-min time and min Distance for updating .
LOCATION PERMISSION* Manifest file:user permission request• -ACCESS_COARSE_LOCATION• -ACCESS_FINE_LOCATION(GPS AND/OR Network Location Provider)Application will fail at without requesting and being granted necessary permissions .
KEY CLASSES :1) GeoPoint : a pair of latitued and longitude cordinate2) MapView :displays a map with data obtained from the Google Maps service - built in zoom and pan capabilities - Support for satellite ,traffic and street views MapView is used to display a view of the map. It can accept the keyboard events such as onKeyDown and onKeyUp to support the map movement and the zoom feature. It also supports multi-layer Overlay and user can draw coordinates,pictures and strings on the map. MapView is set up only byMapActivity.3) Overlay : Which can be displayed on top of map like :direction or compass
LOCATION BASED MOBILE SERVICE DESIGN MAP PROCESS: -Add maps add-on for google APIs to project - Multiple versions are available for different API level s *Manifest file: add<user-library> with com.google.android.maps -get a MAP API Sign application with certificate associated with Map API key
MapView is required to be added into the layout create a LocationManager from which we can get the coordinate values:
GETTING CURRENT LOCATION :- • Dalvik Debug Monitor Server (DDMS) • Keyhole Markup Language (KML) is an XML notation for expressing geographic annotation and visualization within Internet-based, two- dimensional maps and three-dimensional Earth browsers
Definition – Reference Point Reference point: Place taken as a reference on target path in the cell data collection process (e.g. bus stop, railway stations) 42
Definition – Point ofInterest Point of Interest (POI): Location that is interested in the application level (e.g. building, tourist spot) 43
Application in Action (1) Points of Interest Reference Points 44
Application in Action (2) 1. User selects a destination 45
Application in Action (3) 2. User is at the starting point of a route 46
Application in Action (4) 3. The application keeps track of the location of the user in the path at each reference point 47
Application in Action (5) 4. Display the information about the point of interest (destination) 48
CONCLUSIONS The feature of location based service is emphasized on Android platform. One can integrate a fully zoom and drag enabled map by adding just few lines in the java code and XML code to the Android-Default-Application. Through this paper, the availability and performance of the platform is verified and the design result also shows the easiness to implement self-location,to perform queries and to flexibly control the real-time map on Android. The actual system also achieves high running performance. The future work is to design a more powerful mobile location-based system featured with more unique customized functions based on Android.
 C. Haseman, Android Essentials, PDF ElectronicBook, 2008.Availablefrom: http://androidos.cc/dev/index.php. N. Gramlich, Android Programming , PDFElectronic Book, 2008 Available from:http://androidos.cc/dev/index.php. Wikipedia :www.wikipedia.orgOPEN TO QUESTIONS AND SUGGESTIONS…. 50