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.

Android / Can two T1 AGK2 apps read and write from a common android directory?

Author
Message
Zef
6
Years of Service
User Offline
Joined: 27th Feb 2013
Location: Massachusetts
Posted: 27th Nov 2018 03:50
I have two AGK2 apps.

One gathers data and writes it to a file.
The second app wants to read that data from the file created by the first app.

App #2 needs to read a file from a directory 'owned' and written to by app #1.

Is it possible to do this on android?

Thanks,
Jack
14
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Nov 2018 16:12
You could try the raw path commands:

file = OpenToWrite("raw:Folder\File.type")


to save or read from a raw directory.

[/url]
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Nov 2018 23:25 Edited at: 28th Nov 2018 23:27
You can use GetDocumentsPath() to get the appropriate folder to write to.
I think you still need to add the raw: tag as well
You will also need to change your apps permissions to allow it to write to storage (Checkbox in the export dialog)

If you don't have too much data then maybe you could use SaveSharedVariable
Zef
6
Years of Service
User Offline
Joined: 27th Feb 2013
Location: Massachusetts
Posted: 29th Nov 2018 03:07
Thank you to both Jack and BlinkOk.
I was hoping for one answer and you provided 3!

blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Nov 2018 08:13 Edited at: 29th Nov 2018 08:14
I think the SaveSharedVariable() is probably the best for your needs because it specifically targets separate Apps where as you might run into permission issues using a file

Login to post a reply

Server time is: 2019-09-21 11:50:43
Your offset time is: 2019-09-21 11:50:43