简体   繁体   中英

Using same SQLitedatabase data with any device in application

I tried installing my application to a 2nd Android device and it's not uploading the same database from my original device.For example on the original device I registered a Username into my database and then on the 2nd device I registered a username and the first Username I registered does not show up in the Admin activity I made that shows a list of registered users.

I thought it might of been the fact that the 2nd device I'm using is a Gingerbread version 2.3.4 while my first device is a Jelly Bean 4.2 but I used an emulator using Jelly Bean 4.2 and it wasn't showing the registered usernames of devices 1 and 2.

Is there a way I could make multiple devices share the same database in my application?

Forgot to include that the 2nd device is registered to a different google account if that makes a different.

Local data cannot arbitrarily be shared between devices. If you want to share the same data, you will need a server to act as a middleman.

In such a scenario, each device will have a local database, which will be synced with your server. So whenever a change is made on the device, a corresponding change is made on the server, and the other device then reads the updated database from the server and updates its own local copy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM