Android Question create a txt file that can be exported from the device

dualznz

Member
Licensed User
Longtime User
Hi all
Im about to release a major app on the play store
and i would like to know how i can create a log file how B4a logs events that happens and any errors that may come about to a txt file in which the user can upload to my website so i can diagnose the issues if any.

cheers
 

rbsoft

Active Member
Licensed User
Longtime User
Have a look at the Text File Tutorial by Erel:
http://www.b4x.com/android/forum/threads/text-files.6690/#content

And for uploading the file the Android FTP Tutorial might be of interest:
http://www.b4x.com/android/forum/threads/android-ftp-tutorial.10407/#content

Both tutorials are very detailed and have example code which is very easy to implement.

Depending on how often and how much data you save to that log file it might be a good idea to cut the file at the beginning if it exceeds a certain size. Otherwise it might get to huge. For example, if you set the maximum size of the file to 50 k you might cut it to 40 k if the limit is reached. When it reaches 50 k again you cut again. Like this you always have only the most relevant data.

I use this for my server logs where I limit the log files to 500 k.

Rolf
 
Last edited:
Upvote 0
Top