Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
1 answer
33 views

How do I accomplish inline .puts when using ContentValues class?

There are many classes where I can do what I call inline method calls. I want to be able to do this with the SQLite database class ContentValues. Right now I am doing it this way. ContentValues cv = ...
llihttocs's user avatar
  • 2,021
0 votes
1 answer
498 views

Are there alternative azurerm_api_management_api content_value paths?

I am trying to create a new Azure API using the Terraform module azurerm_api_management_api. An example of the snippet of code I'm using is as below. resource "azurerm_api_management_api" &...
hitman126's user avatar
  • 969
-1 votes
1 answer
28 views

How can I connect two tables in SQL depending on the data?

It's quite simple problem but I am begginer and i have problems with it. I have 2 tables in database matches id, team1id, team2id, score, date teams id, name If I want to select team1 name, team2 ...
gmuru's user avatar
  • 1
0 votes
1 answer
458 views

Android Studio: ContentValues vs Database.execSQL()

My question can be considered as a continuation of What is the difference between inserting data using ContentValues and Raw SQL in SQLite Android? My question is more towards: Which is more common ...
user avatar
0 votes
0 answers
287 views

Trying to copy image one folder to another folder using contentResolver in android 11 but it create blank image

i m working on an application where i have list of images inside recyclerview and from recyclerview i have to copy my images from one folder to another folder my code is working fine in many android ...
patel jignesh's user avatar
0 votes
0 answers
1k views

Share video to WhatsApp and other apps using Android Intent (Java)

I want to implement share video to whatsApp and other app feature using Android Intent system. I have been looking for it for last 2 days but I did not get proper solution and some solutions I found ...
Abhay's user avatar
  • 101
0 votes
1 answer
388 views

Room Insert ContentValues by using SqLiteOpenHelper methods

I am using Room to manage SQLite databasae in my app. The thing is that I am migrating a project, in which I download some data from a private webservice and finally I am receiving a ContentValues ...
mantc_sdr's user avatar
  • 491
0 votes
1 answer
1k views

MediaStore: After updating the file which is created by my app it cannot be deleted easily

Next code for deleting a file which my app owns works ok, there is no exception RecoverableSecurityException because the file was created by my app (using ContentResolver.insert(...) method) ...
user924's user avatar
  • 12.9k
2 votes
1 answer
3k views

Creating a contact and sharing it as v-card/vcf file programmatically in android kotlin

I have data of contact locally in the app, I want to create a contact object and share it as v-card or vcf file to other phone using whatsapp, facebook etc. Most of the solutions are based on getting ...
Mobile Developer iOS Android's user avatar
0 votes
1 answer
2k views

How to insert values with Foreign KEY in SQLite?

I am new with Android Sqlite Database. I have created a database with SQLite in Android and I have a table Student_details which use a foreign key of the table: Student, I have made the id as ...
Md Azharul Islam Somon's user avatar
0 votes
1 answer
108 views

escaping sqlite column name in java ContentValues

I have an SQLite table with a column named 'group'. I've tried delimiting with single-quotes and square brackets. Each time, it inserts a '0' with no error message. At least when I leave it alone, ...
Adam's user avatar
  • 71
1 vote
0 answers
400 views

MediaStore update SQLiteDatabase Error: table album_art has no column named relative_path

Weird thing is, i tried it on a real device and it works fine. Only on emulators it's not working for some reason. I even tried lowering the api levels, but still not working. I tried changing the ...
Vince VD's user avatar
  • 1,589
0 votes
1 answer
133 views

How can I insert data into the SQLITE database with a foreign key using a content values?

I have a table below: +=================+ + CATEGORY_TABLE + +=================+ + PK | owner_id + + FK | task_id + + | lastname + + | firstname + + | etc... + +=================...
no_profile's user avatar
0 votes
0 answers
102 views

Content values are assigned null even after putting values in it

