How to create a database application for Android?

I am developing an Android application where I want to create a database. I expanded the class SQLiteOpenHelper, but it does not work for me. Can someone tell me how to make a database through it or any other syntax or code? Please provide me with a good tutorial or example for exploring the creation and implementation of a database in an application.

Here is my logcat file from trying to follow the tutorial vogella.de:

06-17 13:20:11.883: ERROR/AndroidRuntime(1474): FATAL EXCEPTION: main
06-17 13:20:11.883: ERROR/AndroidRuntime(1474): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.vogella.android.todos.database/de.vogella.android.todos.database.TodoDatabaseHelper}: java.lang.InstantiationException: de.vogella.android.todos.database.TodoDatabaseHelper
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.os.Looper.loop(Looper.java:123)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread.main(ActivityThread.java:3647)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at java.lang.reflect.Method.invokeNative(Native Method)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at java.lang.reflect.Method.invoke(Method.java:507)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at dalvik.system.NativeStart.main(Native Method)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474): Caused by: java.lang.InstantiationException: de.vogella.android.todos.database.TodoDatabaseHelper
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at java.lang.Class.newInstanceImpl(Native Method)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at java.lang.Class.newInstance(Class.java:1409)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)
06-17 13:20:11.883: ERROR/AndroidRuntime(1474):     ... 11 more
06-17 13:20:12.004: WARN/ActivityManager(68):   Force finishing activity de.vogella.android.todos.database/.TodoDatabaseHelper
+3
source share
3 answers

Here is an interesting tutorial on using Android + Database that interests you.

http://www.anotherandroidblog.com/2010/08/04/android-database-tutorial/

A very detailed explanation here:

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

+3

i Offer an Android Notepad tutorial on creating a content provider.

Sample

Tutorial

+2
source

All Articles