finding files
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
finding files
Hello,
I've installed an app on my Android device's internal storage. The app writes some files-- but I can't find the files on the device. Files are created in the documents folder; specialfolderpath("documents"). I can list them within the app, confirming they were created. But I can't find them using the device's file browser. (this is Froyo w/ a flytouch tablet).
Thanks.
_Chuck
I've installed an app on my Android device's internal storage. The app writes some files-- but I can't find the files on the device. Files are created in the documents folder; specialfolderpath("documents"). I can list them within the app, confirming they were created. But I can't find them using the device's file browser. (this is Froyo w/ a flytouch tablet).
Thanks.
_Chuck
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
I'm sure I've posted about this file path issue on Android before.
May have some luck viewing my posts.
But may have removed my posts do to drunken frustration with RunRev.
Been out of the LiveCode Android development study for a few weeks now.
Just visiting to see if I can get the scent back.
Nope. Not so far.
May have some luck viewing my posts.
But may have removed my posts do to drunken frustration with RunRev.
Been out of the LiveCode Android development study for a few weeks now.
Just visiting to see if I can get the scent back.
Nope. Not so far.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: finding files
Hmm. After reading those older posts I get the impression that the documents folder might be inside a kind of zip archive, invisible to the rest of the Android OS. Could that be right?
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
It's a shame you have to get help from someone who is no longer developing with LiveCode.
I've moved over to Basic4Android. Heaps cheaper with better support and an lot more Android functionality.
This is a card I've extracted from one of my projects.
I got it from another member here.
Can't recall if I've moded the code to suite my purposes or not.
This card was Never designed for a user to see.
It was for diagnosis purposes only.
It should get you started.
With no guarantees that it will even work.
Android file locations are NOT windows and iOS locations.
The installation folder is protected at run time.
The documents folder is automatically prefixed with your
apps 'Identifier' field in Android settings in Standlone application setting.
whewh!
hth
I've moved over to Basic4Android. Heaps cheaper with better support and an lot more Android functionality.
This is a card I've extracted from one of my projects.
I got it from another member here.
Can't recall if I've moded the code to suite my purposes or not.
This card was Never designed for a user to see.
It was for diagnosis purposes only.
It should get you started.
With no guarantees that it will even work.
Android file locations are NOT windows and iOS locations.
The installation folder is protected at run time.
The documents folder is automatically prefixed with your
apps 'Identifier' field in Android settings in Standlone application setting.
whewh!
hth
- Attachments
-
- File Locations.zip
- (3.17 KiB) Downloaded 459 times
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: finding files
I still haven't had any luck finding the "documents" fold in Android
Let me try another tack: How does one write to an SD card from a livecode app?
Let me try another tack: How does one write to an SD card from a livecode app?
Re: finding files
The file folders in an Android app (and an iOS app too) are sandboxed and you can't see them or access them. If your device is rooted you might be able to spot them, but they are intentionally protected and hidden by the OS and for the most part you should only rely on access from within your app.
Some apps do create their own external folders for file storage though, which the user can see with a file manager. On my device, most seem to be in "/mnt/storage/" followed by a folder named for the app. I haven't tried it, but I don't see why it wouldn't work.
Some apps do create their own external folders for file storage though, which the user can see with a file manager. On my device, most seem to be in "/mnt/storage/" followed by a folder named for the app. I haven't tried it, but I don't see why it wouldn't work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
Using the app i've uploaded,
you'll need to remove the files from the copy file page under standalone application settings
and on the FileLocations app
clear the file locations text box
and the File Contents text box
and the text box at the bottom before testing
you then test by targeting your physical device.
Once the app fires on your physical device
Press the show engine files button on the physical device
under file location: you'll see the
/data/app/xxx.xxx.xxx-appName-x.apk/
This is a folder AND a reference to your installation application package
This exact folder in on the physical device and NOT on your SD micro card.
The xxx.xxx.xxx is the Identifier content under the Standalone Application settings under the Android page.
appName-x.apk
- appName is the Lable on the same Android page.
- x is sometime 1 and sometime 2. I'e never seen 3.
I use a free app from he market 'File Expert' to browse the folder
Using File Expert if you click on appName-x.apk it will try to install your app again.
Back to the test app
on the bottom half you'll see a selection drop down box
click the down arrow and select 'engine' or ' documents'
Selecting 'Engine' will show as above with all files and sub-folder, etc.
As mentioned the specialfolderpath("engine") is protected and is NOT writable.
Selecting 'Documents'
Gives me:
Default Folder:
/data/app/xxx.xxx.xxx-2.apk/webkit
also the path:
/data/data/xxx.xxx.xxx/files
is where the files you specified to include in your installation on the Standalone App Settings
on the Copy Files Page
This folder is NOT writable once your app has installed.
But the files are readable.
Although, I don't know if these file are readable by your app only.
My last research indicated that LiveCode was unable to install to the sd Card in any way.
A work around is to install the app then use the app to download writable data to a folder on the sd Card.
hth
you'll need to remove the files from the copy file page under standalone application settings
and on the FileLocations app
clear the file locations text box
and the File Contents text box
and the text box at the bottom before testing
you then test by targeting your physical device.
Once the app fires on your physical device
Press the show engine files button on the physical device
Code: Select all
...
set the defaultFolder to specialfolderpath("engine")
...
put "DefaultFolder: " & return & the defaultFolder & return after fld "FileContents"
...
/data/app/xxx.xxx.xxx-appName-x.apk/
This is a folder AND a reference to your installation application package
This exact folder in on the physical device and NOT on your SD micro card.
The xxx.xxx.xxx is the Identifier content under the Standalone Application settings under the Android page.
appName-x.apk
- appName is the Lable on the same Android page.
- x is sometime 1 and sometime 2. I'e never seen 3.
I use a free app from he market 'File Expert' to browse the folder
Using File Expert if you click on appName-x.apk it will try to install your app again.
Back to the test app
on the bottom half you'll see a selection drop down box
click the down arrow and select 'engine' or ' documents'
Selecting 'Engine' will show as above with all files and sub-folder, etc.
Code: Select all
set the defaultFolder to specialfolderpath("engine")
Selecting 'Documents'
Code: Select all
set the defaultFolder to specialfolderpath("documents")
Default Folder:
/data/app/xxx.xxx.xxx-2.apk/webkit
also the path:
/data/data/xxx.xxx.xxx/files
is where the files you specified to include in your installation on the Standalone App Settings
on the Copy Files Page
This folder is NOT writable once your app has installed.
But the files are readable.
Although, I don't know if these file are readable by your app only.
My last research indicated that LiveCode was unable to install to the sd Card in any way.
A work around is to install the app then use the app to download writable data to a folder on the sd Card.
hth
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: finding files
I bet your device is rooted. The data/app/ folder isn't visible on an unrooted device (like mine.)
The ability to install to the SD card was just added in the last developer release and it works really well. You'll see it in the next public release.
The ability to install to the SD card was just added in the last developer release and it works really well. You'll see it in the next public release.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
yes, phone is rooted.
Promises, promises, promises.
Will RR be charging for that release as well?
LOL
Promises, promises, promises.
Will RR be charging for that release as well?
LOL
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: finding files
No idea if they will charge, I'm not privy to how sales work. You could ask support.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
I've promised support I wouldn't contact them any more.jacque wrote:No idea if they will charge, I'm not privy to how sales work. You could ask support.
I'll just wait n see like always.
Basic4Android is keepin me busy.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: finding files
Thanks. I think I'm getting the picture.
Are the sandboxed files created within the .apk file? If so, I should be able to copy the .apk, rename it as a .zip and then find the created files?
Barry's message suggests I can write a file to the SD card. Do I just specify a path like: "//SDcard/myfile" ?
Are the sandboxed files created within the .apk file? If so, I should be able to copy the .apk, rename it as a .zip and then find the created files?
Barry's message suggests I can write a file to the SD card. Do I just specify a path like: "//SDcard/myfile" ?
Re: finding files
I posted this to the list the other day, but I think Jack Palevich's Terminal Emulator is the Best Android App Ever. If you know your way around a command line, this should solve all your "where's that file" issues. Oh - and it's free. As in beer.
http://www.androlib.com/android.applica ... -zxnC.aspx
http://www.androlib.com/android.applica ... -zxnC.aspx
Re: finding files
Barry- nice to see you're still looking in on things here. I think Android support is about 40% there right now - not exactly ready for prime time. There's been quite a bit of discussion over the last couple of weeks about what's not there. Socket support is the big missing item for me at the moment, so I'm doing some dev work with Appcelerator Titanium. Basic4Android looks interesting, but the thought of having to use Basic gives me the willies.
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: finding files
Yeah, I missed VisualBasic after moving to REALbasic.
I missed REALbasic after moving to LiveCode.
I missed LiveCode after moving to Basic4Android.
I missed REALbasic after moving to LiveCode.
I missed LiveCode after moving to Basic4Android.
Code: Select all
-- This was working for me before moving to Basic4Android
-- My coding is meant only for and is sufficient for me - not some non-existant party who will never review my code
-- this is just a snippit of a much larger app
-- please accept this as a place to start and not a solution
on mouseUp
if label of button cmdOk = "Save" then
put the dgDataOfIndex [Field lblPreviousSelection] of group dgAudio into theDataA
put field lblWhichSound into tWhichSound
put theDataA["Name"] into tName
put theDataA["Path"] into tPath
put "myAPP - preferences.txt" into theFileName
set the itemDelimiter to space
put GetAppFolder() into tAppPath -- this be where the installed files are for me installed app - n the Copy Files from Stadalone app Settings
put GetDocFolder() into tDocPath -- this be where me updated data and MyPreferences files be when I save data or save preferences
Put tDocPath & slash & "preferences" into theFolderAndFileName
if there is a folder theFolderAndFileName then
-- do nothing
else
create folder theFolderAndFileName
end if
Put theFolderAndFileName & slash & theFileName into theFolderAndFileName
if there is NOT a file theFolderAndFileName then
put "Sound" & tab & "Interval" & return & "Sound" & tab & "Finish" & return into theData
put theData into url ("file:" & theFolderAndFileName)
end if
put url ("file:" & theFolderAndFileName) into theData
put lineOffset(tWhichSound,theData) into tWhichLine
put "Sound" & tab & tWhichSound & tab & tName &tab & tPath into linUpdateLine
put linUpdateLine into line tWhichLine of theData
put theData into url ("file:" & theFolderAndFileName)
go to card iSettings
send "openCard" to card iSettings
end if
Function GetAppFolder -- tAppPath
-- SpecialFolderPath (Documents) folder DOES exist on environment win32
-- But I DON'T want to use the documents path on environment win32
--
-- I want to use the applications subfolders Doco and Vids on Environment win32
--
-- SpecialFolderPath(Engine) DOES NOT exits on environment win32
-- set the defaultFolder to specialFolderPath("engine")
-- answer the result
-- on win32 returns: can't open directory
--
-- SpecialFolderPath(Engine) is for Android and iOS
-- the Android installer package saves READ ONLY in the Engine Folder
-- you can include extra folders with the files contained within the folders
-- using Copy Files dialog in StandAlone settings
-- get the file path for this stack
-- the effective filename of this stack if the FULL FOLDERnFILENamePath
put the effective filename of this stack into tPath
set the itemDelimiter to slash
if the platform = "MacOS" and the environment = "standalone application" then
-- if this is a standalone application running on a Mac, find the path to the .app file
repeat until last item of tPath contains ".app"
delete last item of tPath
end repeat
end if
if the platform = "win32" and the environment = "standalone application" then
put the effective filename of this stack into tPath
set the itemDelimiter to slash
end if
if the platform = "win32" and the environment = "development" then
put the effective filename of this stack into tPath
set the itemDelimiter to slash
end if
if the platform = "android" and the environment = "mobile" then
set the defaultFolder to specialFolderPath("engine")
put defaultFolder into tPath
if character -1 in tPath is slash then delete character -1 of tPath
Return tPath
end if
-- remove the last item to get the path to the containing folder
delete last item of tPath
Return tpath
end GetAppFolder
Function GetDocFolder
-- get the file path for this stack
put the effective filename of this stack into tPath
set the itemDelimiter to slash
if the platform = "MacOS" and the environment = "standalone application" then
-- if this is a standalone application running on a Mac, find the path to the .app file
repeat until last item of tPath contains ".app"
delete last item of tPath
end repeat
end if
if the platform = "win32" and the environment = "standalone application" then
put the effective filename of this stack into tPath
set the itemDelimiter to slash
end if
if the platform = "win32" and the environment = "development" then
put the effective filename of this stack into tPath
set the itemDelimiter to slash
end if
if the platform = "android" and the environment = "mobile" then
set the defaultFolder to specialFolderPath("documents")
put defaultFolder into tPath
if character -1 in tPath is slash then delete character -1 of tPath
Return tPath
end if
-- remove the last item to get the path to the containing folder
delete last item of tPath
Return tpath
end GetDocFolder
Last edited by BarrySumpter on Wed Nov 16, 2011 4:36 am, edited 2 times in total.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.