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 7614721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:28:32+00:00 2026-05-31T02:28:32+00:00

I created an app to connect to an existing sqlite db, and display some

  • 0

I created an app to connect to an existing sqlite db, and display some basic information from the db.. but it’s closing unexpectedly in my emulator and I’m not sure what the errors mean. The db only has two tables, Information and android_metadata.

The only error I’m getting in the project files is in AndroidManifest.xml. It says: “Attribute minSdkVersion (8) is lower than the project target API level (10)” Other SO posts say that this can be ignored, so I haven’t edited it (and it doesn’t seem like it’s the problem in the logcat trace.)

This is the activity that populates the listview with the ‘states’ colunn in the db:

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import healthy.com.sdp.R;
import healthy.com.sdp.db.DataBaseHelper;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class StateListActivity extends Activity {

    private ListView _listView;
    private List<StateDisease> stateNames = new ArrayList<StateDisease>();
    DataBaseHelper myDbHelper;
    AlertDialog.Builder builder ;
    AlertDialog alert;
    Context _context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

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

        myDbHelper = new DataBaseHelper(this);

        _listView = (ListView) findViewById(R.id.listState);
        _listView.setAdapter(new SingleTextAdapter(getBaseContext(), R.layout.adapter_single_text, stateNames));

        _listView.setOnItemClickListener(clickListener);
        _context = this;
        try {

            myDbHelper.createDataBase();

        } catch (IOException ioe) {

            throw new Error("Unable to create database");

        }

        try {

            myDbHelper.openDataBase();
            Cursor cursor = myDbHelper.executeRawQuery("Select * from Information");


            if(cursor.moveToFirst())
            {
                while (cursor.isAfterLast() == false) 
                {
                    StateDisease sd = new StateDisease();
                    sd._stateId = cursor.getInt(cursor.getColumnIndex("_id"));
                    sd._percentHeartDisease = cursor.getDouble(cursor.getColumnIndex("HeartDisease"));
                    sd._percentObesity = cursor.getDouble(cursor.getColumnIndex("Obesity"));                    
                    sd._stateName = cursor.getString(cursor.getColumnIndex("States"));                  
                    sd._percentLungDisease = cursor.getDouble(cursor.getColumnIndex("LungDisease"));

                    stateNames.add(sd);
                    cursor.moveToNext();
                }
            }


            myDbHelper.close();

        }catch(SQLException sqle){

            throw sqle;

        }
    }

    private OnItemClickListener clickListener = new OnItemClickListener()
    {

        @Override
        public void onItemClick(AdapterView<?> parent, View v, int pos,
                long id) {      

            Intent intent = new Intent(getBaseContext(), DiseaseSelectionActivity.class); 
            Bundle b = new Bundle();
            b.putInt(Constant.STATE_ID, stateNames.get(pos)._stateId);
            b.putString(Constant.STATE_NAME, stateNames.get(pos)._stateName);
            intent.putExtras(b);
            startActivity(intent);
        }

    };
}

And this is the logcat trace:

03-11 07:14:33.013: I/Database(336): sqlite returned: error code = 1, msg = no such table: Information
03-11 07:14:33.013: W/System.err(336): android.database.sqlite.SQLiteException: no such table: Information: , while compiling: Select * from Information
03-11 07:14:33.022: W/System.err(336):  at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
03-11 07:14:33.022: W/System.err(336):  at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
03-11 07:14:33.022: W/System.err(336):  at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
03-11 07:14:33.022: W/System.err(336):  at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
03-11 07:14:33.022: W/System.err(336):  at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
03-11 07:14:33.032: W/System.err(336):  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
03-11 07:14:33.032: W/System.err(336):  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1356)
03-11 07:14:33.032: W/System.err(336):  at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1324)
03-11 07:14:33.032: W/System.err(336):  at healthy.com.sdp.db.DataBaseHelper.executeRawQuery(DataBaseHelper.java:149)
03-11 07:14:33.032: W/System.err(336):  at healthy.com.sdp.activity.StateListActivity.onCreate(StateListActivity.java:58)
03-11 07:14:33.032: W/System.err(336):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-11 07:14:33.032: W/System.err(336):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-11 07:14:33.032: W/System.err(336):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-11 07:14:33.032: W/System.err(336):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-11 07:14:33.050: W/System.err(336):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-11 07:14:33.050: W/System.err(336):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-11 07:14:33.052: W/System.err(336):  at android.os.Looper.loop(Looper.java:123)
03-11 07:14:33.052: W/System.err(336):  at android.app.ActivityThread.main(ActivityThread.java:3683)
03-11 07:14:33.052: W/System.err(336):  at java.lang.reflect.Method.invokeNative(Native Method)
03-11 07:14:33.052: W/System.err(336):  at java.lang.reflect.Method.invoke(Method.java:507)
03-11 07:14:33.052: W/System.err(336):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-11 07:14:33.052: W/System.err(336):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-11 07:14:33.052: W/System.err(336):  at dalvik.system.NativeStart.main(Native Method)
03-11 07:14:33.052: D/AndroidRuntime(336): Shutting down VM
03-11 07:14:33.052: W/dalvikvm(336): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-11 07:14:33.072: E/AndroidRuntime(336): FATAL EXCEPTION: main
03-11 07:14:33.072: E/AndroidRuntime(336): java.lang.RuntimeException: Unable to start activity ComponentInfo{healthy.com.sdp/healthy.com.sdp.activity.StateListActivity}: java.lang.NullPointerException
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.os.Looper.loop(Looper.java:123)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread.main(ActivityThread.java:3683)
03-11 07:14:33.072: E/AndroidRuntime(336):  at java.lang.reflect.Method.invokeNative(Native Method)
03-11 07:14:33.072: E/AndroidRuntime(336):  at java.lang.reflect.Method.invoke(Method.java:507)
03-11 07:14:33.072: E/AndroidRuntime(336):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-11 07:14:33.072: E/AndroidRuntime(336):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-11 07:14:33.072: E/AndroidRuntime(336):  at dalvik.system.NativeStart.main(Native Method)
03-11 07:14:33.072: E/AndroidRuntime(336): Caused by: java.lang.NullPointerException
03-11 07:14:33.072: E/AndroidRuntime(336):  at healthy.com.sdp.activity.StateListActivity.onCreate(StateListActivity.java:61)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-11 07:14:33.072: E/AndroidRuntime(336):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-11 07:14:33.072: E/AndroidRuntime(336):  ... 11 more
03-11 07:14:37.442: I/Process(336): Sending signal. PID: 336 SIG: 9

Thanks for any help.

  • 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-05-31T02:28:33+00:00Added an answer on May 31, 2026 at 2:28 am

    You are executing statement/query

        Select * from Information
    

    While this table “Information” is not have been created before.
    see this link/tutorial to know how to use sqlite db in better way

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created an app that reads from a bundled .plist file and
When I created the app on iTunes connect I used the old logo for
I'm trying to test in app purchases in our app but I'm not having
Apple in iTunes Connect Developer Guide says: App Name Expiry Once you have created
I created a facebook app and the login loads but once it does that
I created a remote server for an app to connect to using sockets. It
I created an iTunes connect test user to test my in-app purchase. While testing
I'm trying to connect to an existing MySQL DB from Lightswitch RTM through a
I am about to upload an app to iTunes Connect. I am not Team
I created an App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration>

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.