質問

I'm creating an Android app that will download XML data from my website, parsed xml data will be inserted into 5 separate SQL Lite tables. I have successfully logged into my website, got the XML data & parsed. I not sure how to layout the database code for multiple tables(opening, closing, inserting, selecting).

Also I would like (is this possible) these tables to stay on the device if the user needs to logout and come back to the app at a later time.

Any help or direction would be appreciated.

Thanks

役に立ちましたか?

解決

Question title says "multiple databases", body says "multiple tables". I take it to mean "multiple tables".

Just use SQLiteOpenHelper. Create all the tables in onCreate(). Do the opening/closing and CRUD operations the same way you would do on a SQLiteOpenHelper hosting a single table.

Use a search engine to find tutorials about SQLiteOpenHelper in case you need them.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top