
International Journal of Advanced Engineering Technology E-ISSN 0976-3945 Research Paper APPLICATION OF GOOGLE API AND KML TO DRAW PATH FROM SOURCE TO DESTINATION ON ANDROID PHONE Dr. Khanna SamratVivekanand Omprakash, Mr Pritesh Patel Address for Correspondence Information Technology Dept, ISTAR, Sardar Patel University, VVNagar, India ABSTRACT Today google is constantly trying to implement innovative ideas in science and engineering. This paper presents the implementation of KML to find path from source to the destination on google android phone. Google provides many APIs to implement its services. Here we present methods to draw path from given source to the destination. Drawing path can be useful in many applications like travelling application, driving direction and projecting the path where our child moves using mobile implementation. KEY WORDS Google API, KML, Google Earth, Graphics, Keyhole, KMZ, Android INTRODUCTION Table 1 Now a day’s android phone market is popular among File Extension .kml, .kmz the people for many useful applications. This paper application/vnd.google-earth.kml+xml, MIME Type for kml application/vnd.google-earth.kmz represents the use of KML and google API to draw for kml path from specific source to the destination. Drawing Developed By Keyhole, Inc. 2001, Google path from one place to another is used to know the Uses in Graphical Information System way in which we can reach to the destination. By Parent Language XML knowing the co-ordinates i.e. longitude and latitude We can use KML to: of the specific location we can draw the path to that • Specify icons and labels to identify locations on location. This can be useful to the person to know the the planet surface path or can locate the position where he is located. • Create different camera positions to define With the help of these KML we can locate the place unique views for each of your features or path to the unknown location from our current • Use image overlays attached to the ground or location. screen OVERVIEW OF GOOGLE API • Define styles to specify feature appearance Google provide many services to the developers to • Write HTML descriptions of features, including design various useful applications. Among all hyperlinks and embedded images services Google API is an interface for accessing • Use folders for hierarchical grouping of features various services provided by google. Google offers • Dynamically fetch and update KML files from variety of API for developers. The API may be used remote or local network locations for Google Apps, Google Analytics, Blogger, Google • Fetch KML data based on changes in the 3D Base, Google Book Search, Google Calendar, Google viewer Code Search, Google Earth, Google Spreadsheets, • Display COLLADA textured 3D objects Google Notebook and Picasa Web Albums. We can Structure of KML file enhance our application functionalities using google • <?xml version="1.0" encoding="UTF-8"?> API. • <kml xmlns="http://www.opengis.net/kml/2.2"> OVERVIEW OF KML • <Placemark> Keyhole Markup Language (KML) is an XML based language used to express geographical annotation and • <name>My Simple Placemark</name> visualization. It displays geographical data in earth • <description>Your Description goes browser like google earth, google maps or google here</description> map for mobile. KML uses a tag-based structure with • <Point> nested elements and attributes and is based on the • <coordinates> longitude, latitude, and optional XML standard [1]. KML file uses XML grammar and altitude </coordinates> file format for modeling and storing geographic • </Point> features such as points, lines, images, polygons, and • </Placemark> models for display in Google Earth, Google Maps • </kml> and other applications [5]. KML has same tag-based Above structure describe the following: and attribute structure as HTML used for display • Line 1 is an XML header which is in every purpose. KML file. No spaces or other characters can The KML file specifies a set of features (place marks, appear before this line. images, polygons, 3D models, textual descriptions, • Line 2 is a KML namespace declaration which etc.) for display in Google Earth, Maps and Mobile, is in every KML 2.2 file. or any other 3D Earth browser (geobrowser) • A Placemark object that contains the following implementing the KML encoding [2]. The simplest elements: kind of KML documents are those that can be o A name that is used as the label for the authored directly in Google Earth [1]. Placemark IJAET/Vol.III/ Issue I/January-March, 2012/156-158 International Journal of Advanced Engineering Technology E-ISSN 0976-3945 o A description that appears in the interfaces, application life cycle, various application "balloon" attached to the Placemark types, efficient IPC mechanisms, and permissions [9]. o A Point that specifies the position of the Placemark on the Earth's surface (longitude, latitude, and optional altitude) We can also define styles in KML file to look content fancy. Path can also be drawn on map using kml. Many applications display KML, including Google Earth, Google Maps, Google Maps for mobile, NASA WorldWind, ESRI ArcGIS Explorer, Adobe PhotoShop, AutoCAD, and Yahoo! Pipes [3]. Figure 1 shows all the elements used in KML file along with abstract elements. Figure. 1 Android Architecture (developer.android.com, 2011) Android is a privilege-separated operating system, in which each application runs with a distinct system identity (Linux user ID and group ID) and parts of the system are also separated into distinct identities (developer.android.com, 2011). Implementation To implement the google API on android phone we have to add Google API library and set built target as Google API. We also need to set the permission in AndroidManifest.xml file like below: <manifest Figure 1 [7] xmlns:android="http://schemas.android.com/apk/res/ About Android android" Android is an operating system (OS) developed by package="com.example.package.name"> Open Handset Alliance (OHA). Android is also ... known as a software stack for mobile devices that <application android:name="MyApplication" > includes an operating system, middleware and key <uses-library applications. The Alliance is a coalition of more than android:name="com.google.android.maps" /> 50 mobile technology companies ranging from ... handset manufacturer and service provider to </application> semiconductor manufacturers and software ... developers, including Acer, ARM, Google, eBay, <uses-permission HTC, Intel, LG Electronics, Qualcomm, Sprint and android:name="android.permission.INTERNET" /> T-Mobile [8]. The stated goal of the OHA is to “accelerate innovation in mobile and offer consumer </manifest> a richer, less expensive, and better mobile experience”. By providing an open development To add MapView control we need to code the platform, Android offers developers the ability to following in layout file like: build extremely rich and innovative applications. <?xml version="1.0" encoding="utf-8"?> Developers are free to take advantage of the device <com.google.android.maps.MapView hardware, access location information, run background services, set alarms, add notifications to xmlns:android="http://schemas.android.com/apk/res/ the status bar, etc.( developer.android.com, 2011). android" Basic architecture of android is shown in fig. 1. android:id="@+id/mapview" Android OS is built on the Linux 2.6 kernel. The android:layout_width="fill_parent" Android Runtime System utilizes Delvik virtual android:layout_height="fill_parent" machine (VM), which allows multiple applications to android:clickable="true" be run concurrently as each application is its own android:apiKey="Your Maps API Key goes here " separate VM [8]. Android application compiled into /> Delvik executable (.dex) and is run by Delvik virtual To access the map from google we need to get the machine. Android provides a substantial set of API key and the procedure to get API key is given on abstractions for developers, including ones for user IJAET/Vol.III/ Issue I/January-March, 2012/156-158 International Journal of Advanced Engineering Technology E-ISSN 0976-3945 http://code.google.com/android/add-ons/google- location and path dynamically by fetching geo apis/mapkey.html (Retrieved on 24th Dec, 2011) coordinates automatically from location send by wifi This paper represents the implementation of KML to and service provider. know the path from Anand to Ahmedabad. The path REFERENCES is drawn from Anand City to Ahmedabad via Nadiad, 1. KML Tutorial, Kheda and Baraja. The implemented KML file code http://code.google.com/apis/kml/documentation/k th is as below: ml_tut.html, Retrieved 26 Nov, 2011 <?xml version="1.0" encoding="UTF-8"?> 2. http://en.wikipedia.org/wiki/Keyhole_Markup_L anguage, Retrieved 28 th Nov, 2011 <kml xmlns="http://www.opengis.net/kml/2.2"> 3. http://code.google.com/apis/kml/documentation/, <Document> Retrieved 328 h Nov, 2011 <name>Paths</name> 4. http://code.google.com/apis/kml/documentation/k <description>Sample Path from Anand to mlreference.html, Retrieved 21 st Dec, 2011 Ahmedabad</description> 5. http://earth.google.com/support/bin/static.py?pag <Style id="yellowLineGreenPoly"> e=guide.cs&guide=22373&topic=23747&answer <LineStyle> =148118, Retrieved 5 th Oct, 2011 6. http://code.google.com/apis/kml/documentation/ <color>7f00ffff</color> th <width>4</width> whatiskml.html, Retrieved 15 Dec, 2011 7. Josie Wernecke, The KML Handbook: </LineStyle> Geographic Visualization for the Web, Addison- <PolyStyle> Wesley Professional <color>7f00ff00</color> 8. Android Forensics: Simplifying Cell Phone </PolyStyle> Examination By Jeff Lessard and Gary C. </Style> Kessler, Small Scale Digital Device Forensics <Placemark> Journal Vol. 4, Issue. 1 Sep 2010, ISSN: 1941- <name>Path from Anand to Ahmedabad</name> 6164 <description>Transparent green wall with yellow 9. Mobile Application Security By: Himanshu outlines</description> Dwivedi, Chris Clark and David Thiel, McGraw- Hill, ISBN 978-0-07-163356-7 <styleUrl>#yellowLineGreenPoly</styleUrl> 10. “Way To The Destination” - Implementing <LineString> Google Api And Kml To Find Path From Source <extrude>1</extrude> To Destination, By Mr.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages3 Page
-
File Size-