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. unable to play rtsp video (H.264) stream in Froyo using MediaPlayer

I have an app that worked fine on Android 2.1 (Eclair) but is no
longer working in 2.2.1 (Froyo).  I think this may have to do with the
shift from OpenCore to StageFright for video encoding and decoding,
but am unsure.

The debug logs show two things I'm not sure about:
* Does this mean H.264 baseline is not supported? WARN/QCvdec(59):
Parsing Error unsupported profile or level
* No idea about: ERROR/PVOMXVidDecNode(59): Ln 1373 OMX_EventError
nData1 -2147479542 nData2 0

Play the following url (it works fine in VLC, for example):
rtsp://nexus3.dropcam.com/6821ec44e37846428850ec195d69969a

The code:
String playUrl = "rtsp://nexus3.dropcam.com/
6821ec44e37846428850ec195d69969a";
private VideoView videoView = null;
videoView = (VideoView) findViewById(R.id.video_view);
videoView.setVideoURI(Uri.parse(playUrl));
videoView.setVisibility(View.VISIBLE);
videoView.start();
videoView.requestFocus();

The debug result:

10-03 19:59:34.430: INFO/camera(5390): starting video at
rtsp://nexus3.dropcam.com/6821ec44e37846428850ec195d69969a
10-03 19:59:34.430: INFO/ActivityManager(85): Starting activity:
Intent { cmp=com.dropcam.helloandroid/.VideoActivity (has extras) }
10-03 19:59:34.630: DEBUG/MediaPlayer(5390): Couldn't open file on
client side, trying server side
10-03 19:59:34.851: INFO/ActivityManager(85): Displayed activity
com.dropcam.helloandroid/.VideoActivity: 404 ms (total 404 ms)
10-03 19:59:35.243: WARN/QCvdec(59): get_parameter: unknown param
0ff7a347
10-03 19:59:35.467: INFO/PlayerDriver(59): buffering (0)
10-03 19:59:39.590: WARN/QCvdec(59): H264_Utils::check_header
10-03 19:59:39.590: WARN/QCvdec(59): check_header: start code 22
10-03 19:59:39.590: WARN/QCvdec(59): H264_Utils::check_header
10-03 19:59:39.590: WARN/QCvdec(59): check_header: start code 8
10-03 19:59:39.590: WARN/QCvdec(59): Parsing Error unsupported profile
or level
10-03 19:59:39.590: WARN/QCvdec(59): FA: Setting Tail to NULL
10-03 19:59:39.590: WARN/MediaPlayer(5390): info/warning (1, 44)
10-03 19:59:39.590: INFO/MediaPlayer(5390): Info (1,44)
10-03 19:59:39.600: DEBUG/MediaPlayer(5390): getMetadata
10-03 19:59:39.600: INFO/PlayerDriver(59): Live Streaming ...
10-03 19:59:39.600: ERROR/PVOMXVidDecNode(59): Ln 1373 OMX_EventError
nData1 -2147479542 nData2 0
10-03 19:59:39.610: WARN/QCvdec(59): WARNING:Rxd DeInit,OMX not in
LOADED state 0
10-03 19:59:39.610: WARN/QCvdec(59): free_buffer on i/p port - pBuffer
429a6008
10-03 19:59:39.610: WARN/QCvdec(59): free_buffer on i/p port - pBuffer
42a17008
10-03 19:59:39.610: WARN/QCvdec(59): free_buffer on i/p port - pBuffer
42a88008
10-03 19:59:39.610: WARN/QCvdec(59): free_buffer on i/p port - pBuffer
42af9008
10-03 19:59:39.610: WARN/MediaPlayer(5390): info/warning (1, 26)
10-03 19:59:39.620: ERROR/PlayerDriver(59): HandleErrorEvent:
PVMFErrResourceConfiguration
10-03 19:59:39.620: ERROR/MediaPlayer(5390): error (1, -16)
10-03 19:59:39.690: WARN/PlayerDriver(59):
PVMFInfoErrorHandlingComplete
10-03 19:59:39.720: INFO/MediaPlayer(5390): Info (1,26)
10-03 19:59:39.720: ERROR/MediaPlayer(5390): Error (1,-16)
10-03 19:59:39.720: DEBUG/VideoView(5390): Error: 1,-16

-- 

2. Internet connection is not working in emulator

Hi,

I am not able to run the internet from my android emulator. whenever I try
to run my browser i am getting following error on various platforms

Following are some of the entries in log window.

*Android emulator 2.2:*
ERROR/ActivityThread(269): Failed to find provider info for
com.google.settings
onReceivedError -7
http://www.google.com/m?client=ms-android-google&source=android-home The
server failed to communicate. Try again later.

*Android emulator 2.1:*
ERROR/ActivityThread(114): Failed to find provider info for
android.server.checkin
WARN/Checkin(114): Can't update stat PHONE_GPRS_ATTEMPTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats
ERROR/ActivityThread(114): Failed to find provider info for
android.server.checkin
WARN/Checkin(114): Can't update stat PHONE_GPRS_CONNECTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats

ERROR/ActivityThread(229): Failed to find provider info for
com.google.settings
onReceivedError -7
http://www.google.com/m?client=ms-android-google&source=android-home The
server failed to communicate. Try again later.

*Android emulator 1.6:*
ERROR/ActivityThread(122): Failed to find provider info for
android.server.checkin
WARN/Checkin(122): Can't update stat PHONE_GSM_REGISTERED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats

ERROR/ActivityThread(122): Failed to find provider info for
android.server.checkin
WARN/Checkin(122): Can't update stat PHONE_GPRS_ATTEMPTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats
ERROR/ActivityThread(122): Failed to find provider info for
android.server.checkin
WARN/Checkin(122): Can't update stat PHONE_GPRS_CONNECTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats

ERROR/ActivityThread(302): Failed to find provider info for
com.google.settings
WARN/ActivityManager(77): Unable to start service Intent {
cmp=com.google.android.googleapps/.GoogleLoginService }: not found
ERROR/browser(302): onReceivedError -7
http://www.google.com/m?client=ms-android-google The server failed to
communicate. Try again later.

*Android emulator 1.5:*
ERROR/ActivityThread(640): Failed to find provider info for
android.server.checkin
WARN/Checkin(640): Can't update stat PHONE_GSM_REGISTERED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats

ERROR/ActivityThread(640): Failed to find provider info for
android.server.checkin
WARN/Checkin(640): Can't update stat PHONE_GPRS_ATTEMPTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats
ERROR/ActivityThread(640): Failed to find provider info for
android.server.checkin
WARN/Checkin(640): Can't update stat PHONE_GPRS_CONNECTED:
java.lang.IllegalArgumentException: Unknown URL
content://android.server.checkin/stats

ERROR/ActivityThread(846): Failed to find provider info for
com.google.settings
ERROR/browser(846): onReceivedError -7
http://www.google.com/m?client=ms-null The server failed to communicate. Try
again later.

Please let me know if any one has having any solution for this issue

Thanks in advance
-- 
Regards,

Viral Brahmbhatt
(M): +919998999518

-- 

3. android design considerations: AsynchTask vs Service (IntentService?)

4. Accessibility question

5. Compressing camera image to a certain size

6. How to make a map move as you drive?

7. bitmap magnification