Skip to content

contentstack/contentstack-android-persistence

Repository files navigation

Contentstack

Contentstack Android Persistence Library

Contentstack provides Android Persistence Library that lets your application store data on the device's local storage. This helps you build apps that can work offline too. Given below is a detailed guide and helpful resources to get started with our android Persistence Library.

Prerequisites

Setup and Initialize library

For Realm

You download below four files from Repository and keep it in your src folder.

  • RealmStore * SyncManager * SyncPersistable
  • SyncStore

Initialize the library

To start using the library in your application, you will need to initialize it by providing the stack details:

  Stack stack = Contentstack.stack(context, "apiKey", "accessToken", "environment");  
      
  //Provide realmInstance using   
  Realm realmInstance = Realm.getDefaultInstance();  
  //Provide realmInstance to RealmStore's constructor like below.  
  RealmStore realmStore = new RealmStore(realmInstance);  
      
  SyncManager manager = new SyncManager(realmStore, stack);  
  manager.stackRequest();  
   

We have created an example app using android Persistence Library that stores data on the device's local storage. Read the tutorial to get started with the example app.

Helpful Links

About

Android persistence library to save app data on device's local storage

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages