1. Download our Official Android App: Forums for Android!

Apps SQLite Programming

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

  1. Lyncheese

    Lyncheese Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Jul 23, 2013

    Jul 23, 2013
    5
    0
    5
    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
     

    Advertisement

  2. Lyncheese

    Lyncheese Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Jul 23, 2013

    Jul 23, 2013
    5
    0
    5
    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
    Rank:
    None
    Points:
    93
    Posts:
    640
    Joined:
    May 19, 2012

    May 19, 2012
    640
    145
    93
    Have you tried it on a device?
     
  4. Lyncheese

    Lyncheese Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Jul 23, 2013

    Jul 23, 2013
    5
    0
    5
    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
    Rank:
    None
    Points:
    93
    Posts:
    640
    Joined:
    May 19, 2012

    May 19, 2012
    640
    145
    93
    Lyncheese likes this.
  6. Lyncheese

    Lyncheese Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Jul 23, 2013

    Jul 23, 2013
    5
    0
    5
    Okay then... Thank you very much for your attention (^^)b
     
  7. Lyncheese

    Lyncheese Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Jul 23, 2013

    Jul 23, 2013
    5
    0
    5
    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 !!!!
     

Share This Page

Loading...