Alpha
Alpha

Reputation: 127

Migrate data from android app to standalone windows based application

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

Answers (1)

MikeT
MikeT

Reputation: 57043

Assuming that you can access the data from the PC, then you have two options.

  1. 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.

  2. 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.

Example - An overview of using 1

  • Option 2 would basically be the same other than how the file itself is created and then used.

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. :-

enter image description here

Alternately on another device with usb debugging turned off I can connect via USB and browse the files from the PC e.g. :-

enter image description here

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.

enter image description here

Upvotes: 1

Related Questions