It could be that you are attempting your write operation before memory is fully initialized. Below is a sub that I wrote for a situation similar to yours. Don't attempt your write until it returns mounted
B4X:
'returns state of DirDefaultExternal - unmounted, mounted or shared
Public Sub myStorageState As String
Dim r As Reflector
Dim ExternalStorageState As String=r.RunStaticMethod("android.os.Environment", "getExternalStorageState",Null,Null)
Log("[myStorageState] -- Storage state is: " &ExternalStorageState)
Return ExternalStorageState
End Sub
It could be that you are attempting your write operation before memory is fully initialized. Below is a sub that I wrote for a situation similar to yours. Don't attempt your write until it returns mounted
B4X:
'returns state of DirDefaultExternal - unmounted, mounted or shared
Public Sub myStorageState As String
Dim r As Reflector
Dim ExternalStorageState As String=r.RunStaticMethod("android.os.Environment", "getExternalStorageState",Null,Null)
Log("[myStorageState] -- Storage state is: " &ExternalStorageState)
Return ExternalStorageState
End Sub
Things like StartAtBoot becomes ACTIVE when you first start the App after Installing. Just installing the app does not make the StartAtBoot active. The App must be started at least once.
check that fast boot is disabled if such a feature exist's on your device. I had the same issue on a HTC on X. I would recommend a timed delay of about 20 seconds in the boot service before you initialize your storage to allow storage to be initialised.
check that fast boot is disabled if such a feature exist's on your device. I had the same issue on a HTC on X. I would recommend a timed delay of about 20 seconds in the boot service before you initialize your storage to allow storage to be initialised.
Agreed. This is why I check memory init status on boot with the sub above. It seems that otherwise, app code begins to execute before external data memory is available for file operations.