I created a SQLite database, I want to refer to the parameters. If I used to access them like this:

name.setText(product.getName()); 

Now, with the help of the cursor, I can refer to the values ​​of the database in this way:

 Сursor cursor = db.query("PRODUCTS", new String[] {"NAME", "DESCRIPTION"}, null, null, null); 

But it works if I myself have entered the values ​​in the database. And what if I get these values ​​from the API (via retrofit)? How to be then in this case?

  • DB on the server? - pavlofff
  • Something is not very clear where the difficulties. If the database on the server, then make a request and insert the data. Or download all the data to the local database and then make a request and get the cursor - pavel163
  • @pavlofff did not quite correctly put it right, updated the question. DB itself created in my application. - Inkognito
  • @ pavel163 I get the data from the API I want to put it in the local database, then to work with their data later. - Inkognito

0