Home | History | Annotate | Download | only in topics
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "../dtd/reference.dtd">
      3 <reference id="u_db-database-explorer" xml:lang="en-us">
      4   <title>MOTODEV Database Explorer</title>
      5   <shortdesc>The MOTODEV Database Explorer lists all AVDs (Android Virtual Devices), connected devices, and your
      6     workspace and allows you to see and explore their SQLite databases. You can also use it to create and edit databases
      7     within projects in your current workspace.</shortdesc>
      8   <prolog>
      9     <metadata>
     10       <keywords>
     11         <!--<indexterm></indexterm>-->
     12       </keywords>
     13     </metadata>
     14   </prolog>
     15   <refbody>
     16     <section>
     17       <p>The MOTODEV Database Explorer lists all AVDs and connected devices. Note, however, that due to security
     18         constraints you can view or modify SQLite databases only on handsets intended for development use.
     19         Non-development handsets do not provide access to their databases.</p>
     20       <p>The MOTODEV Database Explorer consists of a tree view that lists the following:</p>
     21       <dl>
     22         <dlentry>
     23           <dt>Connected devices and running emulators</dt>
     24           <dd>These are listed first in the MOTODEV Database Explorer view. Note that all Android AVDs are listed, not
     25             just those that are running (AVDs listed with a disclosure triangle to the left of them are running; those
     26             without a disclosure triangle are not runing). Connected devices are listed, but once they are disconnected
     27             they are removed from the list. If the connected device or running emulator contains an SD card, disclosing
     28             the device's applications also lists "External Storage"; you can map the databases on the device's SD card
     29             for browsing or editing without having to mount the SD card for USB access.</dd>
     30         </dlentry>
     31         <dlentry>
     32           <dt>Projects in your current workspace</dt>
     33           <dd>Within the entry labeled "Workspace" are all of the Android projects found within your current workspace.
     34             Those listed with a disclosure triangle to the left contain a database. Those without a disclosure triangle
     35             do not currently contain a database (although you can add one).</dd>
     36         </dlentry>
     37         <dlentry>
     38           <dt>Databases outside your current workspace that you have mapped</dt>
     39           <dd>The "Filesystem" grouping in the MOTODEV Database Explorer view lists additional SQLite databases that you
     40             have "mapped" into the view. This allows you to work with databases that are outside of your current
     41             workspace. In particular, you can connect an Android handset to your development computer, mount its SD card
     42             for USB access, and then map any databases on that SD card. You can then browse and edit those databases as
     43             you would any other.</dd>
     44         </dlentry>
     45       </dl>
     46       <p>You must connect to a database in order to view or modify its contents. When you connect to a database, a copy
     47         of that database is made in your computer's Temp directory (if desired, you can change where this temporary copy
     48         is made; see the MOTODEV Studio preferences). It is that copy that you view and edit. It is important to note
     49         that changes you make to a database in MOTODEV Studio for Android are made to this local copy of the database;
     50         only when you save your changes is the database copied back to the device or AVD.</p>
     51       <p>The MOTODEV Database Explorer also provides the following controls:</p>
     52       <simpletable>
     53         <strow>
     54           <stentry><image href="../images/collapse-all.png"/></stentry>
     55           <stentry>Collapse All</stentry>
     56           <stentry>Collapses the tree so that only the root nodes are showing.</stentry>
     57         </strow>
     58         <strow>
     59           <stentry><image href="../images/refresh-sdks.png"/></stentry>
     60           <stentry>Refresh</stentry>
     61           <stentry>Re-scans the filesystem, workspace, and any running or connected devices looking for accessible
     62             databases.</stentry>
     63         </strow>
     64         <strow>
     65           <stentry><image href="../images/db-create-table.png"/></stentry>
     66           <stentry>Create table</stentry>
     67           <stentry>Defines a new table within a database</stentry>
     68         </strow>
     69         <strow>
     70           <stentry><image href="../images/db-create-classes.png"/></stentry>
     71           <stentry>Create Database Management Classes </stentry>
     72           <stentry>Creates classes you can use to manage and access your application's database: content providers for
     73             each of the database's tables, and a SQL open helper that can create and if desired initialize your database
     74             at runtime.</stentry>
     75         </strow>
     76         <strow>
     77           <stentry><image href="../images/browse-table-contents.png"/></stentry>
     78           <stentry>Browse or edit table contents</stentry>
     79           <stentry>Only active when a table is selected, this control presents the contents of the table in an editor
     80             view, formatted much like a spreadsheet, with rows representing records and columns representing the fields
     81             within each record. </stentry>
     82         </strow>
     83         <strow>
     84           <stentry><image href="../images/open-scrapbook.png"/></stentry>
     85           <stentry>Open scrapbook to edit SQL statements</stentry>
     86           <stentry>Opens the SQL Scrapbook editor, from which you can execute arbitrary SQL statements.</stentry>
     87         </strow>
     88       </simpletable>
     89     </section>
     90     <section>
     91       <title>Filtering the MOTODEV Database Explorer view</title>
     92       <p>The Devices list initially shows all apps on each connected device (if accessible) or running emulator.
     93         Right-click the device name and select <b>Filter applications without db</b> to eliminate those apps that don't
     94         have SQLite databases. The resulting list will then only list applications that have SQLite databases.</p>
     95     </section>
     96   </refbody>
     97 </reference>
     98