开发者

Notepad tutorial [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago.

This is truly a beginner's question. I installed and successfully ran the notepad tutorials Notepadv1,2,3 and typed in a few notes. Can i import data (manually )from an external text file into the sq lite dbs? I looked in my Notepadv workspace folders but no dbs seem to have been created? I looked for anything with .db extension or named 'data' as specified in the code. Many thanks.


Thanks so much. I just need to figure out how to access /data/data/{PACKAGE_NAME}/databases/{DB_NAME I don;t have the Android device, only the emulator. Do 开发者_运维问答I need CYGWIN with root access or is that the wrong question to ask.


The database is stored on the Android device, you won't see it in your Eclipse workspace.

The general location for any SQLite database is /data/data/{PACKAGE_NAME}/databases/{DB_NAME}.

In this case, /data/data/com.android.demo.notepadN/database/data (where N is which exercise you're building).

Keep in mind that the /data partition is only readable by root. If you don't have root access to your device, you won't be able to view anything in this directory.

If you want to import data, you need to write code that does it when your application is first launched. Alternatively, you could bundle your own SQLite database as an asset, then copy it onto the filesystem at first launch.

See this previous question for more information:
Ship an application with a database


yes, you should be able to import data directly to the db.

the database files should be located under /data/data/com.android.demo.notepad1/database/data

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