Extract database from DocumentsDirectory to computer

Hello,

I’ve created a questionnaire app and now have a .db in my system.DocumentsDirectory on Android.

I think I may have saved this to the wrong location as I don’t think I can access this through my computer (typical USB connection)… Correct me if that’s wrong and save me a bit of effort :wink:

However I still need to extract this data. What’s the best way to do this?

At the moment the best I have is create a new application with the same details (name, etc) so it replaces the old one. The new app will copy the database to a retrievable location or simply display it on the screen so I can manually get the data. Is this possible?

Will overwriting the app remove the .db file from the system.DocumentsDirectory?

Thanks for reading and helping out

Andy

Unless you have rooted your device, you cannot access your documents directory.  If your users are going to be filling this out, you should set up a web server that has access to an online database and perhaps use a language like PHP. 

Overwriting the app typically does not effect data to system.DocumentsDirectory nor will updates from Google Play.  If you remove the application then system.DocumentsDirectory will be destroyed.

Rob

Thanks for getting back to me Rob

It was a very quick and dirty app, I installed a new version which prints the data and got me what I needed.

I’ll now have to look at a proper solution, so thanks for the extra advice :slight_smile:

Andy

If it’s for testing purproses, then a quick-and-dirty solution is to e-mail it to yourself via our native.showPopup(“mail”) function.  You can make your database file an attachment, assuming that’s its not a super huge file of course.

   https://docs.coronalabs.com/api/library/native/showPopup.html#email-popup-with-one-file-attachment

Thanks Josh. I think that might be pretty useful in this case.

I made the app in haste for a recent event, and there is another soon so quick-and-dirty is definitely key

Unless you have rooted your device, you cannot access your documents directory.  If your users are going to be filling this out, you should set up a web server that has access to an online database and perhaps use a language like PHP. 

Overwriting the app typically does not effect data to system.DocumentsDirectory nor will updates from Google Play.  If you remove the application then system.DocumentsDirectory will be destroyed.

Rob

Thanks for getting back to me Rob

It was a very quick and dirty app, I installed a new version which prints the data and got me what I needed.

I’ll now have to look at a proper solution, so thanks for the extra advice :slight_smile:

Andy

If it’s for testing purproses, then a quick-and-dirty solution is to e-mail it to yourself via our native.showPopup(“mail”) function.  You can make your database file an attachment, assuming that’s its not a super huge file of course.

   https://docs.coronalabs.com/api/library/native/showPopup.html#email-popup-with-one-file-attachment

Thanks Josh. I think that might be pretty useful in this case.

I made the app in haste for a recent event, and there is another soon so quick-and-dirty is definitely key