Introduction: This small Library Helps you to export db , export to csv and import db also work with Room db
More: Author   ReportBugs   

This library Helps you to Export Db to sdcard or also import form it and also share db to csv to sdcard.


alt Setting IMages1


  • Android 18.
  • Permission for excess of external storage.


Step 1:- Add it in your root build.gradle at the end of repositories:

allprojects {
        repositories {
            maven { url 'https://jitpack.io' }

Step 1:- Add the dependency:

        dependencies {
             implementation 'com.github.prabhat1707:DbExporterHelper:v1.0'

Option 1:- Export db to external directory

First check the storage Permission then initilize it.

 ExportDbUtil exportDbUtil = new ExportDbUtil(this, db name, directory_name, this);
 db_path = "/data/com.example.android.databaseexpoter/databases/"

Option 2: Export all table to Csv

 csv_filename = "test.csv"

Option 3: Export single table to csv


Option 4:Import db from external storage to internal

 db_path = "/data/com.example.android.databaseexpoter/databases/"

 if (exportDbUtil.isBackupExist(directory_name)) {
        } else {
            Toast.makeText(this, "no Backup", Toast.LENGTH_SHORT).show();


CallBack Method are optional, "implements ExporterListener"

    public void success(@NotNull String s) {
        Toast.makeText(this, s, Toast.LENGTH_SHORT).show();

    public void fail(@NotNull String message, @NotNull String exception) {
        Toast.makeText(this, message, Toast.LENGTH_SHORT).show();

For Any Query Mail me to "prabhat.rai1707@gmail.com"



```` Copyright (c) delight.im prabhat.rai1707@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at


Unless required by applicable la w or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Support Me
About Me
Google+: Trinea trinea
GitHub: Trinea