1. Are you ready for the Galaxy S20? Here is everything we know so far!

SQLite Programming

Discussion in 'Android Development' started by Lyncheese, Jul 23, 2013.

  1. Lyncheese

    Lyncheese Lurker
    Thread Starter

    Hello, i have tried many tutorial and always find the same problems. I dont know why but somehow my adt didnt create any database folder.

    Here is the code i used :

    package com.example.test;

    import android.app.Activity;
    import android.database.Cursor;
    import android.database.sqlite.SQLiteDatabase;
    import android.os.Bundle;
    import android.util.Log;

    public class haha extends Activity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    SQLiteDatabase db = openOrCreateDatabase("MyDB", MODE_PRIVATE, null);
    db.execSQL("CREATE TABLE IF NOT EXISTS Haha (Email VARCHAR, FirstName VARCHAR, LastName VARCHAR);");
    db.execSQL("INSERT INTO Haha VALUES('haha.com','anita','bobo');");
    db.close();
    }
    }

    My problem is, i cant find databases folder from file explorer through DDMS.



    Any clue ???

    THX before
     


  2. Lyncheese

    Lyncheese Lurker
    Thread Starter

    Help me pleaseeeee......

    >data
    ------>data
    ------------>com.example.test
    ---------------> cache
    ---------------> lib
    ---------------> (it should be here right ?)

    no databases folder made.......
     
  3. out of ideas

    out of ideas Android Enthusiast

    Have you tried it on a device?
     
  4. Lyncheese

    Lyncheese Lurker
    Thread Starter

    I tried, with Samsung ACE with Gingerbread. I cant see the data folder inside since it's not rooted. But i doubt it's exist there, because i use toast to take the data inserted and nothing come out......
     
  5. out of ideas

    out of ideas Android Enthusiast

    Lyncheese likes this.
  6. Lyncheese

    Lyncheese Lurker
    Thread Starter

    Okay then... Thank you very much for your attention (^^)b
     
  7. Lyncheese

    Lyncheese Lurker
    Thread Starter

    Just Information. I solved this problem myself. I dont know exactly what is the problem, but CHANGE YOUR ADT BUNDLE will SOLVED this... I'm using adt bundle 20130522 before, but then i change to adt bundle 20130717. And it works... Good Luck !!!!
     
Loading...

Share This Page

Loading...