# Export database Android

**URL:** <https://discuss.zetetic.net/t/export-database-android/2092>\
**Category:** SQLCipher\
**Created:** [April 12, 2017, 9:07pm UTC](https://discuss.zetetic.net/t/export-database-android/2092 "2017-04-12T21:07:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Conti](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Christian\_Conti](https://discuss.zetetic.net/u/Christian_Conti)\
**Post date:** [April 12, 2017, 9:07pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/1 "2017-04-12T21:07:15Z")

</div>

Hello, I would like to know if I can use only sqlcipher to export the file.  
then use the normal sqlite inside the app and encrypt the files with cipher only for export. Thank you

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [April 12, 2017, 9:48pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/2 "2017-04-12T21:48:14Z")

</div>

Hello @Christian_Conti

You can use SQLCipher for Android to operate on both SQLCipher encrypted databases, and plain-text SQLite databases. We have a convenience function called `sqlcipher_export(…)` that will allow for various conversions. You can read more about that in our documentation [here](https://www.zetetic.net/sqlcipher/sqlcipher-api/#sqlcipher_export).

---

<div class="post-metadata">

**Author:** ![Christian\_Conti](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Christian\_Conti](https://discuss.zetetic.net/u/Christian_Conti)\
**Post date:** [April 13, 2017, 3:21pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/3 "2017-04-13T15:21:34Z")

</div>

thanks for your quick response. I can also do the reverse? import sqlcipher in sqlite?

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [April 13, 2017, 3:27pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/4 "2017-04-13T15:27:55Z")

</div>

Hello @Christian_Conti

Yes, you can both import a plain-text SQLite database and encrypt it, or you can export an encrypted SQLCipher database to a plain-text SQLite database.

---

<div class="post-metadata">

**Author:** ![Christian\_Conti](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Christian\_Conti](https://discuss.zetetic.net/u/Christian_Conti)\
**Post date:** [April 13, 2017, 5:28pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/5 "2017-04-13T17:28:53Z")

</div>

thank you, one last thing, I would just use the classes necessary to encrypt and decrypt the SQLite database, for the lighter application. Can you tell me what classes should I take?

Currently in my app I entered this dependence:  
compile ‘net.zetetic:android-database-sqlcipher:3.5.6@aar’

Thank you

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [April 13, 2017, 6:44pm UTC](https://discuss.zetetic.net/t/export-database-android/2092/6 "2017-04-13T18:44:39Z")

</div>

Hello @Christian_Conti

Aside from the SQLCipher API [documentation](https://www.zetetic.net/sqlcipher/sqlcipher-api/), you might consider reviewing the test cases within the SQLCipher for Android [test suite](https://github.com/sqlcipher/sqlcipher-android-tests) for various usage examples.
