Reputation: 189
In my application, I have some static data that I want to display in one screen. So I imported the data to a database and added that to the SD card. Now the app is working fine on the simulator. But when I created the cod/alx file and installed the app to the device, the db is missing. Can anyone suggest the way to include this db inside the application?
Upvotes: 2
Views: 806
Reputation: 28418
Include the db file in the project resources. Then in run time extract it from resources and save to SDCard.
To extract a resource use Class.getResourceAsStream(String name) method.
A starting point in saving files on BB could be this guide: Code sample: Writing text to a file.
Upvotes: 2