Android CBL Manager with supporting SDCard(external SDCard)

30 views
Skip to first unread message

PRASANNA KUMAR

unread,
Jan 25, 2016, 9:33:37 AM1/25/16
to Couchbase Mobile
Hi All,

I would like to support my android application with store the Couch base lite databases in external SDCard due to phone memory is very less(may be 8gb or 16 gb) that is not enough to my application. I have tried to create CBLManger object in external SDCard.

public class Application extends android.app.Application {
    private Manager manager;
    private static Context mContext;
    
    ...
    
    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        try {
            /*
             * In Java the Manager instance and all the objects descending
             * from it may be used on any thread.
             */
            manager = new Manager(new AndroidContext(mContext), Manager.DEFAULT_OPTIONS);
        } catch (IOException e) {
            Log.e(TAG, "Cannot create Manager instance", e);
            return;
        }
    }
}

I am using latest version 1.1, Where by default it is taking phone memory only. How we can achieve this feature and how to create Manager class(Constructor) instance  for using external SDCard options

Thank You,
Prasanna Kumar

Hideki Itakura

unread,
Jan 26, 2016, 12:32:42 PM1/26/16
to Couchbase Mobile
Reply all
Reply to author
Forward
0 new messages