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 / Read a file located on the sdcard? Is it possible on Android?

Author
Message
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 5th Feb 2012 11:15
I try to use OpenToRead(1,"/sdcard/AGK/Unknown/peter121212.res")
This is exactly the spelling I see in the file browser.
I take care to using capital letters if neccessary.

I get an error message saying it is impossible to open the file.
Is it possible to read a file from the sd card on Android.

Can someone Help me?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Feb 2012 21:24
It's a security feature, you can only read the application directory.
It's possible to do on Android, but it triggers a warning to the user.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 5th Feb 2012 22:53
So does AppGameKit create a directory on /sdcard?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Feb 2012 23:40
all AppGameKit apps create a folder using their app name as /sdcard/AGK/<appname> all read and write commands are relative to this directory (and anything that happens to be in the "assets" folder in tier 2.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 8th Feb 2012 08:09
Will this structure change in 107 with the new DIR commands?

If my application does not write out any data, I see no need for the AGK/<appname> dir to be created on /sdcard

This is the same "problem" I am having on Windows.
On iOS no extra dirs are created for example.
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 8th Feb 2012 21:38
I followed the procedure under Guides Android Tier 1 : "Integrating your application in the player" to make a standalone application on my Android Phone. All functions well. The name of the application is "observatie".
It makes a write directory on my sd card with the path: /sdcard/AGK/Unknown/
instead of
/sdcard/AGK/observatie/

Is this normal?

(I further think /sdcard/AGK/Unknown/ directory was created previously and is also used by an AppGameKit application I downloaded from the app market.)

(When I test an application on the Android player (not stand alone) it creates a separate directory with the right name).
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Feb 2012 23:40
It might be that I had trouble getting the app name in tier 2 on android, in which case I just default the folder name to "Unknown". The Android Player handles it slightly differently. I'm sure there must be an app data directory for Android apps, I shall have to investigate when I get the chance.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Feb 2012 11:33
Every android app has a data folder in /data/data/yourapp/, where you have subfolders (files, databases, cache, pictures) etc.

Can't you create data files in here, like in iOS?

Login to post a reply

Server time is: 2024-05-03 07:24:14
Your offset time is: 2024-05-03 07:24:14