buongiorno a tutti,
sto uscendo matto,
nella mia piccola app sto richiedento i permessi in questo modo, ma non mi fa vedere la finestra dei permessi,
qualche idea?
tra l'altro se do i permessi a mano sull'App
questa funzione mi copia il file a Zero byte ? Perche?
allego anche il file manifest
sto uscendo matto,
nella mia piccola app sto richiedento i permessi in questo modo, ma non mi fa vedere la finestra dei permessi,
qualche idea?
B4X:
Sub Activity_Create(FirstTime As Boolean)
' If FirstTime Then
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("lytmenu")
InitMenu
End Sub
Sub InitMenu
'=================================================================================
For Each permission As String In Array(rp.PERMISSION_READ_EXTERNAL_STORAGE,rp.PERMISSION_CAMERA,rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
rp.CheckAndRequest(permission)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result = False Then
ToastMessageShow("No permission!", True)
Activity.Finish
Return
End If
Next
rp.GetSafeDirDefaultExternal("")
If File.Exists(File.DirDefaultExternal,"Db_ParPDV.db")=False Then
File.Copy(File.DirAssets,"Db_ParPDV.db",File.DirDefaultExternal,"Db_ParPDV.db")
Sleep(100)
End If
End Sub
questa funzione mi copia il file a Zero byte ? Perche?
B4X:
File.Copy(File.DirAssets,"Db_ParPDV.db",File.DirDefaultExternal,"Db_ParPDV.db")
allego anche il file manifest
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="30"/>
<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.DarkTheme)
'gestione camera vision cameraex
AddApplicationText(<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="barcode,,face" />)
'===============================
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
AddPermission("android.permission.VIBRATE")
AddPermission("android.permission.CAMERA")
AddPermission("android.permission.FLASHLIGHT")
'
AddPermission("android.permission.READ_EXTERNAL_STORAGE")
AddPermission("android.permission.WRITE_EXTERNAL_STORAGE")
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
'End of default text.