My second Android App, it takes a picture then it saves it into the Album with a name created by me.
On older Android Versions( 4 to 8 ) it works as expected. It invokes the camera app, allows you to take the picture and it return in my app, where it confirms the saving inside a multi-line field, where I can see the result by adding a new row with the name composed by:
-TextFromField_CurentYear_CurrentMonth_CurrentDay_pAnAutoIndexNumber.jpg
On Android 9 it opens the camera app, it allows you to take how many pictures you want.. but it does not return to my app. If I close the app inside the cache folder of my app /Android/data/mycompany.myapp/cache/ I can find my pictures but with the default names imposed by the camera app.
How can I try to detect and fix this problem ?
I tried on two different Android devices (Samsung branded) on both it makes the same, on my old Blackberry Q20 it saves the files but it does not renames them, but on regular android devices (an Huawei with Android 7, an Nokia with android 8, and some old J5 it works as expected)
How to detect what is the problem ? The apps have permissions to save to external files and to access the camera.
the code is:
Code: Select all
if the environment is "mobile" then
lock screen
mobilePickPhoto "camera"
if the result = "cancel" then
exit mouseup
end if
put temp &"_p" & nr &".jpg" into cale
// Android only
put the long ID of last image into tImageID
mobileExportImageToAlbum tImageID, cale
if the result is not empty then
put cale & " Error" & result() after field "Field1"
else
put cale & cr after field "Field1"
end if
delete last img
unlock screen
add 1 to nr
## If the export fails for some reason
if the result <> EMPTY then
answer "Error while exporting image:" && the result
end if
end if