I am developing an application which will help the user view the "local sd
card images" in web view.

Do we have some better way of displaying sd card images in web view?.

Thanks and regards,
Ankur

On Wed, Dec 21, 2011 at 8:47 AM, Duygu Kahraman
<duygu.kahram...@gmail.com>wrote:

> What do you want to do? Which picture you are storing? İf you can
> explain,we can learn this is the correct way or not?
>
> 21 Aralık 2011 17:44 tarihinde alexb <alexboot...@gmail.com> yazdı:
>
> Why not storing the files on sdcard and passing only the names?
>>
>> On Dec 19, 7:01 pm, Ankur Avlani <ankuravl...@gmail.com> wrote:
>> > Hi All ,
>> >
>> > I am developing an application in WebView.  We serve android sd card
>> images
>> > (average 3 MB per image) using ContentProvider in web view.  Please see
>> the
>> > sample code below:
>> >
>> > public class LocalImageContentProvider extends ContentProvider {
>> >     @Override
>> >     public ParcelFileDescriptor openFile(Uri uri, String mode) throws
>> > FileNotFoundException {
>> >         try {
>> >             String path = uri.getPath();
>> >             File file = new File(path);
>> >
>> >             ParcelFileDescriptor parcel =
>> ParcelFileDescriptor.open(file,
>> > ParcelFileDescriptor.MODE_READ_ONLY);
>> >             return parcel;
>> >         } catch (IOException e) {
>> >             // TODO Auto-generated catch block
>> >
>> >             e.printStackTrace();
>> >         }
>> >         return null;
>> >     }
>> >
>> > }
>> >
>> > This works fine for the first 50-60 images.  But when i start browsing
>> more
>> > images, I see that the memory increaseing and Android starts closing
>> > background process to free up memory and finally the core process
>> shutsdown
>> > and my app crashes.
>> >
>> > Question is, is there anything that I need to add in the above code to
>> make
>> > is more robust and not occupy unnecessary memory.
>> >
>> > Thanks and regards
>> > Ankur
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> ---
> Duygu Kahraman
>
> http://tr.linkedin.com/in/duygukahramann
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to