@Override
  public void onCreate() {

    super.onCreate();

    RealmConfiguration config =
        new RealmConfiguration.Builder(this).deleteRealmIfMigrationNeeded().build();
    Realm.setDefaultConfiguration(config);
  }
Exemplo n.º 2
0
 private void setupRealm() {
   RealmConfiguration config =
       new RealmConfiguration.Builder(this)
           .name("dadosbrasil.realm")
           .deleteRealmIfMigrationNeeded()
           .schemaVersion(1)
           .migration(new Migration())
           .build();
   Realm.setDefaultConfiguration(config);
 }
 public LocalDailyCacheManagerImpl(Context context) {
   RealmConfiguration config =
       new RealmConfiguration.Builder(context)
           .name("org.theotech.ceaselessandroid")
           .schemaVersion(0)
           .deleteRealmIfMigrationNeeded()
           .build();
   Realm.setDefaultConfiguration(config);
   this.realm = Realm.getDefaultInstance();
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    rootView = container.getRootView();

    mContext = getContext();

    Realm.setDefaultConfiguration(MainActivity.mRealmConfig);
    try {
      mRealm = Realm.getDefaultInstance();
    } catch (RealmMigrationNeededException e) {
      MainActivity.mRealmConfig =
          new RealmConfiguration.Builder(getActivity()).deleteRealmIfMigrationNeeded().build();
      Realm.setDefaultConfiguration(MainActivity.mRealmConfig);
      mRealm = Realm.getDefaultInstance();
    }

    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.fragment_number_group, container, false);
  }
Exemplo n.º 5
0
  @Override
  public void onCreate() {
    super.onCreate();

    RealmConfiguration realmConfiguration =
        new RealmConfiguration.Builder(this)
            .name("realm-students.realm")
            .deleteRealmIfMigrationNeeded()
            .build();

    Realm.setDefaultConfiguration(realmConfiguration);
  }
Exemplo n.º 6
0
  private void initRealm() {
    RealmConfiguration realmConfiguration =
        new RealmConfiguration.Builder(getApplicationContext())
            .name(getString(R.string.db_name))
            .schemaVersion(getResources().getInteger(R.integer.db_version))
            .build();
    Realm.setDefaultConfiguration(realmConfiguration);

    Realm realm = Realm.getDefaultInstance();
    GroupRepository.createDefaultGroups(realm);
    realm.close();
  }
Exemplo n.º 7
0
  @Override
  public void onCreate() {
    super.onCreate();
    mContext = getApplicationContext();
    AVOSCloud.initialize(this, "sTcSMqHmJTh84xK1kho06ry5-gzGzoHsz", "SKJ69RQ0AUaaNcs2rxtxSOQV");
    RealmConfiguration myConfig =
        new RealmConfiguration.Builder(getContext())
            .name("myRealm")
            .schemaVersion(2)
            //                .setModules(new MyCustomSchema())
            .build();

    Realm.setDefaultConfiguration(myConfig);
  }
  @Override
  public void onCreate() {
    super.onCreate();
    //        Fabric.with(this, new Crashlytics());
    sContext = this;

    Stetho.initialize(
        Stetho.newInitializerBuilder(this)
            .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
            .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
            .build());

    RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
    Realm.setDefaultConfiguration(realmConfiguration);
  }
  @SuppressWarnings("ButterKnifeInjectNotCalled")
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mContext = this;

    ArrayList<ContentItem> objects = new ArrayList<>();
    objects.add(
        new ContentItem(getString(R.string.realm_ci_0_name), getString(R.string.realm_ci_0_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_1_name), getString(R.string.realm_ci_1_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_2_name), getString(R.string.realm_ci_2_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_3_name), getString(R.string.realm_ci_3_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_4_name), getString(R.string.realm_ci_4_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_5_name), getString(R.string.realm_ci_5_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_6_name), getString(R.string.realm_ci_6_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_7_name), getString(R.string.realm_ci_7_desc)));
    objects.add(
        new ContentItem(getString(R.string.realm_ci_8_name), getString(R.string.realm_ci_8_desc)));
    MyAdapter adapter = new MyAdapter(this, objects);
    lv.setAdapter(adapter);
    View footer = LayoutInflater.from(this).inflate(R.layout.tip_end, null);
    lv.addFooterView(footer);

    Realm.init(this);
    // Create a RealmConfiguration that saves the Realm file in the app's "files" directory.
    RealmConfiguration realmConfig = new RealmConfiguration.Builder().build();
    Realm.setDefaultConfiguration(realmConfig);

    Realm realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    realm.deleteAll();
    realm.commitTransaction();
  }
Exemplo n.º 10
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);

    RealmConfiguration realmConfig = new RealmConfiguration.Builder(this).build();
    Realm.deleteRealm(realmConfig); // Remember to remove
    Realm.setDefaultConfiguration(realmConfig);
    realm = Realm.getInstance(realmConfig); // DO NOT TOUCH!!! if you want realm to work...

    drawerFragment =
        (FragmentDrawer)
            getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
    drawerFragment.setUp(
        R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), toolbar);
    drawerFragment.setDrawerListener(this);

    // display the first navigation drawer view on app launch
    displayView(0);
  }
Exemplo n.º 11
0
 @Override
 public void onCreate() {
   super.onCreate();
   RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
   Realm.setDefaultConfiguration(realmConfiguration);
 }
 @Override
 public void onCreate() {
   super.onCreate();
   RealmConfiguration config = new RealmConfiguration.Builder(getApplicationContext()).build();
   Realm.setDefaultConfiguration(config);
 }