Here is some code that I wrote to get information about the last image
added to the gallery... While it isn't exactly what you want, it should
give you enough information to get started.
Oh, and one other thing to note... This code was written in C# using
MonoForAndroid. It should be pretty straightforward to convert it to Java
though:
private Android.Net.Uri GetLastImageUri()
{
Android.Net.Uri resultUri = null;
Android.Net.Uri locUri =
MediaStore.Images.Media.ExternalContentUri;
string[] fields = { MediaStore.Images.ImageColumns.Id };
string sort = MediaStore.Images.ImageColumns.DateTaken + "
DESC";
ICursor imgCursor = Context.ContentResolver.Query(locUri,
fields, null, null, sort);
if (imgCursor != null)
{
if (imgCursor.Count > 0)
{
imgCursor.MoveToFirst();
long id = imgCursor.GetLong(imgCursor.GetColumnIndex(
MediaStore.Images.ImageColumns.Id));
resultUri = ContentUris.WithAppendedId(locUri, id);
}
imgCursor.Close();
}
return resultUri;
}
Hope that helps, or at least points you in the right direction...
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware
On Mon, Jun 11, 2012 at 7:47 AM, Harri Smått <[email protected]> wrote:
> Ah, I see. I think there's an API for accessing gallery database but guess
> there's people with more knowledge on this than myself.
>
> --
> H
> On Jun 11, 2012 4:23 PM, "Vijay Krishnan" <[email protected]>
> wrote:
>
>> i want to load images from gallery without using gallery intent
>>
>> On Mon, Jun 11, 2012 at 6:45 PM, Vijay Krishnan <[email protected]
>> > wrote:
>>
>>> Thank U Harri
>>>
>>>
>>> On Mon, Jun 11, 2012 at 6:44 PM, Harri Smått <[email protected]> wrote:
>>>
>>>> Check gallery Intent. Shouln't be a problem to find example code.
>>>>
>>>> --
>>>> H
>>>> On Jun 11, 2012 4:00 PM, "Vijay Krishnan" <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi all,
>>>>> How to load images from gallery in my app.
>>>>> Thanks,
>>>>> vijay.k
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Android Developers" 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-developers?hl=en
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Developers" 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-developers?hl=en
>>>>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" 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-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" 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-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en