I'll answer my own question, maybe it will be useful to someone else.
All the pictures are accessible via the android.provider.MediaStore
content provider.
You can write some code like this to list all the images captured on
the SDCard
protected void listAllImages()
{
// List the external media
Cursor cursor = getContentResolver().query
(Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);
startManagingCursor(cursor);
int idIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns._ID);
int dataIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.DATA);
int displayNameIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.DISPLAY_NAME);
int mimeTypeIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.MIME_TYPE);
int titleIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.TITLE);
int descriptionIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.DESCRIPTION);
int picasaIdIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.PICASA_ID);
int isPrivateIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.IS_PRIVATE);
int latitudeIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.LATITUDE);
int longitudeIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.LONGITUDE);
int orientationIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.ORIENTATION);
int miniThumbMagicIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.MINI_THUMB_MAGIC);
int bucketIdIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.BUCKET_ID);
int bucketDisplayNameIndex = cursor.getColumnIndexOrThrow
(Images.ImageColumns.BUCKET_DISPLAY_NAME);
if (cursor.moveToFirst())
{
do
{
Log.d(TAG, "ID: " + cursor.getInt(idIndex));
Log.d(TAG, "Data: " + cursor.getString(dataIndex));
Log.d(TAG, "displayName: " + cursor.getString
(displayNameIndex));
Log.d(TAG, "mimeType: " + cursor.getString
(mimeTypeIndex));
Log.d(TAG, "title: " + cursor.getString(titleIndex));
Log.d(TAG, "description: " + cursor.getString
(descriptionIndex));
Log.d(TAG, "picasaId: " + cursor.getString
(picasaIdIndex));
Log.d(TAG, "isPrivate: " + cursor.getInt
(isPrivateIndex));
Log.d(TAG, "latitude: " + cursor.getDouble
(latitudeIndex));
Log.d(TAG, "longitude: " + cursor.getDouble
(longitudeIndex));
Log.d(TAG, "orientation: " + cursor.getInt
(orientationIndex));
Log.d(TAG, "miniThumbMagic: " + cursor.getInt
(miniThumbMagicIndex));
Log.d(TAG, "bucketId: " + cursor.getString
(bucketIdIndex));
Log.d(TAG, "bucketDisplayName: " + cursor.getString
(bucketDisplayNameIndex));
Log.d(TAG, "---------------------------------------");
}
while (cursor.moveToNext());
}
cursor.close();
On Nov 20 2008, 7:40 pm, awbranch <[email protected]> wrote:
> I want to load the pictures taken from thecamerainto a Gallery view
> and allow the user to select one.
>
> I have a couple of questions.
>
> 1. Where do I find the pictures? Does thecamerastore them to a
> standard location?
>
> 2. How do I access the pictures? Is there a content provider, or can I
> read them from memory?
>
> Thanks in advance...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---