Android SQLite Database
Why Stack Overflow recommends it
Stack Overflow users link it when answering beginner questions about storing data locally in Android with SQLite and a database helper class, and when debugging code copied from this tutorial.
Recommended by 3 people across 3 different months, 2013 to 2014.
What it is
A 2012 screen-recorded tutorial from professor profgustin on creating and using an SQLite database in an Android app with a DBAdapter helper class. The description links downloadable copies of DBAdapter.java and a working AssignmentTracker project.
What people said
Recommends enadun · 2013-05 · Stack Overflow · on “Connecting to sql database directly in android”
You can't access remote database server without web services. If you want, you can access internal database (sqlite) without any web services. I have a doubt whether you are asking that. For that this video [this video] may be helpful for you.
Recommends bgauryy · 2013-07 · Stack Overflow · on “How to use SQLiteDatabase.CursorFactory”
You can check this tutorial.. its sum it up perfectly: [this video] and you should close the DB , after any usage.. another way is to create Class variable Cursor cr and every time you use it check this: if(cr==null) cr = new .... else //do something // cr.close();
Recommends An SO User · 2014-11 · Stack Overflow · on “notepad eclipse java android internal storage”
Okay let's break it down. You want to make something that will let you take notes. Fair enough. You need the kind of storage that will make retrieval and insertion easier. Let's start with a single text file that you store somewhere (internal or external). If you use this approach, inserting and deleting data becomes difficult because any changes will require you to make changes to the actual text. Not to mention, you will need to format your notes in a way so that you can differentiate one note from another. Okay, so will using multiple text files solve this? In a way, yes, but you can go for a better approach using SQLite. SQLiteDatabase has methods to create, delete, execute SQL commands,
Cites user2005980 · 2013-01 · Stack Overflow · on “NullPointerException error when trying to read from SQLite”
I found this source code from a tutorial but it crashes when I run it. My logcat: 01-25 00:26:30.898: E/AndroidRuntime(2762): FATAL EXCEPTION: main 01-25 00:26:30.898: E/AndroidRuntime(2762): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pinchtapzoom/com.pinchtapzoom.AssignmentTracker}: java.lang.NullPointerException 01-25 00:26:30.898: E/AndroidRuntime(2762): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967) 01-25 00:26:30.898: E/AndroidRuntime(2762): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992) 01-25 00:26:30.898: E/AndroidRuntime(2762): at android.app.ActivityThread.access$600(ActivityThread.java:127) 01-
Cites Kickaha · 2013-06 · Stack Overflow · on “Getting a variable from the db through the activity?”
First thing you need is to create a databaseAdapter class, this will be a single helper class with which you do all your database connection work. In this case retrieving the value 500 using a SQL SELECT FROM .... (Im going to assume you know SQL) here are some good refs [LINK] [this video] Next you want to set the attribute of your SmartImageView, first get a reference to it in code. SmartImageView myImage = (SmartImageView) this.findViewById(R.id.image_switcher); Then you can set the attribute by referencing it (if the loopJ smartImageView has an appropriate attribute), if not put it in a linear layout, get a reference to that and set its layout width (respecting the pixel density of the device
Cites user2203633 · 2014-06 · Stack Overflow · on “Database Tutorial: The method open() is undefined for the type MainActivity.DBAdapter”
I am trying to do this database tutorial on SQLite Eclipse: [this video] But I get a few errors at the end.. at db.ppen(); i get error: The method open() is undefined for the type MainActivity.DBAdapter and similar for insert record and close. MainActivity: package com.example.studentdatabase; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import android.app.Activity; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.V