android - Getting SQLite database and storing it in an array of objects -


i'm looking @ notes app example android sdk. want learn how instead of using cursoradapter pass listadpater/listview sort out, want know how can deal data myself; particularly in arraylist form. in example, note has id, title, , body. want know how can query sqlite database , use cursor returns collect data , create object instances of object i'll call note has parameters id, title, , body. want store these objects arraylist management. i'm not sure how deal cursor. pretty general question need point me in right direction.

i might not question need query db add cursor data arraylist?

    list<string> pointslist = new arraylist<string>();     database = openorcreatedatabase("favorites", sqlitedatabase.open_readwrite, null);     if(database!=null)     {         c= database.rawquery(query, null);         c.movetofirst();         while(c.isafterlast()==false)         {             pointslist.add(c.getint(c.getcolumnindex("id")); // same other columns             c.movetonext();         }      }    database.close();    c.close(); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -