Page 1 of 1

R/W external sdcard?

Posted: Wed Jul 10, 2013 2:00 am
by wynds
Hi all,
I already had JKD and ADT up and running. I sort of enjoyed configuring LiveCode to use the android emulator from Eclipse, and that's when the fun began.
I'm able to read/write files to Windows desktop but not my Samsung Moment sdcard.
'As is' the the code listed below launches on my phone but no files open, a path related issue.
When I replace each instance of 'desktop' with '/sdcard/documents' I get a blank black screen on the phone and the emulator.
Yes, 'Write External Storage' is checked in Standalone Application Settings.
Any and all Android specific pointers will be appreciated.

LiveCode Lessons » How To - Step-By-Step Guides To Tasks In LiveCode » File Input/Output excerpt:
on preOpenStack
put empty into fld "Shakespeare" -- initializes empty field
end preOpenStack
on openStack -- This creates the text file on the desktop that we will later read into a stack's text field.
open file specialFolderPath("desktop") & "/SetUp.txt" for write
put "Let me not to the marriage of true minds admit impediments." into myText
write myText to file specialFolderPath("desktop") & "/SetUp.txt"
close file specialFolderPath("desktop") & "/SetUp.txt"
end openStack

Re: R/W external sdcard?

Posted: Wed Jul 10, 2013 7:07 am
by Simon
Hi wynds,
Welcome to the forum! :)

From my Android phone I see the path as "/mnt/sdcard"

Simon

EDIT: Don't try this when plugged into the USB, it's not available.

Re: R/W external sdcard?

Posted: Thu Jul 11, 2013 6:06 am
by wynds
Thanks for the confirmation. Now I see that there;s no 'documents' folder on the emulator but my device sdcard does have one.
The app launched on JELLY_BEAN (Froyo still getting black screen), even has my .png icon, but doesn't read the text file which I pushed to the emulator's sdcard using DDMS File Explorer, even with corrected path on button behavior. Am going to try all path settings I can think of.
edit:
error:Could not initialize OpenglES emulation, using software renderer.
The black screen with Froyo emulator cured with a driver update to my NVIDIA 6150 video card.
------------------------------------------------------------
win7/64 pro
Android Developer Tools - Build: v22.0.0-675183
LiveCode 6.1