Android Question android 11 issue with file.dirrootexternal

MbedAndroid

Active Member
Licensed User
Longtime User
Got my hands on a new phone with android 11.
run into a issue with DirRootExternal/android 11 . Already stated by Erel to avoid this command, but putting the manifest to SDK to 29 most things read/write are working on 11
However the renamefile sub refused to operate on Android 11 even with SDK 27/28/29 returning a False
Changing to DbPath=file.DirInternal, this renaming issue is solved.
But should there be a possiblity to rename a file with DbPath=DirRootExternal command? on android 11?

B4X:
    If File.Exists(DBPath & SrcDir,SrcFilename) And Not(File.Exists(DBPath & DestDir,DestFilename)) Then
        New=File.Combine(DBPath & DestDir,DestFilename )
        Log (New)
        Old=File.Combine(DBPath & SrcDir,SrcFilename)
        Log(Old)
If Not(New = Old) Then
            NewObj=R.CreateObject2("java.io.File",Array As Object(New),Array As String("java.lang.String"))
            R.Target=R.CreateObject2("java.io.File",Array As Object(Old),Array As String("java.lang.String"))
            Return R.RunMethod4("renameTo",Array As Object(NewObj),Array As String("java.io.File"))
        End If
 

MbedAndroid

Active Member
Licensed User
Longtime User
false alarm....
I'm storing the time into the filename; this format with colons in time is refused by android 11
working now as usual with timeformat hh-mm-ss (manifest on 29; file.dirrootexternal still used)
 
Upvote 0
Top