R/W external sdcard?

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wynds
Posts: 2
Joined: Wed Jul 10, 2013 1:04 am

R/W external sdcard?

Post by wynds » Wed Jul 10, 2013 2:00 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: R/W external sdcard?

Post by Simon » Wed Jul 10, 2013 7:07 am

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.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

wynds
Posts: 2
Joined: Wed Jul 10, 2013 1:04 am

Re: R/W external sdcard?

Post by wynds » Thu Jul 11, 2013 6:06 am

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

Post Reply