title: Android ExpandableListView and SQLite Database
body: <p>I have two tables in my database - rooms and devices. Each room can have many devices. I want to make an expandable listview with room name as group and devices name and state as children (on or off). </p>
  
  <p>Can any one give me a simple idea because I am kind of new with Android and all tutorials are hard to make</p>
  
  <p>This is my database:</p>
  
  <pre><code>public void onCreate(SQLiteDatabase db) {
          db.execSQL("create table if not exists rooms (
                                      id_room integer primary key autoincrement, "
                  + "name_room text not null" 
                  + ");");    
          db.execSQL("create table if not exists devices (
                                      id_device integer primary key autoincrement, "
                  + "name_device text not null," 
                  + "state_device text not null,"
                  + "id_room references rooms"
                  + ");");
      }
  </code></pre>