Thank you very much for this! Just a question: to export the databases every time is the only way to see the datas with SQLite-Studio? It is a bit cumbersome. Maybe there is some extension for Android Studio to see the datas directly on the IDE?
Same but i fix it after crying 2 hours above the keyboard. Open the github link in the description of the video and check line by line the Database helper. In my case i forgot to add the following line "this.context = context;" in the constructor of the Database Helper class. Hopefully this will help you!
The problem was the space in the query before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +" after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +" You have to space in the begining of Interger
i had the same issue, i put as comment the Toast line in the else statement in the MyDataBaseHelper class before: } else { Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show(); } after: } else { /*Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show();*/ } it worked for me, you can try it
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
My solution to the "Add Movie" crashing the database was to change: public DatabaseHelper(@Nullable Context context) { super(context, DATABASE_NAME, DATABASE_VERSION, null); this.context = context; } to public DatabaseHelper(@Nullable Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); this.context = context; }
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
DB NAMES OF bookauthor is taking as book_authorTEXT , and same folows for the title please help here's my code String query ="CREATE TABLE " + TABLE_NAME + " (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + COLUMN_TITLE + " TEXT ," + COLUMN_AUTHOR + " TEXT," + COLUMN_PAGES + " INTEGER );"; after creation of table it shows book_authorTEXT and book_titleTEXT together in database
I am struggling with how to avoid opening and closing the database multiple times, because I read that best practise is to open it once when starting the app and to close it once when closing the app. I also read that is recommended to have the dbhelper as a singleton. I have several viewmodels that access the database through the database helper and I'm finding it difficult to put all of this together... how do I open it once if I need both a writable and readable db? Also, the context that is passed, is it the activity or fragment? I have one activity and several fragments which in turn have their own view models. Currently all viewmodels create a new dB helper and each method in the dBhelper class opens and closes the dB. I'm real,y struggling with architecture... Anybody got any tips?
when i went to file explore and to data - data , i did not find my file project and it shows error to the over files that said the package not debuggable .!!!!!!!!
Thanks for the video, but I have a question, what if we want to create two tables? How we can do it? I tried several times but the second table was not created? Thanks
The error comes because of the else statement in the addBook() function. I Don't know the reason but I worked my way to the conclusion through debugging.
Hii After Clicking On Item in recyclerview again there is one recyclerview inside it and I have to create table for it in same database but the name of the table is first recyclerview item name how can I?
how you guy found three files inside ur /data/data/project_name/database file, which android studio version are you using... i only got one file and i coded exactly in program and it create the table and don't even insert texts inside my rows...
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
the database folder does not appear in the File Explorer. I followed the correct path. It says that "run-as:/data has wrong owner: 0/1000, not 100" Please help
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
@@StevdzaSan The problem has been resolved and now I want to display a link but there is a problem when it displays in db browser for sqlite it displays like this: Landroid.text.style.URLSpan; @ 7cc9ba How do I display the link correctly in db browset for sqlite and in programming when using recyclerview I will display the image from the link Is this idea correct in the sense will it be displayed through the link Can you help me?
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
The problem was the space in the query before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +" after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +" You have to space in the begining of Interger
The problem was the space in the query before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +" after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +" You have to space in the begining of Interger
Tutorials awesome but one thing is going wrong when I rotate phone from portate to landscape recycling view not showing any data how to fix it portate mode working fine 🙄
Thank you very much for this! Just a question: to export the databases every time is the only way to see the datas with SQLite-Studio? It is a bit cumbersome. Maybe there is some extension for Android Studio to see the datas directly on the IDE?
My application keeps crashing upon clicking on the add button, try catch yielded no results and kept crashing.
Same. I need help!
Same, I need help
Same but i fix it after crying 2 hours above the keyboard. Open the github link in the description of the video and check line by line the Database helper. In my case i forgot to add the following line "this.context = context;" in the constructor of the Database Helper class. Hopefully this will help you!
The problem was the space in the query
before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
You have to space in the begining of Interger
i had the same issue, i put as comment the Toast line in the else statement in the MyDataBaseHelper class
before:
} else {
Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show();
}
after:
} else {
/*Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show();*/
}
it worked for me, you can try it
شكرا جزيلا .. لقد استفدت كثير..
You are the best kotlin Shifu that I have ever listent to. Thank you very much😘
I keep getting failed 😞 when I click at the add button on my add activity class
did you get why it was getting failed? I'm with the same problem
@@rubinho388 yeah I was able to after a few trials thanks
@@seifabdihafid681 can you tell me what did you do please..I have the same problem
@@baraaksarihabiles5954 I fixed it by changing the DATABASE_VERSION to 2 instead of 1
7:49
I don't have the databases, help please
me too; if u r ok help me pls
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
Thank You. Very Useful video
Love from Pakistan bro. Great video series.
Hello, Can you help me? I wrote your code in my Android studio, but it is showing only Failed?
Same here U find a solution
we can see database through app inspection as well
Thanks for your time!
This video was helpful to me :-)
how to add images too with this!
I have two titles inside of database file not three and it doesn't open by sqllite
do you have an answer to this?
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
if i wanna add some column in database.. where do i need to modified my code?
I like how he explain the code 😁
will you please tell me in backend you will use java or kotlin?
U can use database inspector to show db :D
I am doing same like as but my Toast show "Failed" guide me ?
What application that you use to create android application?
My solution to the "Add Movie" crashing the database was to change:
public DatabaseHelper(@Nullable Context context) {
super(context, DATABASE_NAME, DATABASE_VERSION, null);
this.context = context; }
to
public DatabaseHelper(@Nullable Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
this.context = context; }
Can you make a video about foreign key insertion as well..
7:47 there is no sqlitetutorial files in my device file explorer. can u help me about this?
Bro same did you solve that problem?
same here
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
DB NAMES OF bookauthor is taking as book_authorTEXT , and same folows for the title please help
here's my code
String query ="CREATE TABLE " + TABLE_NAME +
" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ COLUMN_TITLE + " TEXT ,"
+ COLUMN_AUTHOR + " TEXT,"
+ COLUMN_PAGES + " INTEGER );";
after creation of table it shows book_authorTEXT and book_titleTEXT together in database
I'm not getting a space between book_author and TEXT in the create code too..
it's throwing null pointer exception as i click to add ........Is there anyone to help me?
I need help with this too!!! Please
what if i want to insert an image of the book also, can ou explain pls or make a video with this app and code?
The video is helpful, but that dracula mode is a bit difficult to discern.
I am struggling with how to avoid opening and closing the database multiple times, because I read that best practise is to open it once when starting the app and to close it once when closing the app. I also read that is recommended to have the dbhelper as a singleton. I have several viewmodels that access the database through the database helper and I'm finding it difficult to put all of this together... how do I open it once if I need both a writable and readable db? Also, the context that is passed, is it the activity or fragment? I have one activity and several fragments which in turn have their own view models. Currently all viewmodels create a new dB helper and each method in the dBhelper class opens and closes the dB. I'm real,y struggling with architecture... Anybody got any tips?
Thank you a lot, I like the way you explaining.
i have login and register page, how do i create crud along with login?how do i put them in one db...i keep having problems on every step
Hey there’s no option like device file explorer what do I do?
Thank you so much, your tutorial is amazing, I will be checking your udemy courses ;)
when i went to file explore and to data - data , i did not find my file project and it shows error to the over files that said the package not debuggable .!!!!!!!!
Thanks for the video, but I have a question, what if we want to create two tables? How we can do it?
I tried several times but the second table was not created?
Thanks
Brate legenda si
Thank you very helpful.
Thank you so much, i'm learn very much from you! :))
Thank you helped a lot!
Any fix for BookLibrary keep stopping. Every time i put some data it always says Booklibrary keep stopping. Thankyou in advanced
Switch to ROOM Library
The error comes because of the else statement in the addBook() function. I Don't know the reason but I worked my way to the conclusion through debugging.
For me, this.context = context statement was missing in the constructor. Fixing that fixed the issue for me.
@@a_36_atharvathosar11 hey, how exactly did you fix that cus I am having de same issue
Anyone please helps me, I dont have the purple navigation bar as above. How can I make it. I didnt see Stevdza created it. Please help!!!
Hii After Clicking On Item in recyclerview again there is one recyclerview inside it and I have to create table for it in same database but the name of the table is first recyclerview item name how can I?
I have problem in settings the emulator, can anybody help?
Very good videos. Keep it up!
When I click on the add button, my app crashed. Do you guys might know why?
I got it to work
@@majinzeke4977 could you tell me bro, how
Problem solved. +923345850933 contact me to share the code.
Thank you dear stackoverflow
how did you resolve the problem ??
Awesome Video
how you guy found three files inside ur /data/data/project_name/database file, which android studio version are you using... i only got one file and i coded exactly in program and it create the table and don't even insert texts inside my rows...
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
the database folder does not appear in the File Explorer. I followed the correct path. It says that "run-as:/data has wrong owner: 0/1000, not 100" Please help
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
When I add the data the message tell me not added where is the mistake
How to update recycleview after insert data ?
Can I save object in database instead of multiple variables as you did?
no, sql is not an object oriented language. If you want to store objects maybe a noSql language can do it? But I doubt that too
👏👏👏👏 espectacular
Yes, true, but for me, I did not find a database file to choose the Book.db file to display on db browser for sqlite. What is the problem?
Make sure you opened a right app path.
@@StevdzaSan The problem has been resolved and now I want to display a link but there is a problem when it displays in db browser for sqlite it displays like this: Landroid.text.style.URLSpan; @ 7cc9ba
How do I display the link correctly in db browset for sqlite and in programming when using recyclerview I will display the image from the link Is this idea correct in the sense will it be displayed through the link Can you help me?
@@codingwithme3794 how you solved the previous issue?
how u resolve the previous problem
try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.
There were errors downloading files and/or directories: Writing local file failed!
when saving sqlite
first close the database opened in the sqlbrowser and retry saving .
Thank you very much! You helped me a lot.
You are amazing
i m wating for the 3rd part/please hurry up
don't you know how to say pls.....
Bro my app crashes after clicking add button
@@jemmytech5474 you got solution?
How to do it Click on the title to transfer data Another activity displays the title and content
The problem was the space in the query
before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
You have to space in the begining of Interger
Thank's a lot. It works :)
It doesn't work it's Always shows failed
Thanks
4:03
Thank you. 👏🔥👏🔥👏
You're welcome 👊
#DONE
why it is failed
Thx a lot.
I'm getting like duplicate resources how to solve it
Can sqlite can be realtime ?
Muito obrigado!
magnificent
thank youuuu
How to store images insql
Bro Integer value is not storing in database my app crashes everytime but string value are getting stored perfectly... Plss help
i got the same problem, have you fixed it?
Why he doesn't response to anyone?
The problem was the space in the query
before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
You have to space in the begining of Interger
always give me failed after all of that , short sad story
same
Were able to fix this issue
same
i can't call mydatabasehelper object in mainactivity can anyone help me
Whats the error
make it public
Tutorials awesome but one thing is going wrong when I rotate phone from portate to landscape recycling view not showing any data how to fix it portate mode working fine 🙄
you have to create another xml file for landscape mode
muito bom, parabéns
👍👍👍👍
Can you do a video of this in Kotlin too?
I started creating kotlin tutorials for beginners. There will be an advanced topics in the future as well
@@StevdzaSan Sure. I'll wait for that. Thanks
db.execSQL("DROP TABLE IF EXISTS" + TABLE_NAME);
_EXISTS_ is Error in my program..
@ntry Try out adding space after EXISTS
i m getting and error of "E/RecyclerView: No adapter attached; skipping layout" can anyone help
Thanks