Android Question Can't change Package

I create a new project. I do not add any operators.
By default in Build Configurations Package = "b4a.example".
I change "b4a.example" to any other, for example, to "b4a.example2". I'm starting a project. It obviously works.
I go with the file manager to the Android/data/ directory.
There are all applications except "b4a.example2".

If I don't change the Package, then the "b4a.example" folder in Android/data/ is present.
I have android 13.
How can I change the Package?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Your package name will appear in Android/Data folder only if you add some code that operate with any function use external folder as File.DirDefaultExternal
For example: If you add this code, your package folder will appear in Android/Data :
B4X:
File.WriteString(File.DirDefaultExternal,"2.txt","dddd")
But you must use runtimepermission firstly.
B4X:
Dim rp As RuntimePermissions
    rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result=True Then
        File.WriteString(File.DirDefaultExternal,"2.txt","dddd")
    End If
'Also add to manifest editor:
'AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
 
Upvote 0
Your package name will appear in Android/Data folder only if you add some code that operate with any function use external folder as File.DirDefaultExternal
For example: If you add this code, your package folder will appear in Android/Data :
B4X:
File.WriteString(File.DirDefaultExternal,"2.txt","dddd")
But you must use runtimepermission firstly.
B4X:
Dim rp As RuntimePermissions
    rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result=True Then
        File.WriteString(File.DirDefaultExternal,"2.txt","dddd")
    End If
'Also add to manifest editor:
'AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
Thanks a lot for the advice!
 
Upvote 0
Top