Search code examples
sqlitexamarinmobilerealm

Moving from SQLte to Realm


I have a working app that uses SQLite as DB. I would like to move to Realm DB. Will this affect my existing users? How do I move over to Realm? My app is developed in Xamarin.


Solution

  • When you have created your schema, you need to iterate your sql values and add data in realm, for example(you need convert java to C#):

    for (SqlTest sqlData : sqlTest) {
        Test test1 = realm.createObject(Test.class, UUID.randomUUID());
        test1.setName(sqlData.getName());
        test1.setSex(sqlData.getSex());
    }