android - SharedPreferences used for my Database -


I am trying to create an application that receives GPS data from a KML file via DDMS; SQLite Database My main problem is that every time I run the application, when I store the same GPS data in the database, then there is a big disturbance in my database. Now someone said that I store a shared primary key I can use to do that tells me that the database already exists, assuming that the database exists, is already complete. The problem is that I use a Skywit browser to create my own databases and tablets and I use my code to add the information to the tab. So just to verify that the table does not exist, I have a lot of help Please. Does anybody have any idea how I can manage SQLite database so I do not store the same data twice?

There are many possible solutions

1) Check that the data is already in the new data Is present before inserting (a simple selection statement)

2) Use SQLiteOpe NHelper - This database provides a function for version management

3) In the shared references Save information about what has been added. You can have a version code or something like this to distinguish between different states of the database.

I think that you use either 1 or 2 depending on what you really want to achieve. Perhaps you can be a bit more specific why data is entered multiple times at this time, what type of data is it (static or dynamically created, web service, etc?)

Comments