Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Show stored files by app in Android

Author
Message
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 18th Sep 2013 14:23
Hi everyone,

I would like to build an aplication for android with a pecularity... I want to the user can get the saved files (.txt files) by my apk to export it to Windows.

For this reason, I need know how get this files... I know that the saved files by my apk are stored in data/data/<package>, but this files are hidden... how can i show them?

I have read that the mode_private is activated... but i don't know how this option is changed...

Thanks!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Sep 2013 16:59
So far, on any Android device with OS greater than 2.3, I have been unable to find my AppGameKit directory on the actual device. I have tried a file manager app on the device and connected via USB and using a Window's File Manager to search.

Android keeps this stuff very well hidden now.

I suspect the only way to see the stuff is by jail breaking it (rooting it? something like that). And that is not recommended as a method to tell your customers that is required to run your app.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Sep 2013 17:58
Root access is required to access the files in the data directory.
If you're providing access to the files in the AppGameKit app's media directory you should be able to do so with the built-in file commands.
You don't need the absolute path to do this, just the path relative to the AppGameKit app's media directory.

Testing will be a bear without root access.

In Android 2.3 (or lower?) AppGameKit apps get their data stored into a AppGameKit directory on the sdcard mount. So if you have a 2.3 device then you might want to use that for testing.
You'll have to build your own UI for file selection from the media directory.

Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 18th Sep 2013 19:53 Edited at: 18th Sep 2013 19:55
Ok. I have Android 4.1.

Root is neccessary (in Android greater than 2.3), but I can't root my device or my user's device.
Using the information of http://developer.android.com/, I have understood Mode_private is sure and MODE_WORLD_READABLE was deprecated in API level 17 because is very dangerous... ok... we will not use this command

But I need my users can export files to their media folder and so, they can use blutooth for sharing its files (for example)

How can my app export the user files? Imagine Word or paint... you need your own files...

Thanks!
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Sep 2013 20:30
Out of curiosity I gave it a go with SetRawWritePath and SetFolder.
You can't change to the sdcard on an Android device (which is where the public folders are).

Also ChooseRawFile is currently limited to Windows/Mac...
I thought that you could select files on the device...
I know that xCeptDB did it in iTrippin... maybe try to find his email on the forums and give him a shout.

Seems like if you can select a file from an sdcard directory then you can write to that directory... not sure how to do it though as the T1 commands don't appear to do so...

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Sep 2013 22:33
If you are working in Tier 2, and the development environment/device don't force sand boxing, in theory you can use native commands to try and access other paths. But I haven't tried it on any portables.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 19th Sep 2013 00:56 Edited at: 19th Sep 2013 01:03
Naphier, I don't find xCeptDB user. And I have tested iTrippin... but this app don't open/save in user folders (at least, in the last version)
Ancient Lady, I use Tier 1... in the help of AppGameKit, you can read AppGameKit can only access to two folders (media folders of your application)

Thanks!

Edit: Sorry, I have found xCept! I will ask him. Thanks
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Sep 2013 05:16
Quote: "I use Tier 1"

I know. I meant to say 'If you were working in Tier 2'.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 19th Sep 2013 14:24 Edited at: 19th Sep 2013 14:25
Ah ok, ok... sorry... The problem is I hate C++... perhaps because I used this software in a bad moment and It left a bad taste in the mouth...

Thanks for your help.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 20th Sep 2013 21:48
I just sent you an email. The only feasible way in AppGameKit Tier 1 to save non-image documents to a readily accessible location is to upload the files to a web server using the available HTTP commands. Once uploaded, you could have the script return the unique download URL to the AppGameKit app, which could then spit out an email message etc. containing the URL so the user can access the file outside of the app. Currently only images can be saved to a public location on the memory card through Android, and even that is limited (you can't change filename or path).
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 20th Sep 2013 23:04
Thanks xCept for your help

Using Php is complicated because i need a good server for this project. Perhaps, I can use broadcast for send the files to windows... but i don't know...

I think that it would be good that AppGameKit 2 (or 3) had access to other folders...

Thanks all!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Sep 2013 23:07
Quote: "I think that it would be good that AppGameKit 2 (or 3) had access to other folders..."

It might be nice, but is behavior highly frowned upon. It is the kind of thing that allows 'bad' programs to get in and hack stuff they shouldn't.

Apple now requires sand boxing of all iOS and Mac apps so that they cannot access anything outside of the app specific directories and the few public ones (images).

I think Google already does require and enforce this. Which is why you currently can't see anything outside the app directory.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 19:47:03
Your offset time is: 2024-11-24 19:47:03