dimanche 3 janvier 2016

ActiveAndroid using exist database

I am using ActiveAndroid as a third party library in order to working with sqlite database in android, i don't have any problem with creating and using new databases with this library, but i don't know how can i use my own exist database with this library?i want to put my own database into assets folder and load it into ActiveAndroid library.

public class Application extends com.activeandroid.app.Application
{

    @Override
    public void onCreate()
    {
        super.onCreate();
        createDatabase();
    }

    private void createDatabase()
    {
        Configuration dbConfiguration = new Configuration.Builder(this).setDatabaseName("dastan.db").create();
        ActiveAndroid.initialize(dbConfiguration);

    }


    @Override
    public void onLowMemory()
    {
        android.os.Process.killProcess(android.os.Process.myPid());
        super.onLowMemory();
    }
}

Aucun commentaire:

Enregistrer un commentaire