Note that there are some explanatory texts on larger screens.

plurals
  1. POdate problem (DATE_TAKEN) for images/pictures/jpg in android
    primarykey
    data
    text
    <p>I have gonethrough the following <a href="https://stackoverflow.com/questions/4195660/get-list-of-photo-galleries-on-android">answered question</a> in Stackoverflow link. which has this codes as shown below. </p> <p>Here I'm interested on the DATE_TAKEN part of the image. I have tried this code and it is working perfectly except for the date. It is giving out some numbers in the logcat... For eg: An image whose' date_taken is 26th November 2007, the date shown Log.i is "<strong>1196066358000</strong>". Is there any way to parse this back to a real date format. </p> <pre><code>String[] projection = new String[]{ MediaStore.Images.Media._ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME, MediaStore.Images.Media.DATE_TAKEN }; // Get the base URI for the People table in the Contacts content provider. Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; // Make the query. Cursor cur = managedQuery(images, projection, // Which columns to return "", // Which rows to return (all rows) null, // Selection arguments (none) "" // Ordering ); Log.i("ListingImages"," query count="+cur.getCount()); if (cur.moveToFirst()) { String bucket; String date; int bucketColumn = cur.getColumnIndex( MediaStore.Images.Media.BUCKET_DISPLAY_NAME); int dateColumn = cur.getColumnIndex( MediaStore.Images.Media.DATE_TAKEN); do { // Get the field values bucket = cur.getString(bucketColumn); date = cur.getString(dateColumn); // Do something with the values. Log.i("ListingImages", " bucket=" + bucket + " date_taken=" + date); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload