title: How to view Android SQLLite database on emulator
body: <p>I've looked at answers to previous questions on this topic, but can't seem to get any of them to work.  I am developing in Eclipse, and running the app on an emulator.  </p>
  
  <p>It seems like the simplest approach is to use the <code>adb</code> shell in conjunction with the sqlite3 command.  With adb I can see the emulator device.  When I start the adb shell, I see a directory which is where I would expect to find the database:</p>
  
  <pre><code>/data/data/com.example.myfirstapp/databases/  (where com.example.myfirstapp is the package name of the app)
  </code></pre>
  
  <p>However, there are no <code>.db</code> files in that directory.  There is a file with the same name as the database the app created, but it does not have the <code>.db</code> extension.  </p>
  
  <p>(I'm pretty sure I am seeing the file system of the emulated device because it does have the directory for my application).</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After going through all the responses, and accessing the database via adb/sqlite3 and also using DDMD/Sqlite browser, I realized I made a "newbie" mistake in the code:</p>
  
  <pre><code>public class MessageOpenHelper extends SQLiteOpenHelper {
      public static final String DATABASE_NAME = "MyFirstApp.db"; 
      public static final String MESSAGE_COLUMN = "message";
      public static final String MESSAGE_TABLE_NAME = "messages";   
  
      private static final String MESSAGE_TABLE_CREATE = String.format("create table %s (%s TEXT);", MESSAGE_TABLE_NAME, MESSAGE_COLUMN);
  
      public MessageOpenHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);      
      }
  </code></pre>
  
  <p>By convention, the database name should include the <code>.db</code> extension.  Although it works fine without it, the Sqlite browser for Eclipse won't recognize the file.   Hopefully other neophytes like me won't make the same mistake.</p>