Android Question canot use Files in Android/Data

pucki

Active Member
Licensed User
Longtime User
I have a new phone – a Samsung A16 5G.

Why can't I access the folder under Android/Data after I've installed my program?

I need access to FILES so I can copy an SQL file that my software needs there. I can't see any folders for software installed by B4A from my PC either.

It can't be my software, since the standard demo has the same effect. Can someone help me?

Regards Pucki

p.s. : Sorry for the poor translation. I'm German, and Google translated this.
 

calloatti

Member
Licensed User
Example:

"D:\b4a-android\platform-tools\adb.exe" push D:\path\to\your\file\sqlite.db /sdcard/Android/data/your.app.path/files/sqlite.db
 
Upvote 0

pucki

Active Member
Licensed User
Longtime User
Thx.

But for my Comic-Prg. i need over 1000 Picture.

It's a lot of work to install all of them like this.

Why can't I access the folders normally? This is either a bug in the B4A software or, more likely, I've configured something incorrectly in the manifest editor.

When I enable developer mode, I can see ALL the programs I've installed and access their folders from my PC. But I don't see any B4A folder.

Is there really no better solution?

Regards

Pucki

ps: Translate by Google.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
I think that there might be communication problems here that go beyond language translation.

But I don't see any B4A folder.
B4A does not create any folders on your device, even when you install an app, so what do you mean by that?

Why can't I access the folders normally?
If you want to transfer files from your PC to your device then the "normal" way is to connect them by USB cable and transfer using Windows File Manager. Have you tried this?

Why can't I access the folder under Android/Data?
I suspect that this is where the problem lies. What is the targetSdkVersion that you have set for your app?
 
Upvote 0

pucki

Active Member
Licensed User
Longtime User
B4A does not create any folders on your device, even when you install an app, so what do you mean by that?
Yes thats right.

And i mean this Folder. I don't found the Folder where a B4A Apps is installed.

But i can see all Folder of my others App's. If i Click in this i see the Folders "FILES".

What is the targetSdkVersion that you have set for your app?

First 34, later 29.

Her are 2 Manifest i tested:

First :

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

and this ist der second i Tested.

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

AddManifestText(
<uses-permission
  android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
)
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)

I dont see any difference in the App's.

Regards

Pucki

Ps.: Writing in my bad English , sorry.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
When the app start use
B4X:
rp.GetAllSafeDirsExternal("")
where rp it's an instance of RuntimePermissions.
This should make the folder of your app appear under
Android >>> Data >>> YourPackageName
Inside you will find the Files folder.
Then you can access this folder using
B4X:
rp.GetAllSafeDirsExternal("")
as Dir.
There is no permission to request to access this folder in this way.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Here a fast test to check.
Just by launching the app you should already see the folder under Android/Data
The packagename is
aaa.FolderTest
Clicking the button will create a text file inside the Files folder.
 

Attachments

  • FolderTest.zip
    8.3 KB · Views: 67
Upvote 0
Top