android-developers - 26 new messages in 16 topics - digest

by Bartolo Illiano » Thu, 10 Sep 2009 06:26:38 GMT


Sponsored Links
 Who use a Titanium Developer for buld android apps ?

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How do I make a ListView scrollbar expand whilst scrolling?

Use this:
http://developer.android.com/reference/android/widget/AbsListView.html#attr_android:fastScrollEnabled






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

2. Should I use Cursors, or and Object[] to return data from a DB

So I have a database with 2 tables. One is the Polygon table, and each  
row in Polygon can map to multiple rows in the Points table. I want a  
fetchAllPolygons function, similar to the sample Notepad application.  
I could do something like this (I could make it better, but that's the  
main point):

     /**
      * Return a Cursor over the list of all notes in the database
      *
      * @return Cursor over all notes
      */
     public Cursor fetchAllPolys() {

         return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID,  
KEY_TITLE
                }, null, null, null, null, null);
     }

     public Cursor fetchAllPolyPoints() {

         return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID,  
KEY_X,
                 KEY_Y}, null, null, null, null, null);
     }

but that is 1) a pain, and 2) I don't want the rest of my application  
to have to understand the database layout. I don't know of a  
CursorAdapter that will do the transforms I am looking for, so I will  
write them myself.

So, the question - I am thinking of simply subclassing the Polygon, to  
create a DatabasePolygon, with all of the calls simply being the  
correct callthru's to the Cursor. I am thinking that this will still  
preserve the usefulness of Cursors, will use very low memory because  
they are wrapper classes, and will allow the rest of my application to  
never know anything about the database, simply about Polygon.

Thoughts?

Thanks,
Hamilton
--~--~---------~--~----~------------~-------~--~----~

3. Android Dev Phone 1 activation Problem

4. Question on ContentProviders

5. List items not clickable when using ListAdapter, but clickable with SimpleAdapter

6. updating an AlertDialog after it was created when the AlertDialog displays an array as a list

7. Do Cursor s stay valid across database changes?