As a part of Unit testing I wanted to insert values to DB using content resolver. But when I tried this, @Before public void runBeforeTestSignOut() { ContentValues values = new ...
Subin T's user avatar
  • 157
1 vote
1 answer
871 views

Android ContentValues.get() null vs value is missing

I'm writing a ContentProvider class (for a book inventory) and got stuck when checking for validity of the entries in the insert() function. If the value is not valid I would then throw an ...
HappySka's user avatar
0 votes
3 answers
2k views

ContentValues only entering last value into database

I'm still fairly new to Android Studio and I have looked at this question in different forums but I haven't exactly found one that pertains to my problem specifically (or I'm not experienced enough to ...
Jonathan's user avatar
  • 497
0 votes
2 answers
121 views

How do I make Integers and Doubles save properly to ContentValues?

I'm trying to retrieve data from CSV to SQLite DB, all the Strings are properly saved. But Integers and Doubles are not, all of them saves as null. But how to split Integers and Doubles and put them ...
Scooltr's user avatar
  • 37
-1 votes
3 answers
2k views

How to handle null response from the JSON data?

I have a method for saving the values to ContentValues from remote server data as shown below: public static ContentValues platformInfoToContentValues(@NonNull GamePlatformInfoList platform) { ...
Nithin Prasad's user avatar
0 votes
1 answer
2k views

How to insert list of objects using ContentValues.put()?

I am trying to insert data into the SQLite database and for that I have written a simple method to insert the data that I get from the API as shown below: public static ContentValues ...
Nithin Prasad's user avatar
2 votes
2 answers
3k views

Default calendar id for android

I am trying to add event automatically but I need calendar id for this If I add event to calendar with id = 1 sometimes it does not exist or does not depend to event I add ContentValues cv = new ...
Dima Dehtiarov's user avatar
0 votes
1 answer
1k views

Update all rows in database

What is the effective way to update all records in the database. I try to update all rows for the same key independent from table id, like this: for (int i = 0 ; i < rowsCount ; i++) { cv....
Sam Joos's user avatar
  • 450
0 votes
0 answers
246 views

Android: Where conditions with ContentValues insteard of String[] in SQLiteDatabase update function

Currently, the update function in SQLiteDatabase uses String[] for the Where args. update(String table, ContentValues values, String whereClause, String[] whereArgs) I find this very strange A) ...
Enrico's user avatar
  • 41
2 votes
1 answer
504 views

Error casting Object[] to ContentValues[]

I'm following a tutorial about content providers and, in a specific code, they inserted some data using a bulkInsert method. They also used a Vector variable (cVVector) to store all the ContentValues. ...
Thiago Ferrao's user avatar
0 votes
1 answer
864 views

ContentValues Insert always return the -1

db.insert(table_name,null,contentValues); is always returning -1 and it is not inserting the values in the databases. Can you please help me to figure out what I'm doing the wrong? database_class....
Mudasir Sharif's user avatar
1 vote
2 answers
1k views

Insert Gson Data into Android Sqlite

I am calling a web service I got data in array[]. I wanted to insert this data inside sqlite database. I have database structure same at server and sqlite as well. Let's start with model class ...
Ashish Kudale's user avatar
-2 votes
1 answer
988 views

Put ArrayList in ContentValues

I'm using couchbaselite in Android, I want to use ContentProvider and ContentValues to insert Documents in my DB. One property of my documents is an ArrayList, but with the ConentValues I can't put ...
rik194's user avatar
  • 128
-2 votes
2 answers
2k views

SQLite Android update a specific row

I'm having trouble trying to update a row in SQlite. I want to update the row "name" with anyone with the name1 and rename it to bob. I also want to update row "age" with anyone ...
ZubZero's user avatar
2 votes
1 answer
3k views

Sqlite: how do I increment a row value by +1?

I have a TOTALCOUNT table with a PK _id column and an integer column "CARDNUM". I want to set the default value of CARDNUM to zero. And then increment CARDNUM by +1 each time a new row is inserted ...
AJW's user avatar
  • 1,587
0 votes
1 answer
860 views

ContentValues put error

Keep getting this error: Error inserting android.database.sqlite.SQLiteException: near "null": syntax error (code 1): , while compiling: INSERT INTO exercises(null) VALUES (NULL) I am trying to ...
rolomcflurry's user avatar
0 votes
1 answer
993 views

ContentValues getAsLong NullPointerException

I have a ContentValues that I'm parsing for data. I just received a very strange crash report: Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang....
Anthony's user avatar
  • 7,858
0 votes
1 answer
179 views

Inserting in SQLite with ContentValues in for loop

I am trying to add multiple records in SQLite with for loop likewise, but data is not fetched while calling from function and getting null pointer exception: ContentValues[] ans7 = new ContentValues[...
Krupa Rajani's user avatar
6 votes
1 answer
7k views

Object Has been collected cannot evaluate ContentValues.values.tostring()

Can anyone tell me what this is about. Im getting this error when i am adding data in database. its Happening only for a particular row. I tried finding answer or reason over the internet. but in vain....
Rahul Agrawal's user avatar
0 votes
1 answer
57 views

How to retrieve datas from inserted record to display in another activity android?

Hi I created table to insert record ie name,message and time. I inserted sucessfully but how to retrieve inserted datas to display in another activity. Here is code. //this i have done in Activity A: ...
Star's user avatar
  • 667
1 vote
2 answers
664 views

How to encode and append ContentValue values into an URL

Earlier when NameValuePairs were available directly it was easy to encode and append URL variables using: String UrlString = URLEncodedUtils.format(nameValuePairs, "utf-8"); But now they have been ...
user avatar
3 votes
0 answers
573 views

Is there a way to tell Android to show the "missed call" notification?

In a VoIP application that "catches" the system's outgoing calls, I also put information about the calls into the phone's call log. For a missed call the code is like below: ContentValues values = ...
larshson's user avatar
-1 votes
3 answers
107 views

Show error when send data from activity to another activity in Android

I want sent data from ListView in another activity and save this datas to SQLiteDatabase. i use ListView and save users data into SQLite and set this data to ListView, i want when click on items of ...
dfgh's user avatar
  • 29
-1 votes
2 answers
817 views

SQLite Update Statement error

for my update i want to search corrent pos using inspectionid, activityid, subactivityid but when calling update state ment im getting this error.can some one help. public int ...
hash's user avatar
  • 5,416
0 votes
0 answers
77 views

Optimizing SQLite inserts

I have a this function below which is working fine: I use it because in a synchronisation process I have to insert a lot of rows (sometimes more than 30 000 in the same sync) in different tables and ...
Nicolas Cortell's user avatar
0 votes
0 answers
90 views

Sqlite select statement results in an error whenever i open the intent

Here is my code The first 3 functions are in the database class public void onCreate(SQLiteDatabase db){ String creation_query3= "CREATE TABLE " + TABLE_Doctor + "(" + ...
ghumdan16's user avatar
1 vote
1 answer
909 views

Query in ContentValues

I have to insert a lot of rows in my SQLite Database and for some tables a specific value of each row has to be converted into an other using the value of an other table. Actually, I have this ...
Nicolas Cortell's user avatar
0 votes
1 answer
181 views

android sql update not working

This is how the table and row look like : public static final String DATABASE_CREATE = "CREATE TABLE " + TABLE_NAME + "(" + COLUMN_ID + " integer primary key autoincrement, " + COLUMN_INSTANT ...
allegroBegin's user avatar
0 votes
4 answers
286 views

Sqlite data abstraction to layout

I am trying to abstract data from SQLite database . I'm getting retrieving data correctly but I think there is a problem in the layout. I have insert two row, but it is showing only one row multiple ...
Iamat8's user avatar
  • 3,904
110 votes
9 answers
235k views

How to insert a SQLite record with a datetime set to 'now' in Android application?

Say, we have a table created as: create table notes (_id integer primary key autoincrement, created_date date) To insert a record, I'd use ContentValues initialValues = new ContentValues(); ...
droidguy's user avatar
  • 1,101