android-sqlite

sqlite get field with more than 2 MB [duplicate]

落花浮王杯 提交于 2019-12-20 07:39:43
问题 This question already has answers here : Retrieve large blob from Android sqlite database (2 answers) Closed 2 years ago . When I try to get data from SQlite and size of field more than 2 MB it throw exception "Couldn't read row 0, col 0 from Cursor Window. Make sure the Cursor is initialized correctly before accessing data from it. " How can I store a field that have above 2 Mb get into string ? i store multiple Base64 Strings as LONG TEXT in sqlite it store successfully but when i fatch

How to Display Every Tab(Fragment) its own Data in TextView from SQlite

坚强是说给别人听的谎言 提交于 2019-12-20 05:13:11
问题 How I can Display Different TextView on each Tab (each tab its own Data) example: if my db is empty and begun to enter my Name _ Place Displays :Tab 1 = takes NAME_PLACE just from ID_1 , Tab 2 = ID_2 , Tab 3 = ID_3 from db then if i rentered on tab1 to change the Name_Place Tab 1= ID_1 takes just changes id 1 changes or row ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, public class DataBaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = "big.db"; public static

Emulator vs Samsung device SD Card Storage

泄露秘密 提交于 2019-12-20 04:49:15
问题 The Samsung Device is a T810 with Android 7.0 API 24 and has a SD Card that other apps we have created have written to the SQLite DB on the SD Card with no issues. Sad to say we are not sure if this was before the Android 7.0 update. As of now we can not use code posted below to write to the SD Card. On the Emulator running API 26 the device file explorer is showing this information Database Emulator /mnt/user/0/primary/Android/data/com.androidstackoverflow.onepass/files/Documents/PassWord

IntentService is freezing my application UI

不想你离开。 提交于 2019-12-20 03:44:05
问题 In my application, I am using Intentservice to fetch the data from server and store fetched data in to local sqlite db. I am using 5 IntentService to fetch and fill five tables. Data may up to 300 rows for each Intent Service. What should I do? IntentService Code: public class SendBpRecordServer extends IntentService { DbHelper dbHelper; public static final String TAG="BP Service"; public JSONObject finalData; public SendBpRecordServer() { super("BP"); dbHelper=new DbHelper(this); Log.i("In

SQLite enhanced query syntax on Android

只愿长相守 提交于 2019-12-20 03:23:11
问题 I have the following SQLite query which works great on my local machine: SELECT * FROM ftdata WHERE ftdata MATCH 'phrase1:this AND phrase2:that' This doesn't seem to return the same resultset on my Android device as it does on my desktop. It returns far less results on Android. This query appears to return the correct results on both: SELECT * FROM ftdata WHERE ftdata MATCH 'phrase1:this phrase2:that' However I would ideally like to combine AND and OR queries instead of being forced to use

Compare Dates Stored as String using Datetime

主宰稳场 提交于 2019-12-20 02:29:23
问题 I have stored dates' date as String in my database in the following format : dateFormater = new SimpleDateFormat("dd MMM yyyy"); Now i need to access data between the two dates startWeekDate and endWeekDate both formatted as above. Currently , the where clause of my query is : at_date BETWEEN Datetime( '"+startWeekDate+"') AND Datetime( '"+endWeekDate+"') Where startWeekDate is '10 Aug 2014' and endWeekDate is '16 Aug 2014' . But I am getting the null result on my TextView . Can any one guide

Unable to insert record into SQLite Database from Firebase Message Service when app is in background or closed state

一笑奈何 提交于 2019-12-20 02:26:27
问题 I am trying out Firebase Notifications. I was able to get the Notification to work properly using this documentation. The message was received and I was able to send a notification to the Notification Bar from within the MyFirebaseMessagingService service class. This happens even when the app is in background or closed. What I need is to collect the data sent in the notification and insert it into an SQLite database. The code I wrote works fine if the app is in foreground, but it does not

How to get id from database on click of listview item in android

耗尽温柔 提交于 2019-12-19 19:43:17
问题 I have searched through various questions related to this on this website but i am unable to resolve the issue i am getting. I want to get id from database on click of listview item This is my categories class: package com.example.reminders; import java.util.List; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView

Android with Room - How to set a foreign key nullable

≡放荡痞女 提交于 2019-12-19 18:52:02
问题 I'm using Room in my Android app. One table (stock_move) contains several Foreign keys. In some case, I need to insert a stock_move without a FK (locationDestId). In this case, SQLite raise an error: io.reactivex.exceptions.OnErrorNotImplementedException: foreign key constraint failed (code 19) There is my entity: @Entity(tableName = "stock_move", foreignKeys = { @ForeignKey( entity = LocationEntity.class, parentColumns = "id", childColumns = "location_id", onDelete = CASCADE ), @ForeignKey(

WinDeath on notifyDataSetChanged()

左心房为你撑大大i 提交于 2019-12-19 17:37:48
问题 Hi I have following problem: data.clear(); data.addAll(datasource.getFilesInFolder()); //gets the data from Sqlite database adapter.notifyDataSetChanged(); generates this logCat output : 12-19 14:34:30.864: W/Binder(986): Caught a RuntimeException from the binder stub implementation. 12-19 14:34:30.864: W/Binder(986): java.lang.NullPointerException 12-19 14:34:30.864: W/Binder(986): at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280) 12-19 14:34