Esteban

unread,
Jun 12, 2014, 6:51:53 PM6/12/14
to mitappinv...@googlegroups.com
Hi, Can anyone tell me how can I obtain the real path in sdcard of a file picked.

I have used the activity starter of Taifun (Picking files from the SD Card with App Inventor)
and the ImagePicker block but neither of them can give me the real path in sdcard, both of them copy the file in another folder:

storage/emulated/0/Pictures/_app_inventor_image_picker/picked_image-filename.jpg (path with imagepicker block

content://media/external/images/media/numberfile (path with activitystarter) (Where is this folder?)

Thank you for your attention

Taifun

unread,
Jun 12, 2014, 7:29:32 PM6/12/14
to mitappinv...@googlegroups.com
the image picker creates a copy of the image, this is probably not what you want, but what you get is the real path to the copy of the image

the activity starter solution http://puravidaapps.com/pick.php provides a path in the format you mentioned and you can assign that path to an image.picture property

set image.picture to "content://media/external/images/media/8742"

however I do not know, if this path also will work with the Sharing component
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Esteban

unread,
Jun 13, 2014, 6:31:45 AM6/13/14
to mitappinv...@googlegroups.com
OK Taifun, I´ll use the path with activity starter method.
I can´t use the path file with image picker in my app because I can´t store more than 9 images in the app_inventor_image_picker folder.

As usual, thanks so much Taifun.

Have a good day!

Hal Abelson

unread,
Jun 15, 2015, 8:07:22 PM6/15/15
to mitappinv...@googlegroups.com
I looked at this issue some, and tried to fix it by having the imagePicker return the actual path rather than make a copy.
As Taifun suggests, this does not work with the Sharing component, and perhaps not other things.   I've notice that come other apps
are arranged so that the end use makes a copy of an image before asking the app to share it.   It seems simpler for App Inventor to
always make the copy, even though it uses more space.

To Esteban:   content:// is not a real folder per se.  In Android programming, you process that with a "content resolver" to find the actual image.


Reply all
Reply to author
Forward
0 new messages