0

I am building a module in which i have to show all the images arranged time wise. the images should be arranged under tags like :-
-Recent
-Last Week
-Last Month and so on.

i have seen WhatsApp is doing the same .. when you try to attach any media file from and select gallery for selecting file .. it shows the media arranged in same fashion.

can it be done using default inbuilt android gallery or i have to right it from scratch. till now i have almost completed the module but i am facing some UI issues.

Is there any flag which i should pass while calling gallery to show the image in the order i want ?

Any leads on this is appreciated !!

Thanks :)

r4jiv007
  • 2,974
  • 3
  • 29
  • 36
  • You have to use media content provider and get the save date and time of image. Once you got the above you can manage by using and date time functionality. – Amit Sep 17 '13 at 07:27
  • i am doing the same .. but its not coming up that smooth like in whatsapp – r4jiv007 Sep 17 '13 at 07:29
  • okay, Please manage the widget using the Gallary – Amit Sep 17 '13 at 07:30
  • Check the below links http://learnandroideasily.blogspot.in/2013/07/android-gallery-view-example.html http://stackoverflow.com/questions/9430738/androidshow-images-in-gallery http://moorandroid.blogspot.in/p/gallery-view.html – Amit Sep 17 '13 at 07:33
  • i dont think Gallery is suitable here as it scrolls horizontally and i have to arrange the image in grid fashion .. for that i am using table layout and adding rows dynamically. i cannot use grid view because i have to show multiple categories based on time... and Gallery View is deprecated !! – r4jiv007 Sep 17 '13 at 07:42

1 Answers1

0

There is no inbuilt Intent. But you can get it by writing from scratch.

 String[] projection = new String[] { MediaStore.Images.Media._ID,
                            MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
                            MediaStore.Images.Media.DATE_TAKEN, MediaStore.Images.Media.DATA };
                    // 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)
                            MediaStore.Images.Media.BUCKET_DISPLAY_NAME + " ASC" 
Developer
  • 6,292
  • 19
  • 55
  • 115
Madhu
  • 298
  • 1
  • 12
  • first thing .. i have almost written it but not getting proper ui thats why i wanted to use default Gallery. second thing .. managedQuery() is deprecated !! – r4jiv007 Sep 17 '13 at 07:52