• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps SQLite Programming

Lyncheese

Lurker
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
 
Help me pleaseeeee......

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

no databases folder made.......
 
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......
 
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 !!!!
 
Back
Top Bottom