11# SQLiteToExcel
2- This is a Light weight Library to Convert SQLite Database to Excel
3-
4- This is a library wrapped as Gradle used for Android from the following Link
5- [ SQLiteToExcel] ( https://github.com/li-yu/SQLiteToExcel )
2+ This is a Light weight Library to Convert SQLite Database to Excel and Convert Excel to SQLite.
63
74## Featured In
85[ ![ Android Arsenal] ( https://img.shields.io/badge/Android%20Arsenal-SQLite%20To%20Excel-brightgreen.svg?style=flat )] ( https://android-arsenal.com/details/1/5221 )
96
7+ ## Sample App
8+ The sample app in the repository is available on Google Play:
9+
10+ <a href =' https://play.google.com/store/apps/details?id=com.ajts.androidmads.sqlite2xlDemo&utm_source=AndroidMads&utm_campaign=AndroidMads&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1 ' ><img alt =' Get it on Google Play ' src =' https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png ' /></a >
11+
12+ ## Features
13+ 1 . Added Functionality to Import Excel into SQLite Database.
14+ 2 . Added Functionality to Export Blob into Image.
15+ 3 . Added Functionality to Export List of tables specified.
1016## How to Download
1117add the following library in your app level gradle file
1218``` groovy
13- compile 'com.ajts.androidmads.SQLite2Excel:library:1.0.0 '
19+ compile 'com.ajts.androidmads.SQLite2Excel:library:1.0.1 '
1420```
1521## How to Use
16- ### The steps to use this Library
17- #### 1.AndroidManifest.xml
22+ #### The steps to use this Library
1823``` xml
1924<uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
2025```
21- #### 2.Library Initialization
26+ ## Export SQLite to Excel
2227##### This line is used to save the exported file in default location.
2328``` java
2429SqliteToExcel sqliteToExcel = new SqliteToExcel (this , " helloworld.db" );
@@ -27,47 +32,111 @@ SqliteToExcel sqliteToExcel = new SqliteToExcel(this, "helloworld.db");
2732``` java
2833SqliteToExcel sqliteToExcel = new SqliteToExcel (this , " helloworld.db" , directory_path);
2934```
30- #### 3.Export DB to Excel
3135##### This code snippet is used to Export a single table in a database to Excel Sheet
3236``` java
33- sqliteToExcel. startExportSingleTable(" table1" , " table1.xls" , new ExportListener () {
34-
37+ sqliteToExcel. exportSingleTable(" table1" , " table1.xls" , new SQLiteToExcel .ExportListener () {
38+ @Override
39+ public void onStart () {
40+
41+ }
42+ @Override
43+ public void onCompleted (String filePath ) {
44+
45+ }
46+ @Override
47+ public void onError (Exception e ) {
48+
49+ }
50+ });
51+ ```
52+ ##### This following code snippet is used to Export a list of table in a database to Excel Sheet
53+ ``` java
54+ sqliteToExcel. exportSpecificTables(tablesList, " table1.xls" , new SQLiteToExcel .ExportListener () {
55+ @Override
56+ public void onStart () {
57+
58+ }
59+ @Override
60+ public void onCompleted (String filePath ) {
61+
62+ }
63+ @Override
64+ public void onError (Exception e ) {
65+
66+ }
67+ });
68+ ```
69+ ##### This code snippet is used to Export a every table in a database to Excel Sheet
70+ ``` java
71+ sqliteToExcel. exportAllTables(" table1.xls" , new SQLiteToExcel .ExportListener () {
72+ @Override
73+ public void onStart () {
74+
75+ }
76+ @Override
77+ public void onCompleted (String filePath ) {
78+
79+ }
80+ @Override
81+ public void onError (Exception e ) {
82+
83+ }
84+ });
85+ ```
86+ ## Import Excel into Database
87+ The following snippet is used to initialize the library for Importing Excel
88+ ``` java
89+ ExcelToSQLite excelToSQLite = new ExcelToSQLite (getApplicationContext(), " helloworld.db" );
90+ ```
91+ ##### The following code is used to Import Excel from Assets
92+ ``` java
93+ excelToSQLite. importFromAsset(" assetFileName.xls" , new ExcelToSQLite .ImportListener () {
3594 @Override
3695 public void onStart () {
37-
96+
3897 }
39-
98+
4099 @Override
41- public void onError ( ) {
42-
100+ public void onCompleted ( String dbName ) {
101+
43102 }
44-
103+
45104 @Override
46- public void onComplete ( ) {
47-
105+ public void onError ( Exception e ) {
106+
48107 }
49108});
50109```
51- ##### This code snippet is used to Export a every table in a database to Excel Sheet
110+ ##### The following code is used to Import Excel from user directory
52111``` java
53- sqliteToExcel. startExportAllTables(" helloworlddb.xls" , new ExportListener () {
54-
112+ excelToSQLite. importFromAsset(directory_path, new ExcelToSQLite .ImportListener () {
55113 @Override
56114 public void onStart () {
57-
115+
58116 }
59-
117+
60118 @Override
61- public void onError ( ) {
62-
119+ public void onCompleted ( String dbName ) {
120+
63121 }
64-
122+
65123 @Override
66- public void onComplete ( ) {
67-
124+ public void onError ( Exception e ) {
125+
68126 }
69127});
70128```
129+ ## Using SQLite2XL
130+ [ Mail
] ( mailto:[email protected] ) me with your Google Play URL and I'll add your app to the list :)
131+
132+ Icon | App
133+ ------------ | -------------
134+ <img src =" https://lh3.googleusercontent.com/BlBW0j3sSNC8x_SzPIolZ6cdUIUKmM9XNN_m3eZc-ytalqjXZvSMK7fXeu6E8riOmA=w300-rw " width =" 48 " height =" 48 " /> | [ Invoicer] ( https://play.google.com/store/apps/details?id=com.ajts.invoicer&hl=en ) |
135+
136+ Wiki
137+ ---------------------
138+ Please visit the [ wiki] ( https://github.com/androidmads/SQLite2XL/wiki ) for a complete guide on SQLite2XL.
139+
71140## License
72141<pre >
73142MIT License
0 commit comments