How to get all the images on the device (especially the SDK) on Android (2.1 or higher)

I followed the tutorial here: http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-of-images.html and also another one that has almost identical code, and I am having some problems / inconsistencies in the way images are processed on different devices.

My image collection code:

private void init_phone_image_grid() {
    String[] img = { MediaStore.Images.Thumbnails._ID };
    Uri uri = MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI;
    imagecursor = managedQuery(uri, img, null,
            null, MediaStore.Images.Thumbnails.IMAGE_ID);
    image_column_index = imagecursor
            .getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);
    count = imagecursor.getCount();
    imagegrid = (GridView) findViewById(R.id.PhoneImageGrid);
    imagegrid.setAdapter(new ImageAdapter(getApplicationContext()));
    imagegrid.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView parent, View v, int position,
                long id) {
            System.gc();
            String[] proj = { MediaStore.Images.Media.DATA };
            actualimagecursor = managedQuery(
                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, proj,
                    null, null, null);
            actual_image_column_index = actualimagecursor
                    .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
            actualimagecursor.moveToPosition(position);
            String i = actualimagecursor
                    .getString(actual_image_column_index);
            System.gc();
            Intent intent = new Intent(getApplicationContext(),
                    EvidenceImageView.class);
            intent.putExtra("filename", i);
            startActivity(intent);
        }
    });
}

, Android 2.2, sdcard . adb ( ). , . , Gallery, , , . HTC thunberbolt, (/sdcard/DCIM/100MEDIA) - ( , ). , , , sdcard. , , / . , HTC, , .. , ..

Android , . , facebook, , , , htc, .. , ( , ).. , ... Camera, Android:

https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera

, .

, , . , , , ( ). , .

+3
1

, , , htc, .. ,

:

(SD-) ?

+1

All Articles