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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:56:36+00:00 2026-05-31T15:56:36+00:00

I have a problem while following thenewboston Android tut’s So the first problem is

  • 0

I have a problem while following thenewboston Android tut’s

So the first problem is i’m sure that i have followed what he has done exactly, but this time my app is not working.

Sorry if my post will be too long, YOU CAN EDIT IT if you can make my question clear

So this is a SQLiteExample Class that i extended Activity :

public class SQLiteExample extends Activity implements OnClickListener{
Button sqlUpdate, sqlView;
EditText sqlName, sqlHotness;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sqlliteexample);

    sqlUpdate = (Button) findViewById(R.id.bSqlUpdate);
    sqlView = (Button) findViewById(R.id.bSqlopenView);
    sqlName = (EditText) findViewById(R.id.etSqlName);
    sqlHotness = (EditText) findViewById(R.id.etSqlHot);

    sqlUpdate.setOnClickListener(this);
    sqlView.setOnClickListener(this);
}

public void onClick(View arg0) {
    // TODO Auto-generated method stub
    switch(arg0.getId()){
    case R.id.bSqlUpdate :

        boolean didItWork = true;

        try {
            String name = sqlName.getText().toString();
            String hotness = sqlHotness.getText().toString();

            HotOrNot entry = new HotOrNot(SQLiteExample.this);
            entry.open();
            entry.createEntry(name, hotness);
            entry.close();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            didItWork = false;
            String error = e.toString();
            Dialog d = new Dialog(this);
            d.setTitle("Dang It!");
            TextView tv = new TextView(this);
            tv.setText(error);
            d.setContentView(tv);
            d.show();
        }finally{
            if(didItWork){
                Dialog d = new Dialog(this);
                d.setTitle("Heck Yea!");
                TextView tv = new TextView(this);
                tv.setText("Success");
                d.setContentView(tv);
                d.show();
            }
        }
        break;
    case R.id.bSqlopenView :
        Intent i = new Intent("com.thenewboston.tama.SQLView");
        startActivity(i);
        break;
    }
}

I just setOnClickListener() to those 2 button’s here.

This is my HotOrNot Class which hold the SQLite stuff’s :

public class HotOrNot {

public static final String KEY_ROWID = "_id";
public static final String KEY_NAME = "persons_name";
public static final String KEY_HOTNESS = "persons_hotness";

private static final String DATABASE_NAME = "HotOrNotdb";
private static final String DATABASE_TABLE = "peopleTable";
private static final int DATABASE_VERSION = 1;

private DbHelper ourHelper;
private final Context ourContext;
private SQLiteDatabase ourDatabase;

private static class DbHelper extends SQLiteOpenHelper {    

    public DbHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_NAME + " TEXT NOT NULL, " + 
                KEY_HOTNESS + "TEXT NOT NULL); "
        );
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
        onCreate(db);
    }

}

public HotOrNot(Context c){
    ourContext = c;
}
//?????????????????????
public HotOrNot open() throws SQLException{
    ourHelper = new DbHelper(ourContext);
    ourDatabase = ourHelper.getWritableDatabase();
    return this;
}

public void close(){
    ourHelper.close();
}

public long createEntry(String name, String hotness) {
    // TODO Auto-generated method stub
    ContentValues cv = new ContentValues();
    cv.put(KEY_NAME, name);
    cv.put(KEY_HOTNESS, hotness);
    return ourDatabase.insert(DATABASE_TABLE, null, cv);
}
public String getData() {
    // TODO Auto-generated method stub
    String[] columns = new String[]{KEY_ROWID, KEY_NAME, KEY_HOTNESS};
    Cursor c = ourDatabase.query(DATABASE_TABLE, columns, null, null, null, null, null);
    String result = "";

    int iRow = c.getColumnIndex(KEY_ROWID);
    int iName = c.getColumnIndex(KEY_NAME);
    int iHotness = c.getColumnIndex(KEY_HOTNESS);

    for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()){
        result += c.getString(iRow) + " " + c.getString(iName) + " " +c.getString(iHotness) + "\n";
    }

    return result;
}

And this is my SQLView extended Activity (for the 2nd Button) :

public class SQLView extends Activity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sqlview);

    TextView tv = (TextView) findViewById(R.id.tvSQLinfo);
    HotOrNot info = new HotOrNot(this);
    info.open();
    String data = info.getData();
    info.close();

    tv.setText(data);
}

And this is the error that i got when i click the R.id.bSqlopenView button in my SQLiteExample Class:

03-19 14:47:54.504: I/Database(335): sqlite returned: error code = 1, msg = table peopleTable has no column named persons_hotness

And a lot of error’s again after that first one

EDITED : This my FULL VERSION Error List 😀

    03-19 14:47:28.194: D/dalvikvm(335): GC_EXTERNAL_ALLOC freed 50K, 53% free 2554K/5379K, external 1625K/2137K, paused 107ms
03-19 14:47:49.634: W/KeyCharacterMap(335): No keyboard for id 0
03-19 14:47:49.634: W/KeyCharacterMap(335): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-19 14:47:54.504: I/Database(335): sqlite returned: error code = 1, msg = table peopleTable has no column named persons_hotness
03-19 14:47:54.515: E/Database(335): Error inserting persons_hotness= persons_name=
03-19 14:47:54.515: E/Database(335): android.database.sqlite.SQLiteException: table peopleTable has no column named persons_hotness: , while compiling: INSERT INTO peopleTable(persons_hotness, persons_name) VALUES(?, ?);
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1149)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1569)
03-19 14:47:54.515: E/Database(335):    at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1426)
03-19 14:47:54.515: E/Database(335):    at com.thenewboston.tama.HotOrNot.createEntry(HotOrNot.java:70)
03-19 14:47:54.515: E/Database(335):    at com.thenewboston.tama.SQLiteExample.onClick(SQLiteExample.java:46)
03-19 14:47:54.515: E/Database(335):    at android.view.View.performClick(View.java:2485)
03-19 14:47:54.515: E/Database(335):    at android.view.View$PerformClick.run(View.java:9080)
03-19 14:47:54.515: E/Database(335):    at android.os.Handler.handleCallback(Handler.java:587)
03-19 14:47:54.515: E/Database(335):    at android.os.Handler.dispatchMessage(Handler.java:92)
03-19 14:47:54.515: E/Database(335):    at android.os.Looper.loop(Looper.java:123)
03-19 14:47:54.515: E/Database(335):    at android.app.ActivityThread.main(ActivityThread.java:3683)
03-19 14:47:54.515: E/Database(335):    at java.lang.reflect.Method.invokeNative(Native Method)
03-19 14:47:54.515: E/Database(335):    at java.lang.reflect.Method.invoke(Method.java:507)
03-19 14:47:54.515: E/Database(335):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-19 14:47:54.515: E/Database(335):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-19 14:47:54.515: E/Database(335):    at dalvik.system.NativeStart.main(Native Method)
  • 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-31T15:56:37+00:00Added an answer on May 31, 2026 at 3:56 pm

    Put a space after KEY_HOTNESS in the String where you create the database, so instead of:

    //...
    KEY_HOTNESS + "TEXT NOT NULL); "
    

    write:

       //...
       KEY_HOTNESS + " 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 that has been stumping me for a while, I wrote
I have had the following problem for a while and I am really not
I have the following code, but i got a problem. Within my While, a
I have a problem while comparing the values in two vectors. Following is the
I am getting invalid identifier problem while requesting for product information I have done
We have the following problem while running the git fsck --full --strict command: error:
I have the following problem while i scroll the table view: NSCFString objectAtIndex:]: unrecognized
I have some problem writing postgres functions in C++ while following the guides for
I have problem while using jquery maskedinput with asp.net textbox. I have a check
I have a problem while converting a string whose value is dd.mm.yyyy to DateTime

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.