mardi 15 décembre 2015

How to maintain sqlite database across multiple devices and update records without updating app in play store

I am new to android and trying to create a SQLite database to store some read only data and I am unable to understand a few things about it.

  1. Since an SQLite is a server less database how can we maintain (or keep in sync) data across multiple database.For example in case of signup if a user creates a new account the database will be updated locally only on that user particular device.Thus each device will have only its own signup information(Correct me if I am wrong) in its database.So how will I be able to keep all this database from different devices in sync with each other.

  2. If I want to add a new record to the database how I am supposed to do it without updating the app itself.For eg I want to add a image to the database and text to database and make it avalaiable to all users without giving app update in play store.

  3. I have a code in which a cardlayout is used to hold multiple countdown timers.The data to this card layout is passed as follows.

    public void intitializData()
    {
    
    
    info = new ArrayList<>();
    {
        info.add(new information(2015, 12-1, 20, 13, 12));
        info.add(new information(2017, 12-1, 20, 13, 12));
        info.add(new information(2018, 12-1, 20, 13, 12));
        info.add(new information(2019, 12-1, 20, 13, 12));
        info.add(new information(2020, 12-1, 20, 13, 12));
     }
     }
    
    

Now I want to load this data from database.This might be done as follows

       for(int i=1;i<maximum elements in database;i++)
       {
          int a,b,c,d,e   //load all these values from database

          info.add(new information(a, b - 1, c, d, e));  //year,month,day,hour,minutes
       }

Also I will add or update existing record without updating app.So is using SQLite appropriate to use in this case.If not please specify the right approach for this.

Aucun commentaire:

Enregistrer un commentaire