Android Open Source - Wordilizer My Database






From Project

Back to project page Wordilizer.

License

The source code is released under:

Apache License

If you think the Android project Wordilizer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.wordilizer;
//  www  .  j a  v a  2  s. c  o  m

import com.readystatesoftware.sqliteasset.SQLiteAssetHelper;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;



public class MyDatabase extends SQLiteAssetHelper {

  private static final String DATABASE_NAME = "wordsdb";
  private static final int DATABASE_VERSION = 21;

  public MyDatabase(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    setForcedUpgrade();

    // you can use an alternate constructor to specify a database location 
    // (such as a folder on the sd card)
    // you must ensure that this folder is available and you have permission
    // to write to it
    //super(context, DATABASE_NAME, context.getExternalFilesDir(null).getAbsolutePath(), null, DATABASE_VERSION);

  }

  public Cursor getEmployees() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdb";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }
  
  
  public Cursor getEmployees800() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdb800";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }
  
  
  public Cursor getEmployees4000() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdb4000";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }
  
  
  public Cursor getEmployeesEasy() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdbeasy";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }

  
  public Cursor getEmployeesMedium() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdbmedium";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }

  
  public Cursor getEmployeesDifficult() {

    SQLiteDatabase db = getReadableDatabase();
    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();

    String [] sqlSelect = {"_id", "words", "Meaning"}; 
    String sqlTables = "wordlistdbdifficult";

    qb.setTables(sqlTables);
    Cursor c = qb.query(db, sqlSelect, null, null,
        null, null, null);

    c.moveToFirst();
    return c;

  }
}




Java Source Code List

com.wordilizer.AboutUs.java
com.wordilizer.DataBaseHelper.java
com.wordilizer.DataBig.java
com.wordilizer.DeckSize.java
com.wordilizer.DictionaryDatabase.java
com.wordilizer.DictionaryProvider.java
com.wordilizer.Easy.java
com.wordilizer.GitHub4000.java
com.wordilizer.GitHub800.java
com.wordilizer.GitHubDifficult.java
com.wordilizer.GitHubEasy.java
com.wordilizer.GitHubMedium.java
com.wordilizer.GitHub.java
com.wordilizer.MainActivity.java
com.wordilizer.Menu.java
com.wordilizer.MyDatabase.java
com.wordilizer.Progress.java
com.wordilizer.SearchableDictionary.java
com.wordilizer.SpecialList.java
com.wordilizer.Splash.java
com.wordilizer.WordActivity.java
com.wordilizer.WordShow.java