Android SQLite Database Tutorial 2 # Introduction + Creating Database and Tables (Part 2)
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when their SQLiteOpenHelper code crashes, inserts fail, or the database file can't be found in the device file explorer.
Recommended by 0 people across 0 different months, 2015 to 2020.
What it is
A beginner tutorial from ProgrammingKnowledge, part 2 of an Android SQLite series. It introduces SQLite on Android, then builds a SQLiteOpenHelper class that creates a database and a table, and shows how to inspect the database file in Android Studio's file explorer.
What people said
Cites Jay Rahman · 2015-04 · Stack Overflow · on “Android SQL app unfortunately app has stopped”
I have followed the following tutorial ( [this video] ) to create an SQL database app, unfortunately i am having an issue where the app doesn't open, can anyone help and see if i'm doing something wrong. This is the SQL Code package com.example.sqltest2; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = "products.db"; public static final String TABLE_NAME = "productstable.db"; public static final String COL_1 = "ID"; public static final String COL_2 = "NAME"; public static final String COL_3 = "Aisle"; public static final S
Cites mapage2 · 2015-11 · Stack Overflow · on “Android App crashing using getWritableDatabase”
Alright, so I have been searching this question and I have found a couple of answers that I have tried to no success. I noticed that if I comment out getWritableDatabase the app doesn't crash but it does not complete the operation I want. I also referenced this video [this video] to help me create the classes Here is my SQLHelper Class: package com.example.amasio.testapplication; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; /** * Created by Amasio on 11/9/15. */ public class DatabaseController extends SQLiteOpenHelper { public static final String DATABASE_NAME = "Student.db"; p
Cites Seb Thomas · 2016-07 · Stack Overflow · on “Android Sqlite db creation / location issue”
I am working with a basic example [LINK] of Android Sqlite. Issue 1: As per this video [LINK] , it runs perfectly without any errors but - when I take Android Device Monitor I cannot locate my project with full name -- all the folders under data > data are named as abc (which is the package extension only! ) [LINK] As per the video [this video] , why is my ADM not showing the full package name such as abc.mycom.com.sqliteapp or how can I locate my db (students.db)? Issue 2: In order to solve this, when I try a specific path using public static final String DATABASE_NAME= "/mnt/sdcard/student.db"; I get ' Unfortunately the app has stopped ' error. I have added the following permission: <uses-permi
Cites Martin Sing · 2016-10 · Stack Overflow · on “Android Studios: Android Device Manager shows no files for Nougat 7.0 in File Explorer”
I'm learning how to integrate databases (SQLite) into my app. I checked out this tutorial [this video] and at the 10m mark, OP enters the FileExplorer in Android Device Manager in Android Studio. Can't see ANY files in the File Explorer. Using the File Explorer is the desired result. Last Night, I've Rooted my Nexus 6p (7.0) and reinstalled Studio 2.2.2 after reading these stackoverflow dialogues with no desired result, the issue has a long history: 1) Android Device Monitor "data" folder is empty [LINK] How to Find my App's /data/data using Android Device Monitor's File Explorer [LINK] -Rooted phone (6p) doesn't show any files in FileExplorer (Verfied with Root Checker) -Emulator doesn't show an
Cites avishag Cs · 2017-01 · Stack Overflow · on “android.database.sqlite.SQLiteException: table TABLE_NAME has no column named X (code 1): , while compiling: INSERT INTO”
I'm getting the above error, and I really cant find what I did wrong. I was following the video: [this video] I looked at android.database.sqlite.SQLiteException: table X has no column named Y: , while compiling: INSERT INTO [LINK] but I couldn't find an error. I'm afraid that onCreate of RunsHistoryDataBase isn't called cause I've put there Log.d and in insertData and the Log.d of onCreate didn't show up and the Log.d of insertData did show up. AnyWay I can't insert data to the DB and I really don't understand why.. any help please? these is the code of the SQLiteDB: public class RunsHistoryDataBase extends SQLiteOpenHelper { public static final String dataBaseName = "RunsHistory.db"; public sta
Cites HelloWorld1 · 2017-02 · Stack Overflow · on “Does it Create a new database in every time when you run the app?”
Based on these tutorial about creating a database in android in relation to SQLite. [LINK] [this video] My question is: WHen you run this app and it creates a new database and you save some data. However when you rerun the application, does it create a new database again? What would be happened to the previous saved data? will they be removed? Today Im a newbie in android Thank you!
Cites Anthony Lauly · 2017-07 · Stack Overflow · on “SQLite database crashing my app”
I am trying to make a project with android studio as in the video of : Source 1 [LINK] and Source 2 [this video] and here is my code in my added java class : package com.example.asus.androidsqlitedatabase_1; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; /** * Created by ASUS on 7/6/2017. */ public class Databasehelperclass extends SQLiteOpenHelper { public static final String DATABASE_NAME = "Student.db"; public static final String TABLE_NAME = "Student_table"; public static final String COLUMN1= "ID"; public static final String COLUMN2 = "NAME"; public static final String COLUMN3 = "SURNAME"; public static final St
Cites Ahmed Laoun · 2017-07 · Stack Overflow · on “can't add data to sqlite android”
i have this code this is my very first code on sqlite i took it from this tutorial [this video] i did exactly what he did in the video but its not working DBclass package com.catarmy.leader.ahmed.dbtest; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class Databasehelper extends SQLiteOpenHelper { public static final String DATABASE_NAME = "student.db"; public static final String TABLE_NAME = "student_table"; public static final String COL_1 = "ID"; public static final String COL_2 = "NAME"; public static final String COL_3 = "SURNAME"; public static final String COL_4 = "
Cites AdrianAndrews · 2020-01 · Stack Overflow · on “How to find file under device file explorer”
As pretext, I have been following the an Android Studio Tutorial by ProgrammingKnowledge, [this video] . But am stuck around the 9:22 mark. I am trying to find my folder under device file explorer> data > data as he did but to no success. [LINK] I am using android version 3.5.3. Any advice or solution would be appreciated.