Android Question sending message to waiting queue (activity_permissionresult)

sorex

Expert
Licensed User
Longtime User
Hello,

I wrote an app 8 years ago or so that's still in use here.

We got new phones with android 14 on it.

Unlike previous versions of the OS where I just got a message telling me the app is for an older version I could just ignore the warning and install and use it.

With this new OS version I got a lot of errors which I could bypass with the request permissing library (it's the first time I'm using it).

But I have the impression I'm doing something wrong as data written to file.dirinternal doesn't seem to get updated.

The file exists but always returns the old data after writing to it.

I also see a lot of sending message to waiting queue (activity_permissionresult) events in the log.
But nothing appears on the screen.

So I wonder how the permission library is supposed to be used when just reading from and writing to file.dirInternal.

Do I need to put the check in front of every load/save or only once at the beginning of the app?

I currently used this:
B4X:
    If File.Exists(File.DirInternal,"settings") Then
        Log("settings file exists")
        rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
        Wait For Activity_PermissionResult (Permission As String, result As Boolean)
        If result Then   
            Log("success")
            mSettings=File.ReadMap(File.DirInternal,"settings")
            Log("loaded")
        Else
            Log ("no success")
        End If
    Else
        Log("settings not found")
    End If
 

sorex

Expert
Licensed User
Longtime User
I just noticed that I'm part of the problem :)

I looked up the api number for android 14 (34) and used that in the manifest.
When changing it to 30 as suggest in the log window I get a notification to access the photo's, files etc.

But that doesn't make sense for file.dirInternal as it stays in the app own folder.

I am also aware now that I need to upgrade to B4A 13 to make api 34 working but I'll do that later as this app needs to work as fast a possible.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I got it working by going back to API30 and removing all the permission checks.

But then I got a warning that the app was too old and I couldn't install it.

Changed it to 32 and it showed a warning but I could install it.

Everything worked exept the broadcasting sound stream. For that alone I need the record_audio or audio_record permission.

I had to use that 3rd party permission manager. for some reason the regular one didn't show anything.

I ordered another v14 phone so that I can look at it in more detail. I now had to rush to get the phones out.

I also watched your video today from a few years ago. That explained it well.
 
Upvote 0
Top