'Importing' a data file into a Mobile app

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: 'Importing' a data file into a Mobile app

Post by Traxgeek » Wed Sep 17, 2014 10:14 pm

Thanks all.

I'll go take a look at a DropBox-esque approach !

For me I simply wanted to be able to locate a file on the External / Removal (SDCard) drives (Android). This would suffice... I'm still playing with all of this though - in all its guises...

Thanks a million - really appreciated...
Last edited by Traxgeek on Sat Sep 27, 2014 3:54 pm, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

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

Re: 'Importing' a data file into a Mobile app

Post by Simon » Wed Sep 17, 2014 11:01 pm

You know I did a video app ages ago and I just used the path I knew.
put "mnt/sdcard/Movies/doggy.mp4" into docpath
But maybe this is more about the number of sd cards you have.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: 'Importing' a data file into a Mobile app

Post by sphere » Sun Jun 07, 2015 10:51 am

Great info in here. I want to access files outside the snadbox too. And i'll try to use the last trick like Simon did. (allready have dropbox experience which really works great) But for some audio files i hope this works.

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

Re: 'Importing' a data file into a Mobile app

Post by Simon » Mon Jun 08, 2015 4:53 pm

Hi sphere,
with more info since this post it looks like this is a common path
"mnt/sdcard/"
even with devices that show the sdcard as something else e.g. ext_sdcard.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: 'Importing' a data file into a Mobile app

Post by sphere » Mon Jun 08, 2015 5:19 pm

Great !

Have to test some (simple) things out.

Thanks Simon !

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: 'Importing' a data file into a Mobile app

Post by MaxV » Tue Jun 09, 2015 1:11 pm

I would suggest you to use socket approach. Here a lesson: http://lessons.runrev.com/m/4071/l/1292 ... ng-sockets

and socket for android are avalibel with the plugin of Mr. Hao: http://hedgehao.blogspot.it/2015/04/hao ... ecode.html
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: 'Importing' a data file into a Mobile app

Post by sphere » Sun Jun 14, 2015 5:30 pm

Thanks MaxV !

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: 'Importing' a data file into a Mobile app

Post by SparkOut » Sun Jun 14, 2015 10:44 pm

Just to go back to the original attempt - does the path /mnt/ext_sdcard show you anything on your device?

/mnt/ext_sdcard is a visible folder on my device, but empty. Whereas /mnt/sdcard is a symbolic link to storage/sdcard0 and /mnt/sdcard2 is a symbolic link to storage/sdcard1 (go figure).

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: 'Importing' a data file into a Mobile app

Post by sphere » Tue Jun 16, 2015 11:52 am

i will check when i have time :)

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: 'Importing' a data file into a Mobile app

Post by SparkOut » Tue Jun 16, 2015 11:10 pm

Just to be clear, I can't offer any advice. My questions are to try and understand how the storage works on different devices and look for some consistency.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: 'Importing' a data file into a Mobile app

Post by jacque » Tue Jun 16, 2015 11:40 pm

I don't get anything on either of the sd card paths. I believe you need to be on a rooted device to read those. My file manager can't see the files in there either.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: 'Importing' a data file into a Mobile app

Post by MaxV » Wed Jun 17, 2015 9:51 am

The standard location of SD card on Android is: /mnt/sdcard
If you have more than one sdcard you have also: /mnt/sdcard2, /mnt/sdcard3, etc.
Now phones have always a sdcard soldered inside that is /mnt/sdcard and the external is /mnt/sdcard2.
These folder are, usually, always present; you don't have to guess if they are soft-links or real folders, they always work.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: 'Importing' a data file into a Mobile app

Post by SparkOut » Wed Jun 17, 2015 1:57 pm

Thanks Max!

Now... is it possible to tell from LC whether the user's device is set to allow/prefer external storage?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: 'Importing' a data file into a Mobile app

Post by jacque » Wed Jun 17, 2015 5:23 pm

Max, is your device rooted? I get nothing when querying either the files or the folders in mnt/sdcard.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

kurt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 21
Joined: Sat Apr 08, 2006 8:30 pm
Contact:

Re: 'Importing' a data file into a Mobile app

Post by kurt » Thu Jun 18, 2015 3:28 am

Don't know if the following is of any help.

On my Android phone the path to the external SD card is:
/storage/sdcard1

/storage/sdcard0
is the path to the internal flash memory.

Post Reply