How to update android database when fresh JSON content arieves?

Edmond Tamas

Could someone suggest me a way on how to update my apps SQLite database when the content of the parsed JSON file is changed?

I am having a hard time finding the right solution, now I have to clear the cache before the app starts, but the end user obviously won't do that.

I asume changing the table version is not suitable for frequent updates (hourly).

Thanks!

Zacktamondo

As @KenWolf mentioned this documentation in the comments.

Update a Database:

When you need to modify a subset of your database values, use the update() method.

Updating the table combines the content values syntax of insert() with the where syntax of delete().

SQLiteDatabase db = mDbHelper.getWritableDatabase();

// New value for one column
ContentValues values = new ContentValues();
values.put(FeedEntry.COLUMN_NAME_TITLE, title);

// Which row to update, based on the title
String selection = FeedEntry.COLUMN_NAME_TITLE + " LIKE ?";
String[] selectionArgs = { "MyTitle" };

int count = db.update(
    FeedReaderDbHelper.FeedEntry.TABLE_NAME,
    values,
    selection,
    selectionArgs);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to update android database when fresh JSON content arieves?

From Dev

How can I regularly update a database of content on an Android app?

From Dev

How to deal with multiple database version changes when Android Application update

From Dev

ModX: how to update database without overriding content

From Dev

Error when trying to update database in android sqlite

From Dev

Error when trying to update database in android sqlite

From Dev

Error when trying to update sqlite database in android

From Dev

Muzei database doesn't update when I update external JSON

From Dev

Django: how to get a fresh connection to the database

From Dev

Android SQLite Database update table when update app

From Dev

How to update QTableView when database updated?

From Dev

How to update a MySQL Database with UITextField content in Xcode 5?

From Dev

How to update SQLite database in fragment? Android

From Dev

how to update new row in android sqlite database

From Dev

How to update database table in android sqlite..?

From Dev

How to recreate a database on an Android Application Update?

From Dev

how to update data in existing sqlite database in android

From Dev

Load more from database not working when changing content type to JSON

From Dev

Errors when trying to update a fresh debian 10.5 KDE installation

From Dev

How to increment variable on click and update content from JSON?

From Dev

How to update viewpager fregment content when viewpager swipe in MainActivity

From Dev

Update local Android database

From Dev

Android database update records

From Dev

How to update a fresh installation of Windows XP SP2 in 2016

From Dev

How to fix hash sum mismatch error on fresh docker image update?

From Dev

How to restore PostgreSQL database to initial state as it was after fresh install

From Dev

How to restore PostgreSQL database to initial state as it was after fresh install

From Dev

Content type mismatch when sending json request from Android to Laravel

From Dev

how to update the content in the UIlabel

Related Related

  1. 1

    How to update android database when fresh JSON content arieves?

  2. 2

    How can I regularly update a database of content on an Android app?

  3. 3

    How to deal with multiple database version changes when Android Application update

  4. 4

    ModX: how to update database without overriding content

  5. 5

    Error when trying to update database in android sqlite

  6. 6

    Error when trying to update database in android sqlite

  7. 7

    Error when trying to update sqlite database in android

  8. 8

    Muzei database doesn't update when I update external JSON

  9. 9

    Django: how to get a fresh connection to the database

  10. 10

    Android SQLite Database update table when update app

  11. 11

    How to update QTableView when database updated?

  12. 12

    How to update a MySQL Database with UITextField content in Xcode 5?

  13. 13

    How to update SQLite database in fragment? Android

  14. 14

    how to update new row in android sqlite database

  15. 15

    How to update database table in android sqlite..?

  16. 16

    How to recreate a database on an Android Application Update?

  17. 17

    how to update data in existing sqlite database in android

  18. 18

    Load more from database not working when changing content type to JSON

  19. 19

    Errors when trying to update a fresh debian 10.5 KDE installation

  20. 20

    How to increment variable on click and update content from JSON?

  21. 21

    How to update viewpager fregment content when viewpager swipe in MainActivity

  22. 22

    Update local Android database

  23. 23

    Android database update records

  24. 24

    How to update a fresh installation of Windows XP SP2 in 2016

  25. 25

    How to fix hash sum mismatch error on fresh docker image update?

  26. 26

    How to restore PostgreSQL database to initial state as it was after fresh install

  27. 27

    How to restore PostgreSQL database to initial state as it was after fresh install

  28. 28

    Content type mismatch when sending json request from Android to Laravel

  29. 29

    how to update the content in the UIlabel

HotTag

Archive