Android 9 Can't save picture file

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Posts: 14
Joined: Sat May 04, 2019 3:43 pm

Android 9 Can't save picture file

Post by KRY_M » Tue Mar 03, 2020 10:30 pm


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:

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"
         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 
Thank you.
Passionate developer :D

VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 130
Joined: Mon Jul 31, 2006 1:39 am
Location: New Zealand, Australia, Germany, Japan

Re: Android 9 Can't save picture file

Post by strongbow » Wed Mar 04, 2020 6:10 am

This is a known issue. You can see (and subscribe to) the bug report here:

Post Reply

Return to “Android Deployment”