43 questions
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 = ...
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" &...
-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 ...
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 ...
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 ...
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 ...
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 ...
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)
...
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 ...
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 ...
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, ...
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 ...
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... +
+=================...
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 ...
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 ...
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 ...
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 ...
-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) {
...
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 ...
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 ...
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....
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) ...
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.
...
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....
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
...
-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 ...
-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 ...
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 ...
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 ...
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....
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[...
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....
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:
...
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 ...
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 = ...
-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 ...
-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 ...
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 ...
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 + "(" + ...
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 ...
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 ...
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 ...
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();
...