Android Application Development Tutorial - 117 - Inserting Data into SQLite Database
Why Stack Overflow recommends it
Stack Overflow users link it when answering beginners who need to add or edit rows in an Android SQLite database and want a quick, concrete walkthrough.
Recommended by 2 people across 2 different months, 2012 to 2015.
What it is
A short beginner tutorial from thenewboston's Android development series showing how to write a method that inserts a row into an SQLite database using ContentValues and the database insert call. It is episode 117 of a long series presented by Bucky Roberts.
What people said
Recommends AndroidPenguin · 2012-12 · Stack Overflow · on “How I can add items to the SQLite database?”
These [this video] are tutorials that helped me learn but you might need to go one or two videos back. Essentially you can add the values you'd like to insert to content values which take in the category name as their first parameter and the value as their second.
Recommends corgichu · 2013-04 · Stack Overflow · on “view SQLite Databases in android listview?”
Here's a good tutorial on SQLite databases and displaying contents in a ListView : [LINK] It doesn't go over editing that much, but it's easy to see where he puts the values into the database. thenewboston on YouTube is a good resource for Android tutorials and he goes over SQLite databases: [LINK] It's pretty comprehensive and slow if you already kinda know what you're doing so here is where he goes over inserting data/editing the database if you just wanna jump to that: [this video]
Cites MichaelAndroidNewbie · 2015-03 · Stack Overflow · on “Android: why is return used in this instance?”
So I followed this tutorial: [this video] The tutorial details how to write a method to create an entry in an sqlite database. At the end of the tutorial, he adds that the method should not be void and that the following line: ourDatabase.insert(DATABASE_TABLE, null, cv); should actually be returned. It seems that this would have worked without making it a return statement. I have seen this happen a lot in java examples were processes are carried out and a return statement is added that seems (to me as a newbie) pointless. Can someone explain the point of a return statement in this case?