Open kevlahnota opened 1 month ago
The RssReader library relies on classes not supported in the Android platform.
XML Parsing: It uses javax.xml.stream.XMLStreamReader (StAX API), which is not directly available on Android. But an Android compatible StAX implementation like Woodstox can be used.
HTTP Requests: It uses java.net.http.HttpClient, which is also not available on Android. It can be replaced with a 3rd-party HTTP client library designed for Android (e.g., OkHttp).
The RssReader library relies on classes not supported in the Android platform.
XML Parsing: It uses javax.xml.stream.XMLStreamReader (StAX API), which is not directly available on Android. But an Android compatible StAX implementation like Woodstox can be used.
HTTP Requests: It uses java.net.http.HttpClient, which is also not available on Android. It can be replaced with a 3rd-party HTTP client library designed for Android (e.g., OkHttp).
Thanks for pointing it out, gonna try if importing those dependency will work.
I got it working on Android. It's a temporary solution that doesn't require any code changes to the library. I will improve Android support in a future version.
Add dependencies:
implementation 'com.fasterxml.woodstox:woodstox-core:7.0.0'
implementation 'com.apptasticsoftware:rssreader:3.8.2'
Create class java.net.http.HttpClient
package java.net.http;
public class HttpClient {
}
Provide an instance of HttpClient when creating a new RssReader object.
URL url = new URL("https://github.com/Card-Forge/forge/commits/master.atom");
InputStream inputStream = url.openStream();
List<Item> items = new RssReader(new HttpClient()).read(inputStream).toList()
This solution is limited to reading a feed from an input stream.
Ok thanks, gonna try that on the project.
I assume there are classes that needs to be retained on Proguard.cfg hence the freeze issue (are there any information so It works on android). Tested using Android 14 (SDK 34) compiled using Java 17 and rssreader v3.6.0 (the build tools complains using java 21 so I use lower version). The java file is this:
It works fine on desktop version though.