GLBasic forum

Main forum => GLBasic - en => Topic started by: Wampus on 2012-Apr-10

Title: Which directory can I write to that I can easily access in Android?
Post by: Wampus on 2012-Apr-10
Which directory can I write to that I can easily access in Android?

Might seem like a dumb question but I'm dumb. :)

On my main test device the documents and application directories sent back from PLATFORMINFO$() both have /data/data/com.livingmidnight.[whatever]/files. Unfortunately I can't seem to get to these directories with File Manager. I've checked over the SD card storage and the main memory but find nothing. Is the directory hidden when testing a debug version of an app?
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: MrTAToad on 2012-Apr-10
File Manager seems to prevent you from accessing the file storage on the phone.  And guess where the data is likely to be...  :glare:

I had a look on the SD Card (even with hidden files being shown) and couldn't find anything related to my games, so it must be on the phone...
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: Wampus on 2012-Apr-11
I'll try a different file manager to see if that makes a difference.

The reason I need to access the app directory (or another directory I can write to) is to get at a generated log file. Alternatively I could write a 'dev mode' style log file reader into apps with the option of reading the last log file before starting the app again. Probably a good idea. Would help with playtesting and bug reporting.
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: Slydog on 2012-Apr-11
Instead of a file, could you write your logs to 'STDOUT'?
I'm not sure how to access that output from Android, as I've never compiled for my Android yet.
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: Slydog on 2012-Apr-11
Also, a while back, there was discussion about creating a WebLog command.
This would send your log messages to a server on the net, using standard networking commands in GLBasic.
You would then need a receiving program on your server to accept and store this data.
Then possibly a method to view this data, or simply FTP into your server and download the log file manually.
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: kanonet on 2012-Apr-11
If your device have internet connection, than you can upload the logfile or email it to yourself, when your app start next time.

But i think i like best the idea of just logging over a network connection (you wont even need internet, just a local connection to your pc). You can display log on your pc or just save it to file...

As far as i know (dont have android) STDOUT will send to your pc and there is a debugging program that can receive this, maybe someone else can help with this.
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: Kitty Hello on 2012-Apr-12
web-log is easy. just open a port tcp for listening on the device.
every time you "log", try to tcp_accept. If you did, sock_send the string and sock_close it.
On the PC-side, just tcp_connect to the device, if you get an connection, read until it returns 0. goto 10.
Title: Re: Which directory can I write to that I can easily access in Android?
Post by: Wampus on 2012-Apr-12
Ok, so log file sending over network (LAN for now) is now working. Good for me, good for wider testing in Alpha/Beta versions later. Thanks for the suggestions.  =D