Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9088385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:53:53+00:00 2026-06-16T21:53:53+00:00

Hi I have a problem with my android application. I want to use a

  • 0

Hi I have a problem with my android application. I want to use a sqlite database for my application and I have one activity with the onCreate(),onPause() and onResume() methods. I have built a class DatenbankManager with the that create a Table id and name but if I start my Application with a Emulator I get a message and my Application close after this.

here my DatenbankManager Class:

package de.tarasov.database_example_tarasov;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatenbankManager extends SQLiteOpenHelper {

    private static final String DB_Name = "Stundenplanname.db";
    private static final int DB_VERSION = 1;
    private static final String KLASSEN_CREATE = "CREATE TABLE Stundenplan(" +
    "_id INTEGER PRIMARY KEY AUTOINCREMENT, "+
            "name TEXT NOT NULL";
    private static final String KLASSEN_DROP = "DROP TABLE IF EXIST Stundenplan";

    //Konstruktor
    public DatenbankManager(Context context) {
        super(context, DB_Name, null, DB_VERSION);

    }

    //Methode wenn eine Datenbank erstellt werden muss
    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(KLASSEN_CREATE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

            db.execSQL(KLASSEN_DROP); // Löscht Tabelle wenn nicht vorhanden 
            onCreate(db); //Erstellt Tabelle
    }

}

Here my MainActivity:

package de.tarasov.database_example_tarasov;

import android.os.Bundle;
import android.widget.Toast;
import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;

public class MainActivity extends Activity {

    private SQLiteDatabase mDatenbank;
    private DatenbankManager mHelper;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mHelper = new DatenbankManager(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mDatenbank.close(); //Schließt Datenbank

        Toast.makeText(this, 
                getResources().getString(R.string.db_close),
                Toast.LENGTH_SHORT).show(); 
    }

    @Override
    protected void onResume() {     
        super.onResume();
        mDatenbank = mHelper.getReadableDatabase(); //Datenbank öffnen

        //Gibt Kurztext aus
        Toast.makeText(this, 
                getResources().getString(R.string.db_open),
                Toast.LENGTH_SHORT).show(); 
    }

}

here is the error message:

enter image description here

and if I make a debug I see:

Source not found. 

in LogCat I see this:

enter image description here

I hate this debuger 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:53:54+00:00Added an answer on June 16, 2026 at 9:53 pm

    You forgot ) in your create table statement:

    private static final String KLASSEN_CREATE = "CREATE TABLE Stundenplan(" +
        "_id INTEGER PRIMARY KEY AUTOINCREMENT, "+
                "name TEXT NOT NULL);";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem with my Android Application. The Error occures when i want
I have a problem with facebook user login in my android application. I want
I have an android application showing coverflow animation.I want to use view extending surfaceview
I have a problem in my android application, I have a hand page, I
I have a problem with my android application. That application which uses the kSOAP
I'm developing an Android application with a spinner. I have this problem: This is
I have an interesting problem being reported to me from an android application I
I have a problem regarding Android App. I have created an application that download
i am having a small problem with my android application. I have some mp3
I wrote an application about NFC in android,but I have a problem. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.