Hi i'm new to android development.So i have comeup with a simple dictionary application.It should connects with sqlite database and show the meaning of an english word, when button clicks.The user enter the relevant word into a Edittext field and click the translate button.Then it should show the meaning on the same Edittext field.But in my code there is some problem.I can't find it.Other thing is my sqlite database size is 1.2 MB.Is it large for the android?It is in my assets folder.This is my code.Please help me to solve this.thanks...

package first.cdef.proj;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.database.sqlite.SQLiteDatabase;
import android.database.Cursor;

public class Translator_page extends Activity {

    // Constants
     public static final String DATABASE_NAME = "Word_reduced.sqlite";
     public static final String TABLE_NAME = "WORD";
     //public static final String COLUMN_ID = "ID";
     public static final String COLUMN_ENGLISH = "ENGLISH";
     public static final String COLUMN_MEANS = "MEANS";

     private SQLiteDatabase newwordDB;

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

        Button nnext = (Button) findViewById(R.id.button3);
        final EditText mEdit = (EditText)findViewById(R.id.editText1);

                 nnext.setOnClickListener(new View.OnClickListener() {
                  public void onClick(View view) {
                      String name = mEdit.getText().toString();

                    // Retrieve the new list of scores
                        Cursor c = newwordDB.query(TABLE_NAME, new String[] {
                                COLUMN_MEANS}, "COLUMN_ENGLISH like " +"%"+name+"%",
                                null, null, null, null,

                        StringBuilder builder = new StringBuilder();

                        if (c != null) {
                         // Loop through all Results
                         do {

                        //mEdit.loadData(builder.toString(), "text/html", "UTF-8");
                        // Close the cursor




    protected void onResume() {
     newwordDB = openOrCreateDatabase(DATABASE_NAME,
         | SQLiteDatabase.OPEN_READWRITE, null);
     newwordDB.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " ("
       + " TEXT, " + COLUMN_MEANS + " TEXT)");

    protected void onPause() {

     if (newwordDB.isOpen()) {



But in my code there is some problem.I can't find it.

Does it throws an exception? if yes then post logcat here. Please take a look at tutorial by Lars Vogel - Android SQLite Database and ContentProvider - Tutorial

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.