Android Question [Solved] Error using CustomRSSView Library in Android 6 and 7

Status
Not open for further replies.

asales

Expert
Licensed User
Longtime User
This library CustomRSSView works fine in Android 4.2 and 4.4:
https://www.b4x.com/android/forum/threads/customrssview.42297/

But in Android 6.0 and 7.0, I get this error below, when I try to parser the online xml.

How I can fix it?

Thanks in advance for any tip.

B4X:
customrssview_hc_responsesuccess (java line: 282)
java.io.FileNotFoundException: /storage/emulated/0/Android/data/njdude.customrssview.sample/files/rss.xml: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:452)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
    at njdude.customrssview.sample.customrssview._hc_responsesuccess(customrssview.java:282)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
    at anywheresoftware.b4a.BA$2.run(BA.java:338)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:7331)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
    at libcore.io.IoBridge.open(IoBridge.java:438)
    ... 13 more
java.io.FileNotFoundException: /storage/emulated/0/Android/data/njdude.customrssview.sample/files/rss.xml: open failed: ENOENT (No such file or directory)
 

jchal

Active Member
Licensed User
Longtime User
yes it works like that
but now we have to have targetSdkVersion to 28 and up , how we make it work?
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Just use the necessary RuntimePermissions...

B4X:
Dim rp as RuntimePermissions
rp.CheckAndRequest(.......)

Seeing the error probably you will need:

B4X:
rp.GetSafeDirDefaultExternal("")


Of course you will need to add the RuntimePermissions library.
 
Last edited:
Upvote 0
Status
Not open for further replies.
Top