<<

International Journal of Advanced Engineering E-ISSN 0976-3945

Research Paper APPLICATION OF 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 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 , 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+, 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. • Dynamically fetch and update KML from variety of API for developers. The API may be used remote or local network locations for Google Apps, , , Google • Fetch KML data based on changes in the 3D Base, Google Book Search, , Google viewer Code Search, , Google Spreadsheets, • Display COLLADA textured 3D objects and Web Albums. We can Structure of KML file enhance our application functionalities using google • API. • OVERVIEW OF KML • (KML) is an XML based language used to express geographical annotation and • My Simple Placemark visualization. It displays geographical data in earth • Your Description goes browser like google earth, google or google here for mobile. KML uses a tag-based structure with • nested elements and attributes and is based on the • longitude, latitude, and optional XML standard [1]. KML file uses XML grammar and altitude file format for modeling and storing geographic • features such as points, lines, images, polygons, and • models for display in Google Earth, 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 , in which each application runs with a distinct system identity ( 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: (OHA). Android is also ... known as a software stack for mobile devices that includes an operating system, middleware and key 50 mobile technology companies ranging from ... handset manufacturer and service provider to semiconductor manufacturers and software ... developers, including Acer, ARM, Google, eBay, T-Mobile [8]. The stated goal of the OHA is to “accelerate innovation in mobile and offer consumer 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. Developers are free to take advantage of the device

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 2. http://en.wikipedia.org/wiki/Keyhole_Markup_L anguage, Retrieved 28 th Nov, 2011 3. http://code.google.com/apis/kml/documentation/, Retrieved 328 h Nov, 2011 Paths 4. http://code.google.com/apis/kml/documentation/k Sample Path from Anand to mlreference.html, Retrieved 21 st Dec, 2011 Ahmedabad 5. http://earth.google.com/support/bin/static.py?pag Kessler, Small Scale Digital Device Forensics Journal Vol. 4, Issue. 1 Sep 2010, ISSN: 1941- Path from Anand to Ahmedabad 6164 Transparent green wall with yellow 9. Mobile Application Security By: Himanshu outlines Dwivedi, Chris Clark and David Thiel, McGraw- Hill, ISBN 978-0-07-163356-7 #yellowLineGreenPoly 10. “Way To The Destination” - Implementing Google Api And Kml To Find Path From Source 1 To Destination, By Mr. Pritesh Patek and Mr. 1 Mijal Mistry, International Journal of absolute Information and Computing Technology Vol-2 Issue-1, ISSN: 0976-5999 72.93, 22.56, 2357, 11. Android – Wireless Application Development, nd 72.87, 22.7, 2357, 2 Edition, Pearson, By Lauren Darcey and 72.68, 22.75, 2357, Shane Conder 72.58, 22.85, 2357, 72.53, 23.25, 2357

To load KML file on android phone following code is to include: final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://mysite.com/kmlcode/path/KML_Sa mples.kml")); startActivity(myIntent); or final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("file:///mysite.com/kmlcode/path/KML_Sa mples.kml")); startActivity(myIntent); Above code will open google map app and it will request the kml file from specified URL or file. CONCLUSION We can use KML to represent various geographical locations in various formats by drawing polygons and layers. We can extend these paper to represent IJAET/Vol.III/ Issue I/January-March, 2012/156-158