Reputation: 127
I am making a water meter reading system and I will use a phone to record the data. I then have to transfer that data into a windows based application to store, process, and print. I cannot do it via net thats why I didnt use android to web based. What can I do to migrate the data?
Upvotes: 0
Views: 45
Reputation: 57043
Assuming that you can access the data from the PC, then you have two options.
You can copy the database to a location that is accessible via the PC and then use an SQLite Tool or a custom program on the PC to extract the required data.
Alternately you could extract the required data using SQLite on the phone and then save that as a file in a location that is accessible by the PC.
The App saves (for backup purposes) to a folder (ShopWise) within the downloads folder (as this folder is widely accessible outside of the App) e.g. using the following to determine the location :-
File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),subdirectory);
this.directory = dir.getPath();
The backups can then be accessed on a PC via USB using Android studio's device explorer (requires developer options to be turned on and that usb debugging is enabled) e.g. :-
Alternately on another device with usb debugging turned off I can connect via USB and browse the files from the PC e.g. :-
Using an SQLite tool (DB Browser for SQLite in this case, although there are a number of other tools available) I can then use the database e.g.
Upvotes: 1