Getting path to pictures on Android

Hi,

I need to set the baseDir in the code below to the path to my pictures or another location where i can put pictures. I tried searching but cannot figure this out. Does anyone know what I should put for that folder? How can I find out what that paths are for all locations?

Thanks!

-- Example of how to upload a photo  
-- (NOTE: available starting in daily build 2011.709)  
local attachment = {  
 message = "Corona Icon file",  
 source = {  
 baseDir=system.DocumentsDirectory,   
 filename="coronaIcon.png",  
 type="image"  
 },  
}  
  
facebook.request( "me/photos", "POST", attachment )  

[import]uid: 184193 topic_id: 32567 reply_id: 332567[/import]

You don’t create the folder, it’s in the sandbox. Open Corona simulator and in the menu bar up top under File you’ll see option to view sandbox.

Peach :slight_smile: [import]uid: 52491 topic_id: 32567 reply_id: 129582[/import]

Thanks but I need the path to where the pictures are stored on my android and others. I’m having to run the app from my phone, not the simulator because I’m testing the Facebook methods. I want to grab a picture from the picture directory and post it on Facebook but I need to set the baseDir which I do not know.

[import]uid: 184193 topic_id: 32567 reply_id: 129591[/import]

You don’t create the folder, it’s in the sandbox. Open Corona simulator and in the menu bar up top under File you’ll see option to view sandbox.

Peach :slight_smile: [import]uid: 52491 topic_id: 32567 reply_id: 129582[/import]

Thanks but I need the path to where the pictures are stored on my android and others. I’m having to run the app from my phone, not the simulator because I’m testing the Facebook methods. I want to grab a picture from the picture directory and post it on Facebook but I need to set the baseDir which I do not know.

[import]uid: 184193 topic_id: 32567 reply_id: 129591[/import]

Hey there - I had to check on this as I don’t normally work with Android - here’s what Josh (Android guru) had to say with regard to the above posts in this thread;

You’re right, Corona does not provide access to Android’s public Pictures directory. We have a sandboxed API which allows a Corona made app to be cross-platform with iOS.

Our media.show() API allows the end-user to select a photo from Pictures directory via the Gallery app:
http://docs.coronalabs.com/api/library/media/show.html

Our media.save() API allows the Corona developer to save an image file to the Pictures directory.
http://docs.coronalabs.com/api/library/media/save.html

Those our only options. [import]uid: 52491 topic_id: 32567 reply_id: 129735[/import]

Thanks! Actually I do not need to access the public library then. What I am wanting to do is capture a picture from the camera and upload it. So can I save the picture in the system.ResourceDirectory which is the path where the app is running? I can then delete the file after it is uploaded.

I need to see how to call to take a picture from Corona sdk and if I can specify where it is saved with the filename.

Thanks!

Warren
[import]uid: 184193 topic_id: 32567 reply_id: 129751[/import]

Hey there - I had to check on this as I don’t normally work with Android - here’s what Josh (Android guru) had to say with regard to the above posts in this thread;

You’re right, Corona does not provide access to Android’s public Pictures directory. We have a sandboxed API which allows a Corona made app to be cross-platform with iOS.

Our media.show() API allows the end-user to select a photo from Pictures directory via the Gallery app:
http://docs.coronalabs.com/api/library/media/show.html

Our media.save() API allows the Corona developer to save an image file to the Pictures directory.
http://docs.coronalabs.com/api/library/media/save.html

Those our only options. [import]uid: 52491 topic_id: 32567 reply_id: 129735[/import]

Thanks! Actually I do not need to access the public library then. What I am wanting to do is capture a picture from the camera and upload it. So can I save the picture in the system.ResourceDirectory which is the path where the app is running? I can then delete the file after it is uploaded.

I need to see how to call to take a picture from Corona sdk and if I can specify where it is saved with the filename.

Thanks!

Warren
[import]uid: 184193 topic_id: 32567 reply_id: 129751[/import]