2017年4月27日 星期四

[Android][SQLite] Generate the Database for your APP

While we develop a Android APP, we may need to prepare the existed Database to read/search the data.  
Here is an example to show you how to generate the Database.

Step1. Using Excel to prepare your data and save this file to "*.csv." In this example, the file name is "TBS_DL.csv".  For searching the data easily, your table should have the "_id" column which increases
the number progressively.
 

Step2. Google the keyword "firefox sqlite manager" and install "SQLite Manager" to the Firefox browser.



Step3. After you install "SQLite Manager", you will see it in your Firefox toolbar.


Step4. Using "SQLite Manager" to generate the New Database and save it to your folder.





Step5. Import "TBS_DL.csv".



Step6.
Modify the properties to meet your requirement. Here is our example for your reference.

 
Step7. If everything is OK. You will see "TBS_DL" table and its data.


Step8. Now, there is a file "TBS_DL.sqlite" in your folder.


Step9.
Close
"SQLite Manager" and rename "TBS_DL.sqlite" to the new file name "TBS_DL.db".
Now, you can use
"TBS_DL.db" for your Android APP.






沒有留言:

張貼留言