Ionic - Create SQLite database in different directory in android


#1

Hi, I need to create SQLite database in different directory in android…Title is copied from https://stackoverflow.com/questions/51374148/ionic-create-sqlite-database-in-different-directory-in-android

import { SQLite, SQLiteObject } from '@ionic-native/sqlite';
import { File } from '@ionic-native/file';


if(this.platform.is('android')){
    this.sqlite.create({
      name: 'ionicdb.db',
      //location: 'default',
      location:this.file.externalDataDirectory,
    }).then((db: SQLiteObject) => {
      ......
      ......
});
}

But I’m getting the same error as specified in above link(Error: Valid iOS database location could not be determined in openDatabase call).

Do anyone have solution for this?..