codenameone

Save SQLite Database to Phone Internal Storage


I am trying to save a SQLite Database in phone internal storage same way WhatsApp does it in Android device by creating folder and saving Database there. How can this be achieved in Codename One App?


Solution

  • Make sure the database is closed and not active. Use getDatabasePath to get the file URL to the location of the database.

    You can then copy the content of that file to any place you desire.