It is currently Wed Mar 22, 2017 7:13 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Data File storage location
Unread postPosted: Sat Oct 01, 2016 5:07 pm 
Offline

Joined: Fri Sep 30, 2016 9:32 pm
Posts: 3
I have written a Basic! program which reads text files to input data for the program. It works fine when I run it with the interpreter and also as an apk. Where are the text files stored when the program is compiled. I need to be able to access them to edit them from time to time.
Thanks


Top
 Profile  
 
 Post subject: Re: Data File storage location
Unread postPosted: Sat Oct 01, 2016 7:54 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5442
Location: Paris, France
Hello Boris,

technically your resource files are stored in a folder of the apk called "assets", and they are only accessible in read-only mode.

If you want to edit them, you have to copy them to sdcard with this little snippet:
Code:
FN.DEF CopyToSd(file$)
  BYTE.OPEN r, fid, file$
  BYTE.COPY fid, file$
FN.END


Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Data File storage location
Unread postPosted: Sat Oct 01, 2016 11:18 pm 
Offline

Joined: Fri Sep 30, 2016 9:32 pm
Posts: 3
Hello Nicolas,
Thanks for your prompt reply. I have another question - will I need to recompile the apk for it to access the edited files?
Thanks again.
Boris


Top
 Profile  
 
 Post subject: Re: Data File storage location
Unread postPosted: Sat Oct 01, 2016 11:52 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5442
Location: Paris, France
I am not sure to understand your question, it's confusing.

You will need to recompile the apk if you want to embed the CopyToSd function.

But once it's done, and you use this function to copy your files to sd, then of course your program will always access the files on sd.
So if you edit them, your program will use the edited files (no need to recompile each time you edit the files, if that was your question).

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: Data File storage location
Unread postPosted: Mon Oct 03, 2016 7:57 pm 
Offline

Joined: Fri Sep 30, 2016 9:32 pm
Posts: 3
Thanks, Nicolas
All sorted now - that works fine. :)
Boris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred