Display multiple images from a remote source in a gallery (zoomable+pannable)

by legr3c » Wed, 02 Jun 2010 08:23:35 GMT


Sponsored Links
 I want do display some images that I load from a remote source in a
gallery. The gallery should let the user do the following things:

-zoom the image (preferably also by pinch-zoom)
-pan the image
-switch between the different images

Of course most built-in gallery applications can do all of that. So my
first idea was to use an  ACTION_VIEW intent in order to delegate the
task to some gallery application. This however won't work for me since
you can only pass the URI of the image you want to display but not the
actual bitmap data itself. I can't just pass the URL of the remote
image because I need to manage the loading and caching of the data
myself.
A way around this would be to write the data to a local file and then
pass the URI of that file (and deleting the file again afterward).
Besides this being less than elegant it won't even do the trick
because with an intent like this you can only pass one image at a
time.

The built-in Facebook application on the Nexus One actually does
exactly what I have in mind for displaying photo albums. It looks like
a custom gallery activity they built into their application. Does
anyone know whether there are templates available for something like
this somewhere that one could reuse? Building something like this from
scratch by myself seems too time consuming.

I think that what I want to do is a fairly common task, yet I haven't
been able to find a satisfactory solution.
I would be very glad for any hints on how this could be accomplished!

--



Other Threads

1. Mounting an extra partition in Android

I'm trying to create an additional vfat partition, and mount it under
the root as something like '/public' (this partition will eventually
appear as an external drive on the user's system when USB is connected
to the Android device).

This partition would eventually be mapped into flash memory, but in
the emulator I would just create an image file for it.  I used
mksdcard (since it creates a vfat partition) to generate a 64M
pubdata.img, and placed the file in the avd folder.

Next I modified /init.rc to mount the partition:

|    mkdir /public 0000 system system
|
|    # Mount public data partition
|    mount vfat m...@pubdata /public nosuid nodev
|    chown system system /public
|    chmod 0777 /public

...so now the question is "how does 'm...@pubdata' get resolved"?

I've searched the source code and found where the mapping between
'mtd@<token>' and a partition number takes place (system/core/init/
builtins.c), but I don't know how the map itself gets populated.

Can anyone shed some light on this?

Thanks in advance.

-INTJ

(BTW - sorry for the crosspost, I realized too late I originally
posted to the wrong group)

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Trying to add an additional partition - must be missing something...

I'm trying to create an additional vfat partition, and mount it under
the root as something like '/public' (this partition will eventually
appear as an external drive on the user's system when USB is connected
to the Android device).

This partition would eventually be mapped into flash memory, but in
the emulator I would just create an image file for it.  I used
mksdcard (since it creates a vfat partition) to generate a 64M
pubdata.img, and placed the file in the avd folder.

Next I modified /init.rc to mount the partition:

|    mkdir /public 0000 system system
|
|    # Mount public data partition
|    mount vfat m...@pubdata /public nosuid nodev
|    chown system system /public
|    chmod 0777 /public

...so now the question is "how does 'm...@pubdata' get resolved"?

I've searched the source code and found where the mapping between
'mtd@<token>' and a partition number takes place (system/core/init/
builtins.c), but I don't know how the map itself gets populated.

Can anyone shed some light on this?

Thanks in advance.

-INTJ

-- 

3. Which Flavour of Linux

4. Socket connection timeout while disable Wi-Fi

5. New Contacts AP

6. Using MediaPlayer best practices?

7. DDMS Heap debug