Description
Click [here](https://github.com/eukaprotech/xmlprocessor/blob/master/README.md) or [here](https://bintray.com/eukaprotech/maven/xmlprocessor#read) for detailed description and usage example.
xmlprocessor alternatives and similar packages
Based on the "Utility" category.
Alternatively, view xmlprocessor alternatives based on common mentions on social networks and blogs.
-
timber
A logger with a small, extensible API which provides utility on top of Android's normal Log class. -
ExpirableDiskLruCache
DISCONTINUED. Java implementation of a Disk-based LRU cache which specifically targets Android compatibility. -
Android-Templates-And-Utilities
Collection of source codes, utilities, templates and snippets for Android development. -
secure-preferences
DISCONTINUED. Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. -
greenrobot-common
General purpose utilities and hash functions for Android and Java (aka java-common) -
Androl4b
A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis -
vector-compat
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop -
CastCompanionLibrary-android
DISCONTINUED. CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. -
motion
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt -
Colours
A beautiful set of predefined colors and a set of color methods to make your Android development life easier. -
Reservoir
DISCONTINUED. Android library to easily serialize and cache your objects to disk using key/value pairs.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of xmlprocessor or a related project?
README
Description
An android asynchronous xml processor based on XmlPullParser, targeting RSS.
Versions
Getting Started (V1.0.0)
Add the dependency in build.gradle (App module)
compile 'com.eukaprotech.xmlprocessor:xmlprocessor:1.0.0@aar'
Usage (V1.0.0)
To process an xml string already loaded from a file or an RSS feed. The xml string will be processed into a JSONObject list, HashMap list or JSONArray.
A sample xml_string response from an RSS feed.
<rss version="2.0">
<channel>
<title>Music Industry</title>
<link>https://www.einnews.com/news/newsfeed_music</link>
<description/>
<generator>EIN News</generator>
<item>
<title>
'The status quo will be obliterated!' – the inventors making their own musical instruments
</title>
<link>
https://www.einnews.com/article/417438078/V3TJlquqo0Ojg5t7?ref=rss&ecode=3wHjNW-Lw4Tcr_9P
</link>
<guid isPermaLink="false">https://www.einnews.com/article/417438078</guid>
<pubDate>Fri, 24 Nov 2017 08:04:13 GMT</pubDate>
<description>
… kept. If someone turned their <span class="match">music</span> up too loud, you imagine … have travelled there, too. The <span class="match">music</span> keeps changing location with … ‘It will change the way <span class="match">music</span> functions’ … Subhraag Singh with … won this year’s Guthman <span class="match">musical</span> instrument competition at Georgia …
</description>
</item>
<item>
<title>Do You Have News to Share? Get It Published.</title>
<link>
https://www.einnews.com/article/417465808/SVgKa5jGvEeh4_1Z?ref=rss&ecode=3wHjNW-Lw4Tcr_9P
</link>
<guid isPermaLink="false">
https://www.einnews.com/article/417465808/SVgKa5jGvEeh4_1Z
</guid>
<pubDate>Fri, 24 Nov 2017 12:09:36 GMT</pubDate>
<description>
With EIN Presswire press release distribution services you will reach decision makers and journalists plus get valuable SEO benefits.
</description>
</item>
</channel>
</rss>;
The required records have the tag "item". Each record has elements with the tags "title", "description", "link", "pubDate" and "guid".
Take "item" as the entryTag. Take "title", "description", "link", "pubDate" and "guid" as entryKeys.
Method 1.
String entryTag = "item";
ArrayList<String> entryKeys = new ArrayList<>();
entryKeys.add("title");
entryKeys.add("description");
entryKeys.add("link");
entryKeys.add("pubDate");
RssXmlProcessor xmlProcessor = new RssXmlProcessor(entryTag, entryKeys);
xmlProcessor.execute(xml_string, new RssXmlToHashMapListHandler() {
@Override
public void onStart() {
}
@Override
public void onSuccess(List<HashMap<String, String>> items) {
//consuming the processed items using the same keys
for(HashMap<String, String> item: items) {
String title = item.get("title");
String description = item.get("description");
String link = item.get("link");
String pubDate = item.get("pubDate");
}
}
@Override
public void onFail(Exception ex) {
}
@Override
public void onComplete() {
}
});
Method 2.
String entryTag = "item";
ArrayList<String> entryKeys = new ArrayList<>();
entryKeys.add("title");
entryKeys.add("description");
entryKeys.add("link");
entryKeys.add("pubDate");
RssXmlProcessor xmlProcessor = new RssXmlProcessor(entryTag, entryKeys);
xmlProcessor.execute(xml_string, new RssXmlToJSONListHandler() {
@Override
public void onStart() {
}
@Override
public void onSuccess(List<JSONObject> items) {
//consuming the processed items using the same keys
for(JSONObject item: items) {
try {
String title = item.getString("title");
String description = item.getString("description");
String link = item.getString("link");
String pubDate = item.getString("pubDate");
}catch (Exception ex){}
}
}
@Override
public void onFail(Exception ex) {
}
@Override
public void onComplete() {
}
});
Method 3.
String entryTag = "item";
ArrayList<String> entryKeys = new ArrayList<>();
entryKeys.add("title");
entryKeys.add("description");
entryKeys.add("link");
entryKeys.add("pubDate");
RssXmlProcessor xmlProcessor = new RssXmlProcessor(entryTag, entryKeys);
xmlProcessor.execute(xml_string, new RssXmlToJSONArrayHandler() {
@Override
public void onStart() {
}
@Override
public void onSuccess(JSONArray items) {
//consuming the processed items using the same keys
for(int i=0; i<items.length(); i++) {
try {
JSONObject item = items.getJSONObject(i);
String title = item.getString("title");
String description = item.getString("description");
String link = item.getString("link");
String pubDate = item.getString("pubDate");
}catch (Exception ex){}
}
}
@Override
public void onFail(Exception ex) {
}
@Override
public void onComplete() {
}
});