Difficulty in displaying kml file with extension as .pl in android - android

I am developing an android application using google maps. I have to display some text information and some pictures related to the text. For this purpose I have a .pl file where the information is written as kml.
I know how to extract information using sax parser from an xml, however I am not able to decide as how to go ahead with .pl file.
I thought of downloading them into sd card and saving them as xml extension so the usual xml parsing can be used. But I don't know how to do this.
Kindly help or if there is some other way it can be done please tell.
Thanks,
Astha

KML is Keyhole Markup Language (KML) is an XML notation for expressing geographic annotation
Download sample project which can parse kml data from the following url.
http://www.warriorpoint.com/blog/downloads/
Thanks
Deepak

Related

How to update an excel sheet from Android App

I am trying to establish a simple method for retrieving reference-information from a few cells of an existing excel spreadsheet from an Android app (which is located on a secure company network drive - but could be moved to a secure cloud). Then I wish to add information to that "record" or row of the same spreadsheet.
Is a SQLite database required to do this? or can I pull the reference info directly from the existing excel sheet into a table/list in the app, and then choose to add info to the same sheet in cells relative to the selected reference info/record?
I have looked through the forum and the web and found lots of info on SQLite but nothing that quite fits my requirements.
The idea of this is to be able to find and select a record on the app and then add details (inc. photo's) to that record. So updating the excel sheet with the additional information.
The existing sheet is populated with reference information on a PC and saved to the network drive, to be later added to via the android app as above.
Any help and guidance is much appreciated.
There are two different versions of Excel Sheet file formats used today.
Is the old fashion OLE based file ending: xls
Is the new style XML based file ending: xlsx
Both of them can be processed by java and also on android.
Best practice to work with office docs in Java is the Apache POI project, which can handle both kinds of office formats.
Her is the link to Apache POI for Excel:
http://poi.apache.org/spreadsheet/index.html
What you can do:
If it is OLE based your only choice is to use POI. But POI will always load the hole file into RAM which can be a problem on Android Deviecs with less RAM.
If it is XML based you can directly manipulate the data on the sheet in xml. The file format xlsx or any office doc ending on "x" is a zip file including XML Data and alot of meta informations etc. A file of this kind can be decompressed in a temp folder, you can than read the xml data and manipulate them. After this compress the temp folder into a xlsx file and you are fine.
Or you can also use poi to work with the xlsx file, but also here it loads always the hole file. (I have running applications which push several thousand of rows in excelsheet using the xml technic)
Hope that helps.
P.S. I never tried to use Apache POI on Android, should work but I am not sure. Search on google for examples.
Here are some links regarding XML and Zip technic:
ZipFile in Android SDK: http://developer.android.com/reference/java/util/zip/ZipFile.html
Offical XML Android Docs: http://developer.android.com/training/basics/network-ops/xml.html
Good tutorial about xml parsing using library XMLPullParser: http://developer.android.com/training/basics/network-ops/xml.html
Official XLSX Specs from Microsoft: https://msdn.microsoft.com/en-us/library/dd922181%28v=office.12%29.aspx
Exmple for big Sheets directly manipulating the xml data: https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java

Android : Shapefile in Googlemaps

I'm Developing an app with Google Maps. In which i need to show a layer of data from the shape file or imagery.
Do any one has an idea on how to do it, i have no idea how to project the layer over the Google maps in android.
Provide me with some API and sample codes if available else with any other suggestion.
There is no way to render .Shp file directly in Google Maps.
But if you really want to do then export .Shp to .Kml file using some QuantumGIS or ARC GIS and then Make XMLPullParser that can easily parse this .Kml file.
Refer this questions for more information
Does anyone know of a library in Java that can parse ESRI Shapefiles?
Android lib to read or parse shapefile
https://gis.stackexchange.com/questions/48191/how-to-display-esri-shapefile-in-android
https://gist.github.com/kiichi/6119073
With Google Maps Android API utility library you can display KML or GeoJSON data over a Google Maps MapView.
Now you only need to parse your shapefile and convert it to one of the previous mentioned formats.
The shapefile parsing process can be accomplished with one of the libraries mentioned in this question.
The conversion process (java objects to XML or JSON objects) will need to be programmatically handled by you.

How to fetch xml from web services and save it in assets

I am developing an android app and in that I want to use a XML file. I think its a kinda web services and i want to use it in my app. so first of all i am thinking that whenever I open my app it fetch the whole XML file from http://data.gov.in/sites/default/files/Date-Wise-Prices-all-Commodity.xml and save it into assets folder of my App and then after I will use this XML from my assets folder.
I know this stuff is not too much difficult but actually i am new to android that's why getting this type of problem.
Please help.
Thanks in Advance.
You can't. The assets folder is read-only at runtime.
Pick a different location to save your data, see Data Storage for more information.
As posted in other answer you have to choose different location.
Rest method is as following.
Make a method or class to make http request.
Get response from given request.
Make a xml parser (DOM Parser,Pull Parser or SAX)
these are the basic steps. hope it will help.
Check this tutorial

PDF Markup and Annotation Tool

Hello Fellow Developers,
I am developing a PDF annotation for Android Tablet and would like to open/display PDF file within my android application to edit. I have done research on how to open PDF file and most methods and libraries suggest to convert the PDF to a image file. I don't want to convert to image file because the image file pixelate when I increase resolution. Now the problem I am facing are.
1) Which method I must use to display the pdf file within my application to annotate
2) I also want to implement text reflow in my app
Please suggest.
Thank you.
Regards,
Marcello
If you will read pdf file specification, you will find, that pdf have no any type of flow. Actually each letter just is strictly coordinated on a page. Therefore:
It is simple to annotate any content of pdf document by the coordinates the mark on an any rendering content.
It is impossible to use pdf as a "what you see is what you get" editor. Even it is impossible to perfectly correct parse pdf to editable and back. It is the basically WRONG idea to do, because PDF is just the representation, not the design.
Funniest part of the pdf is text. Especially - unicode text. I want to say, that catching non-english text from the pdf file will return unpredictable results.
Thank you!

What's the easiest way to view an iCalendar (.ics) file in my application?

I just want to display the data in the .ics file. do I need to parse it or is there some other way to just dump it on the screen?
Looking at the Wikipedia entry it appears to be a text file so you could display the raw data. Otherwise, you would need to create an parser which wouldn't be that difficult.
There are also some possibilities if you google java ics parser.
Good luck, hope this helps!

Categories

Resources