SQLite Android Studio Tutorial Storing User Data (part 1/4)

preview_player
Показать описание
➤Android SQLite for BEGINNERS Course 2019:

This is an easy to follow Android Studio tutorial on SQLite!

➤My Keyboard:

➤My Microphone:

➤Check out our website:
Рекомендации по теме
Комментарии
Автор

Great tutorial ! It was simple enough, given that I am new to SQLite.

croissant
Автор

Also... if you attempt to alter the existing database structure

You will need to simply change the in DataBaseHelper... version number. When it was created it was version 1... if you make a change to database, e.g. add columns, change an existing column name, datatype etc... change context to version 2 after you make the db structural changes...

From this:

public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}

To this:
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 2);
}

This will cause the OnUpgrade method to fire.. and drop existing database

nuthouse
Автор

Hey, replace the buffer.toString() output out of the loop a line below the loop and it does not iterate the message through each row!

Sampelmind
Автор

i am facing problem after clicking on the add button, the app crashes and toast is also invisible. kindly help

asthavashishtha
Автор

At 11:31 should it be "DROP TABLE IF EXISTS..."?

jeremyyochum
Автор

Is there anyway to add data from different boolean methods in the Databasehelper class to the same entry? For example when I use 2 different add data functions even though I have different columns used they do not get put into the same entry.

Comeonmate
Автор

@ Mitch Where do you add the url for my SQL Database

dominikhartl
Автор

ContentValues.put("COL2", roll);
.put not available so it gives error

pradipsalgude
Автор

There is an error in the DatabaseHelper code at time 21:30 in the video.
This causes null value to be loaded tvShow field in database:

This:

public boolean addData(String name, String email, String tvShow){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COL2, name);
contentValues.put(COL3, email);
contentValues.put(COL3, tvShow);

Should be this:
public boolean addData(String name, String email, String tvShow){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COL2, name);
contentValues.put(COL3, email);
contentValues.put(COL4, tvShow);

nuthouse
Автор

Hey Mitch! Nice video. I have a question: what i f I want so sort my DB alphabetically? Should I sort it once it is created? or add the data at the right place when editing the DB? I need your help :) Thank you!

aurianrommel
Автор

I don't know why I get toast "Something went wrong"? Why is it?

haonguyen
Автор

I write the same code but when I enter data in editText and click the button the Toast doesn't pop up and a msg pop up with msg THE APP STOPPED. why any body have answer??

naimat
Автор

There are no errors but when i press the add button the app still crashes P.S i already put the AddData();. Thanks in Advance

joshsilvino
Автор

Shows error on "IF" of db.execSQL("DROP IF TABLE EXISTS"); in onupgrade function.

tanmaybha
Автор

hey i had a doubt in the django blog course where we had created an sqlite database

how to open that database and view the tables?
i wanted to view it the same way how we can view mysql databases

savin
Автор

Nice video! I followed the code and tried to add a few more columns. However, the app is quitting when I do that. I would greatly appreciate your help I've been trying to find a solution and its not working!

rahulgodaba
Автор

is it really important to making a method than calling it for Button ?

samtiny
Автор

Dude you're my new hero, thank you so much and please consider having my babies.

PhillipAEWIJ