Android Question B4a Application package folder / File.DirDefaultExternal not being created

mjm

New Member
Licensed User
Longtime User
Hi...first time post, but long time lurker and (very amateur) B4a developer...

I've been developing an app for a few months and must have installed it via B4A-Bridge hundreds of times.

I'm using File.DirDefaultExternal for a log file and it's always worked fine...until this morning...

Code:
    Log("File.DirDefaultExternal=" &  File.DirDefaultExternal)
still gives me

Code:
/storage/emulated/0/Android/data/anywheresoftware.b4a.samples.camera/files

...which is all good.

However, as of this morning, neither of the following exist after an install . i.e the package folder does not get created on an install (debug or release, private key or debug key):
/storage/emulated/0/Android/data/anywheresoftware.b4a.samples.camera
/storage/emulated/0/Android/data/anywheresoftware.b4a.samples.camera/files

I've used a "Files" application to look at Android/data and the directory has always been there when the app is installed, except for now.

Any ideas please? I'm completely stuck....

Add: manifest file, if relevant..
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: http://www.basic4ppc.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="33"/>
<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.
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.PERMISSION_ACCESS_FINE_LOCATION)
AddPermission(android.permission.PERMISSION_ACCESS_COARSE_LOCATION)
AddPermission(android.permission.PERMISSION_CAMERA)
'
AddApplicationText(<activity android:name="anywheresoftware.b4a.objects.preferenceactivity"/>)
 
Last edited:

mjm

New Member
Licensed User
Longtime User
WRITE_EXTERNAL_STORAGE no longer works.
File.DirDefaultExternal no longer works.

Why aren't you using File.DirInternal?
Thanks for the quick response Erel...:)

Did they stop working today? - they were OK yesterday

B4X:
Log("File.DirInternal=" &  File.DirInternal)
gives
B4X:
File.DirInternal=/data/user/0/anywheresoftware.b4a.samples.camera/files

I've changed my log file to be in File.DirInternal - my app is now back to working - phew...and I can see the logging happening via debug
...but I'm not familiar with File.DirInternal ... if I use it for my log file, how do I see the file/where is it on my phone storage (Samsung S23+, no SD card)

Or from another perspective , what's the best current solution for application logging, so that it's easy to see the logs?
 
Last edited:
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top