Currently I'm learning android development and I am struggling where should I put my data. Since this is just a test. data will not be stored in a webserver
for now I have created an app that accepts text input from the user. The Inputted data by the user is being processed and get compared to a list of data with specific response.
For Example
The user Inputs Hello. The inputted data will be compare to a list of data and if equal it will get the the specific response
data: hi response: hello
data: hello response: hi
data: what's your name response: I'm Ivy
data: how are you response: I'm fine
data: Who are you response: I'm your phone
and many more...
since the user input is hello then the response that I will get is hi.
Now. Where should I put the list of data? I am new to sqlite and still learning about it.
Should I create a table on Sqlite and insert all the data?
Correct me if I'm wrong. What if I have a thousand of data running a thousand sql query may cause a problem when?
Should I do something like?
myDB = this.openOrCreateDatabase("DatabaseName", MODE_PRIVATE, null);
/* Create a Table in the Database. */
myDB.execSQL("CREATE TABLE IF NOT EXISTS "
+ TableName
+ " (Field1 VARCHAR, Field2 INT(3));");
/* Insert data to a Table*/
myDB.execSQL("INSERT INTO "
+ TableName
+ " (Field1, Field2)"
+ " VALUES ('Saranga', 22);");
...
Also I'm using levenshtein to compare string.
How does the sqlite cycle works? does the database get created when the app is run or when the app was installed?