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 • API. •
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:
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
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