SAX based parser for android PLIST format data - android

I am using plist as data for my android application since the iphone also supports the same.
I have written a parser which parsers character by character, but it takes a really long time to run my app. I think a sax parser would solve this, do you have any suggestions?
Also I have this link which says its a sax based parser for plist android but i cant figure out a way to run this in eclipse if any one knows please help out.
Thanks
Deepesh

I am working with this app right now.
Everything is straight forward. Download this
https://github.com/CarlLee/android-plist-parser/downloads
There are 2 projects there
android-plist-parser-app - objects and parsing logic
android-plist-parser-test - testing app.
Start to discover from testing app and you will find out how it works.

Related

Issue Debugging Reason XML Won't Parse

I am having some difficulties with my android app parsing an xml that contains links to PDF files. It should open a listView showing all of the files listed in the xml. However, most of the time it just freezes up on me. The app was made by a developer no longer with us, and all I have is the apk and not the source files. Is there a way to use the apk to get the source files and figure out what the issue is? Android is not my forte and I'm at a loss with how to fix this.
UPDATE:
It appears that devices running 2.2 display all the songs just fine, while the newer versions of Android crash when ran.
I've had problems with android 2.2 on my HTC desire taking a long time to parse large XML files. There wasn't much I could do other than switch from DOM to SAX which for some reason was a lot quicker
However debugging this without source code is likely to be pretty difficult. Not least because fixing the issue when and if you find it will require you to re-compile a new class in replacement for the one which keeps freezing.
I would suggest you look into decompiling the APK back into source code.
According to Wikipedia APK files are based on the Jar file format which in turn is a Zip file:
http://en.wikipedia.org/wiki/APK_%28file_format%29
That makes this task a little easier as you won't need to look for a decompiler that is specific to android but a more generic Java Decompiler.
A quick search on google suggests this one:
http://java.decompiler.free.fr/
If you can decompile the app back to source code and then get that source code into eclipse and rebulild from source then you can start to debug.

how to get html content from XML using SAX parser in android

i tried using CDATA in the xml i worked on most of the answers given in stackoverflow but i could not find the answer.
When CDATA is included, parser is not at all recognizing the data.
Is this any problem with android or are there any other parsers to parse? I tried using DOM, but since my xml file is too large DOM is unable to handle it. Please suggest me any working parser or a way to parse the html content.. Thank you..
I have had problems with CDATA in the xml, it happens for Android < 2.2 because it uses an ancient and buggy version of Xerces (I think it was Xerces that Android is using). Try to build your project for 2.2 and give it a try.
If you can't use 2.2 - there is a manual workaround that I was able to pull off. Unfortunately, I don't have the code for it in handy at the moment, sorry about that :(

Parsing a XML file in Android

Can anyone provide me with the info to parse an XML file in an Android application.
Any link on this will be helpful.
There are 3 different ways to parse XML in android: SAX parser, DOM parser, pull parser. Which one to use depends on how big your xml is, and what you want to do with it. See working with xml in Android for details. (Which, incidentally, is the 1st link if you google "Android XML"].
Parsing XML in android is done in more than one ways in android..
Android.developer is the best reference that you can go for.
you can ieither use SAX or DOM..
Here is the link which will give u idea about parsing XMl
http://developer.android.com/reference/javax/xml/parsers/package-summary.html
go through the documentation first it will help u a lot
You can find a great explanation at this link.
You basically use the dom4j SAXReader to parse the XML using XPath.

Android: Best XML Parsing Library?

I have to parse some complex xml files inside my Android application. Is there any good library for doing that like there is TouchXMl for iPhone?
Or you could use the org.xmlpull.v1.XmlPullParser - I've found it much easier to use than the SAX Parser and it has other benefits:
http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
http://www.bearcave.com/software/java/xml/xmlpull.html
The SAX XML Parser comes already built into the Android SDK.
Use Woodstox. It's a Stax pull parser, actually supports all of XML (unlike xmlpull that is bundled), efficient, mature. For more convenience, StaxMate helps too, uses Woodstox (or any other Stax parser) for parsing but exposes convenient cursors and writers; but is still 3x - 5x faster than DOM approach.
XmlPullParser that was mentioned works to some degree, but can't handle DTDs (not just validation but even basic character entities), gives cryptic error messages and doesn't have standard interface (SAX or Stax).
Don't know the criteria by which "best" is defined. but here is a recent research paper that analyzes existing java xml framework with great details...
http://recipp.ipp.pt/bitstream/10400.22/1847/1/ART_BrunoOliveira_2013.pdf

Accessing a SOAP WebService

I have not found any convinient way to create something like a jaxws wrapperclass for an existing Soap Webservice - like in full Java.
Jaxws is unfortunately not avaliable in the sdk.
Is there any was to do this without using any external libs?
Are there any external libs at all yet?
The short answer is that no, there isn't any way to do exactly what you want. However, there is a DOM and SAX implementation. If you know what the incoming XML looks like (which you should anyways) then you could write a custom unmarshaller.
I really don't want to manually write/decode any soap messages. I just want to consume an external webservice. Its really easy to do that with full blown java libs and tools (wsimport) and create the corresponding wrapper-classes to access the ws as "normal" java classes.
The usual ws client programmer will never need to touch any backend soap stuff at all... Thats what the jaxws client classes are for.
ksoap is unfortunately only a first step to access soap stuff at all - no wsdl-based codegeneration so far as I know...
Hopefully the sdk will adress this issua in one of the next versions as many ws are out there and handcoding this stuff is really messy...

Categories

Resources