Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find my .db file in sqlite?
    primarykey
    data
    text
    <p>I created a database called "enigmeDB" and a table "table_enigme":</p> <pre><code>public class EnigmeDatabase extends SQLiteOpenHelper { private static final int DATABASE_VERSION = 1; private static final String DATABASE_NAME = "enigmeBD"; private static final String TABLE_ENIGME = "table_enigme"; // fields private static final String KEY_ID = "id"; private static final String KEY_DESCRIPTION = "description"; private static final String KEY_REPONSE="reponse"; private static final String KEY_CATEGORIE="categorie"; public EnigmeDatabase(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } // creation of the table @Override public void onCreate(SQLiteDatabase db) { String CREATE_ENIGME_TABLE = "CREATE TABLE " + TABLE_ENIGME + "(" + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_DESCRIPTION + " TEXT," + KEY_REPONSE + " TEXT," + KEY_CATEGORIE + "TEXT" + ")"; db.execSQL(CREATE_ENIGME_TABLE); } // Update @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + TABLE_ENIGME); onCreate(db); }.... </code></pre> <p>When I open my DDMS perspective and open the file explorer: /data/data/com.android.enigme (my package) I find "enigmeDB" but I don't find "table_enigme".</p> <p><img src="https://i.stack.imgur.com/lZH1d.png" alt="enter image description here"></p> <p>Although in Sqlite database browser my table looks empty:</p> <p><img src="https://i.stack.imgur.com/ErwyS.png" alt="enter image description here"></p> <hr> <p>I insert data from an Activity , here is my class : </p> <p>public class EnigmeActivity extends Activity {</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //recuperation des champs depuis main.xml final EditText description=(EditText) this.findViewById(R.id.description); final EditText reponse=(EditText)this.findViewById(R.id.reponse); final EditText categorie=(EditText)this.findViewById(R.id.categorie); Button ajouter = (Button)this.findViewById(R.id.ajouter); final EnigmeDatabase db=new EnigmeDatabase(this); ajouter.setOnClickListener(new OnClickListener() { public void onClick(View v) { Log.d("Etape : " , "Recuperation"); Log.i("description : ", description.getText().toString()); Log.i("reponse : ", reponse.getText().toString()); Log.i("categorie : ", categorie.getText().toString()); //add a new Enigme Log.d("Etape : ","Insertion" ); db.ajouterEnigme(new EnigmeBean(description.getText().toString(),reponse.getText().toString(),categorie.getText().toString())); Toast.makeText(EnigmeActivity.this, "Ajout avec succes!", Toast.LENGTH_SHORT).show(); } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload