android-sqlite

SQLite - Could not open database file

我们两清 提交于 2020-01-22 17:56:08
问题 I am coding a Xamarin Android application, and am getting an error when trying to create a SQLite database. Here is my code: string applicationFolderPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "CanFindLocation"); string databaseFileName = System.IO.Path.Combine(applicationFolderPath, "CanFindLocation.db"); SQLite.SQLite3.Config(SQLite.SQLite3.ConfigOption.Serialized); var db = new SQLiteConnection (databaseFileName); Here is the

Unable to load sqlite database on first run

旧街凉风 提交于 2020-01-22 04:05:08
问题 I have created an app when I install and launch it for first time it closes automatically but when I open it after it works fine. If I clear data of the app it also closes for first time. It shows android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database Can anyone help here is my log 11-22 23:14:56.175 13193-13193/? I/art: Late-enabling -Xcheck:jni 11-22 23:14:56.195 13193-13193/? D/TidaProvider: TidaProvider() 11-22 23:14:56.285 13193-13193

Unable to load sqlite database on first run

爷,独闯天下 提交于 2020-01-22 04:05:04
问题 I have created an app when I install and launch it for first time it closes automatically but when I open it after it works fine. If I clear data of the app it also closes for first time. It shows android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database Can anyone help here is my log 11-22 23:14:56.175 13193-13193/? I/art: Late-enabling -Xcheck:jni 11-22 23:14:56.195 13193-13193/? D/TidaProvider: TidaProvider() 11-22 23:14:56.285 13193-13193

How to create a table with a two or more foreign keys using Android Room?

懵懂的女人 提交于 2020-01-21 03:14:49
问题 According the entity-relationship model, the relationship between tbl_post and tbl_category could be specified using Room Persistency Library as follows: @Entity(foreignKeys = @ForeignKey( entity = TblPost.class, parentColumns = "id", childColumns = "tbl_post_id") ) class TblPostCategory { @PrimaryKey public String id; @ColumnInfo(name = "user_id") public String postId; } However TblPostCategory depends on two foreign keys: post_id and category_id from TblPost and TbCategory . How the

How to create a table with a two or more foreign keys using Android Room?

你离开我真会死。 提交于 2020-01-21 03:14:05
问题 According the entity-relationship model, the relationship between tbl_post and tbl_category could be specified using Room Persistency Library as follows: @Entity(foreignKeys = @ForeignKey( entity = TblPost.class, parentColumns = "id", childColumns = "tbl_post_id") ) class TblPostCategory { @PrimaryKey public String id; @ColumnInfo(name = "user_id") public String postId; } However TblPostCategory depends on two foreign keys: post_id and category_id from TblPost and TbCategory . How the

Sqlite not inserting data in 2nd table

浪子不回头ぞ 提交于 2020-01-17 07:44:10
问题 This code was working fine with one table....and was attaching file Now I want to create two tables first activity is inserting data in table1...but second activity is not inserting data....there is no log message........while calling attach it gives log as given below: E/SQLiteLog: (1) My database class is public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME="GEOTAG.db"; public static final String TABLE_NAME1="Coordinates_table"; public static final

Package has already posted 50 toasts. Not showing more

我的未来我决定 提交于 2020-01-17 04:56:07
问题 Hello I am working on an app and in which at one point I need to take input from user and store it in database and then fetch that data and put it on different TextView . Problem is I did stored the data in database and when i trying to fetch it My app shows a pop up i.e : App is not responding and logcat shows this: Package has already posted 50 toasts. Not showing more. I have used 6 database operations before this pullAccStt can this be a problem. DatabseAdapotor public long

SQLiteDatabase Cursor empty only on Android 5.0+ devices

人走茶凉 提交于 2020-01-15 23:05:29
问题 The application has a SearchView which fetches suggestions from a specific database table. Everything worked without any errors until Android 5.0 appeared. As of then, when the SQLiteQueryBuilder queries the database to fill the Cursor object, the return is empty cursor. Not NULL , but empty. On other platforms, I can output the Cursor 's content via DatabaseUtils.dumpCursorToString(cursorObject) , but on Android 5.0+ the method reports output on null objects Dumping cursor null <<<<< Even

Editing data in a List View item

强颜欢笑 提交于 2020-01-15 10:45:49
问题 Can't seem to find a solution to this. I'm trying to edit the data in my List View item. The List View uses an array adapter to display the data in a row in the list view. The user holds their finger over the list view item they wish to edit which causes a box to pop up containing the option of either 'Delete' or 'Edit'. When the user clicks to Edit the data, the data from that list view item is supposed to be transferred over to the other activity where the user can edit it. Instead of

how to get DB sqlite data from strings.xml so when i change the locale all the data can be translated

ぃ、小莉子 提交于 2020-01-15 02:32:22
问题 i have database with all data saved inside it how can i change that and make get the data from strings,xml so when i change the locale all the data can be translated to locale language here is my code: public class DB_Sqlite extends SQLiteOpenHelper { public static final String BDname = "data.db"; public static final int DBVERSION = 1; /*<<<<< ADDED BUT NOT NEEDED */ public static final String TABLE_FAVOURITES = "mytable"; public static final String FAVOURITES_COL_ID = BaseColumns._ID; /*<<<<