I have a Samsung Galaxy phone which I use for development. Everything fine there. I recently got a Motorola Ace 5G and my App cannot seem to create a directory?
There are no errors, however after running the test app below, the FILES app does not show the directory. I get an "unknown error" only when I try to access external storage.
Cannot find anything in forum about this.
Thanks for your help.
Log--------------------------------
Logger connected to: motorola motorola one 5G ace
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
Permission Success
** Activity (main) Resume **
Permission Result = 0
I Guess Directory Created?
** Activity (main) Pause, UserClosed = false **
There are no errors, however after running the test app below, the FILES app does not show the directory. I get an "unknown error" only when I try to access external storage.
Cannot find anything in forum about this.
Thanks for your help.
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="14" 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)
AddPermission("android.permission.WRITE_EXTERNAL_STORAGE")
'End of default text.
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Private xui As XUI
Public rp As RuntimePermissions
Public Dir As String = File.DirRootExternal
Public AppDir As String = "MarcTest/"
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
wait for (SetPermissions) complete (Result As Int)
Log("Permission Result = " & Result)
Try
File.MakeDir(Dir,AppDir)
Catch
Log(LastException)
End Try
Log("I Guess Directory Created?")
End Sub
Sub SetPermissions As ResumableSub
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Not(Result) Then
xui.MsgboxAsync("You Must Accept This Permission","")
ExitApplication
Else
Log("Permission Success")
End If
Return 0
End Sub
Log--------------------------------
Logger connected to: motorola motorola one 5G ace
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
Permission Success
** Activity (main) Resume **
Permission Result = 0
I Guess Directory Created?
** Activity (main) Pause, UserClosed = false **