-
-
Notifications
You must be signed in to change notification settings - Fork 58
SQLite2XL v1.0.1
AndroidMad / Mushtaq M A edited this page Apr 14, 2017
·
1 revision
- Added Functionality to Import Excel into SQLite Database.
- Added Functionality to Export Blob into Image.
- Added Functionality to Export List of tables specified.
add the following library in your app level gradle file
compile 'com.ajts.androidmads.SQLite2Excel:library:1.0.1'
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
SqliteToExcel sqliteToExcel = new SqliteToExcel(this, "helloworld.db");
SqliteToExcel sqliteToExcel = new SqliteToExcel(this, "helloworld.db", directory_path);
sqliteToExcel.exportSingleTable("table1", "table1.xls", new SQLiteToExcel.ExportListener() {
@Override
public void onStart() {
}
@Override
public void onCompleted(String filePath) {
}
@Override
public void onError(Exception e) {
}
});
sqliteToExcel.exportSpecificTables(tablesList, "table1.xls", new SQLiteToExcel.ExportListener() {
@Override
public void onStart() {
}
@Override
public void onCompleted(String filePath) {
}
@Override
public void onError(Exception e) {
}
});
sqliteToExcel.exportAllTables("table1.xls", new SQLiteToExcel.ExportListener() {
@Override
public void onStart() {
}
@Override
public void onCompleted(String filePath) {
}
@Override
public void onError(Exception e) {
}
});
The following snippet is used to initialize the library for Importing Excel
ExcelToSQLite excelToSQLite = new ExcelToSQLite(getApplicationContext(), "helloworld.db");
excelToSQLite.importFromAsset("assetFileName.xls", new ExcelToSQLite.ImportListener() {
@Override
public void onStart() {
}
@Override
public void onCompleted(String dbName) {
}
@Override
public void onError(Exception e) {
}
});
excelToSQLite.importFromAsset(directory_path, new ExcelToSQLite.ImportListener() {
@Override
public void onStart() {
}
@Override
public void onCompleted(String dbName) {
}
@Override
public void onError(Exception e) {
}
});
Library wrapped by Mushtaq.M.A/Androidmads