title: How to retrieve data from database in android Creating database on SqliteBrowser
body: <p>I have <strong>jokes.db</strong> database. This database file imported from using this article., <a href="http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/" rel="nofollow">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/</a>. Now i have <strong>Jokes.db</strong> in to  <strong>/data/data/a.b.c/database/Jokes.db</strong>. In this database , I have two table <strong>NepaliJokes</strong> and <strong>EnglishJokes</strong>. So Now I want to retrive this nepali and english jokes and display in to textview, But I have done following code but couldnot more idea behind How to retrieve data from database.</p>
  
  <pre><code>public class FunnyJokes extends Activity implements View.OnClickListener {
  private SQLiteDatabase database;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      Button back;
      super.onCreate(savedInstanceState);
      setContentView(R.layout.displayjoks1);
  
      back = (Button) findViewById(R.id.back_btn);
      back.setOnClickListener(this);
  
      DataBaseHelper helper = new DataBaseHelper(this);
      database = helper.getWritableDatabase();
      loadJokes();
  }
  
  private void loadJokes() {
       //jok=new ArrayList&lt;String&gt;();
        /*Cursor c = database.query("SELECT title,body" +
                                               " FROM " + 'tableName'
                                               + " WHERE category=1;",
                                               null);*/
       Cursor c = database.query("NepaliJokes", 
                  null, null, null, null, null, null);
  
   c.moveToPosition(0);
   TextView tv= (TextView) findViewById(R.id.textView1);
   tv.append(c.getString(1));
   c.close();
  }
  
  @Override
  public void onClick(View v) {
      switch (v.getId()) {
      case R.id.back_btn:
          FunnyJokes.this.finish();
          break;
  
      default:
          break;
      }
  
  }
  }
  </code></pre>
  
  <p>I also use the database file import from in DDMS->fileExploer. I import database file Pull mobile icon from left of file explorer section.</p>