Refer to this I 've download the excel example,and run it ,it 's not Ok. about saving.
[Qoate]
An error has occurred in sub:main$ResumableSub_SaveTable_Clickresume(java line:579)
java.io.FileNotFoundException:/storage/emulatated/0/1.xlspen failed:EPERM(Operation not permitted)
[/Qoate]
so then I added the permission code as belows,but it's still error
B4X:
For Each permission As String In Array(rp.PERMISSION_WRITE_EXTERNAL_STORAGE, rp.PERMISSION_READ_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
Thank you for kind of you, Sagenut , Don Manfred and Agraham . I have finished.
I have edited some Agraham's code from another experts'
B4X:
Private Sub GetPackageName As String
#If B4A
Return Application.PackageName
#Else If B4I
Dim no As NativeObject
no = no.Initialize("NSBundle").RunMethod("mainBundle", Null)
Dim name As Object = no.RunMethod("objectForInfoDictionaryKey:", Array("CFBundleIdentifier"))
Return name
#Else If B4J
Dim joBA As JavaObject
joBA.InitializeStatic("anywheresoftware.b4a.BA")
Return joBA.GetField("packageName")
#End If
End Sub