[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-25 Thread Freddy

Hello,

Thanks for the info.  I tried your suggestion, and it does 'appear' to
work stepping through the code in the debugger but afterwards this
causes com.android.camera to crash with a null pointer exception.
Have you seen this?  I started a new thread on this but should have
kept it in this thread, sorry ... more details here
http://groups.google.com/group/android-developers/browse_thread/thread/19c1b6b743e15782/1ba60b4bd691c225

This is the code I'm using.  Any tips would be appreciated.  Thanks.

   Bitmap bm = BitmapFactory.decodeFile(/sdcard/test.jpg);
   String test = Images.Media.insertImage(getContentResolver(), bm,
title, desciption);





On Feb 10, 10:41 pm, gjs garyjamessi...@gmail.com wrote:
 Hi,

 I have successfully used
 android.provider.MediaStore.Images.Media.insertImage() to insert
 images, which then turn up in the picture viewer after a few seconds,
 see -

 http://developer.android.com/reference/android/provider/MediaStore.Im...

 Maybe also have a look at -

 http://developer.android.com/reference/android/media/MediaScannerConn...

 Regards

 On Feb 10, 5:12 pm, Freddy f...@charter.net wrote:



  ok, thanks, I got the picture viewer to spawn but it doesn't display
  any new pictures since the viewer was run the first time.  If I reset
  the phone (i.e. the picture viewer is forced to restart and rescan
  pictures) and launch the viewer again then the new pictures are
  displayed as expected (so this is a caching issue).

  Does anyone know how to force the picture viewer to rescan photos when
  it's being brought back to the front view?  Some sort of Intent flag
  maybe?

  Thanks.

  On Feb 9, 12:25 pm, Mateo Aeon Ortega peli...@gmail.com wrote:

   The Activity I think you are looking for is:
   com.android.camera.ImageGallery2

   On Feb 9, 12:09 pm, Freddy f...@charter.net wrote:

I don't want to re-inventthe wheel and would like to use the existing
android picture viewer.  I've found some intents to launch built-in
android app such as the dialer

                        Intent intent = new Intent(Intent.ACTION_MAIN);
                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent.setClassName(this,
com.android.phone.Dialer);
                        startActivity(intent);

but have not found one for launching the picture viewer.  How do I
launch the android built-in picture viewer app?

Thanks!- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-25 Thread todd

If you want to just pick a photo using the built in photo viewer, send
the following intent:

Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType(image/*);
startActivityForResult(photoPickerIntent, 1);

and then in your Activities result handler do the following:

protected void onActivityResult(int requestCode, int resultCode,
Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);

if (resultCode == RESULT_OK)
{
Uri photoUri = intent.getData();

if (photoUri != null)
{
// do something with the content Uri
}
}
}

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-25 Thread Freddy

Thanks but I'm trying to insert a photo into the android photo gallery
viewer so the photo is immediately viewable.  Basically I need the
gallery to rebake and display new content.  Your sample appears to
handle the other direction (accepting a photo from the viewer) which
is not what I need.

On Feb 25, 10:11 am, todd tdonahue...@gmail.com wrote:
 If you want to just pick a photo using the built in photo viewer, send
 the following intent:

                 Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
                 photoPickerIntent.setType(image/*);
                 startActivityForResult(photoPickerIntent, 1);

 and then in your Activities result handler do the following:

         protected void onActivityResult(int requestCode, int resultCode,
 Intent intent)
         {
                 super.onActivityResult(requestCode, resultCode, intent);

                 if (resultCode == RESULT_OK)
                 {
                         Uri     photoUri = intent.getData();

                         if (photoUri != null)
                         {
                             // do something with the content Uri
                         }
                 }
         }
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-10 Thread gjs

Hi,

I have successfully used
android.provider.MediaStore.Images.Media.insertImage() to insert
images, which then turn up in the picture viewer after a few seconds,
see -

http://developer.android.com/reference/android/provider/MediaStore.Images.Media.html

Maybe also have a look at -

http://developer.android.com/reference/android/media/MediaScannerConnection.html

Regards

On Feb 10, 5:12 pm, Freddy f...@charter.net wrote:
 ok, thanks, I got the picture viewer to spawn but it doesn't display
 any new pictures since the viewer was run the first time.  If I reset
 the phone (i.e. the picture viewer is forced to restart and rescan
 pictures) and launch the viewer again then the new pictures are
 displayed as expected (so this is a caching issue).

 Does anyone know how to force the picture viewer to rescan photos when
 it's being brought back to the front view?  Some sort of Intent flag
 maybe?

 Thanks.

 On Feb 9, 12:25 pm, Mateo Aeon Ortega peli...@gmail.com wrote:

  The Activity I think you are looking for is:
  com.android.camera.ImageGallery2

  On Feb 9, 12:09 pm, Freddy f...@charter.net wrote:

   I don't want to re-inventthe wheel and would like to use the existing
   android picture viewer.  I've found some intents to launch built-in
   android app such as the dialer

                           Intent intent = new Intent(Intent.ACTION_MAIN);
                           intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                           intent.setClassName(this,
   com.android.phone.Dialer);
                           startActivity(intent);

   but have not found one for launching the picture viewer.  How do I
   launch the android built-in picture viewer app?

   Thanks!- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-09 Thread Freddy

Intent i = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.withAppendedPath
(MediaStore.Images.Media.INTERNAL_CONTENT_URI, );
i.setData(u);
startActivity(i);

On Feb 9, 12:09 pm, Freddy f...@charter.net wrote:
 I don't want to re-invent the wheel and would like to use the existing
 android picture viewer.  I've found some intents to launch built-in
 android app such as the dialer

                         Intent intent = new Intent(Intent.ACTION_MAIN);
                         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                         intent.setClassName(this,
 com.android.phone.Dialer);
                         startActivity(intent);

 but have not found one for launching the picture viewer.  How do I
 launch the android built-in picture viewer app?

 Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-09 Thread Mateo Aeon Ortega

The Activity I think you are looking for is:
com.android.camera.ImageGallery2



On Feb 9, 12:09 pm, Freddy f...@charter.net wrote:
 I don't want to re-invent the wheel and would like to use the existing
 android picture viewer.  I've found some intents to launch built-in
 android app such as the dialer

                         Intent intent = new Intent(Intent.ACTION_MAIN);
                         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                         intent.setClassName(this,
 com.android.phone.Dialer);
                         startActivity(intent);

 but have not found one for launching the picture viewer.  How do I
 launch the android built-in picture viewer app?

 Thanks!

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can I launch the built-in picture viewer app from my app?

2009-02-09 Thread Freddy

ok, thanks, I got the picture viewer to spawn but it doesn't display
any new pictures since the viewer was run the first time.  If I reset
the phone (i.e. the picture viewer is forced to restart and rescan
pictures) and launch the viewer again then the new pictures are
displayed as expected (so this is a caching issue).

Does anyone know how to force the picture viewer to rescan photos when
it's being brought back to the front view?  Some sort of Intent flag
maybe?

Thanks.

On Feb 9, 12:25 pm, Mateo Aeon Ortega peli...@gmail.com wrote:
 The Activity I think you are looking for is:
 com.android.camera.ImageGallery2

 On Feb 9, 12:09 pm, Freddy f...@charter.net wrote:



  I don't want to re-invent the wheel and would like to use the existing
  android picture viewer.  I've found some intents to launch built-in
  android app such as the dialer

                          Intent intent = new Intent(Intent.ACTION_MAIN);
                          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                          intent.setClassName(this,
  com.android.phone.Dialer);
                          startActivity(intent);

  but have not found one for launching the picture viewer.  How do I
  launch the android built-in picture viewer app?

  Thanks!- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---