[Free/ Beta] XPP - Xml Pull Parser

:name_badge: Name

XPP (XML Pull Parser)

:memo: Description

XPP is an MIT App Inventor extension (also works on Kodular, Niotron, and AndroidBuilder ..etc.) that provides a fast and lightweight way to parse XML data using the XmlPullParser API in Java.

It allows you to read and parse XML from multiple sources:

  • From text (String)
  • From URL (HTTP/HTTPS)
  • From local file path
  • From application assets

During parsing, it triggers events so you can handle XML data dynamically:

  • TagStarted → fired when a start tag is found
  • TextFound → fired when text content is found
  • TagEnded → fired when an end tag is found

:question: Why use XmlPullParser?

1. Performance & Speed

  • XmlPullParser works in a streaming manner, reading the XML step by step.
  • This makes it much faster and more memory-efficient than DOM parsing (which loads the entire document).

2. Lightweight

  • Ideal for Android apps, especially when working with large XML files.
  • Consumes less memory compared to tree-based parsers.

3. Flexible

  • You can skip unwanted sections, jump to specific tags (SkipToTag, FindNextTag), or extract only the parts you need.

4. Full Control

  • You decide what to do with tags, attributes, and text as they are parsed, instead of loading everything at once.

:star2: Benefits of XPP Extension

  • :white_check_mark: Multiple XML sources: Read from text, URL, file, or asset.
  • :white_check_mark: Event-driven parsing: Handle tags and text dynamically during parsing.
  • :white_check_mark: Attributes support: Retrieve all attributes or specific ones by index or name.
  • :white_check_mark: Utility methods: SkipToTag, FindNextTag, GetInnerXml for advanced navigation.
  • :white_check_mark: Error handling: Central ErrorOccurred event with details about the error and method.
  • :white_check_mark: Resource-safe: Automatically closes old input streams and resets parser state.
  • :white_check_mark: Easy to use: Designed with simple App Inventor blocks.

:black_small_square: All Blocks

:pushpin: Example Usage

data usage :

<books>
	<book id="1" author="Aemo">
		<title>XML Parsing Made Easy</title>
	</book>
	<book id="2" author="Dev">
		<title>MIT App Inventor Extensions</title>
	</book>
</books>

:trophy: Output

:arrow_down: ### Download AIX
me.aemo.xpp.aix (14.9 KB)

:information_source: For more info:

https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser

:pray: Credits

:sparkling_heart: Support Development

If you like this extension and want to support future work:
:arrow_right: Donate via PayPal

3 Likes