[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread ryan_f
I have Photoshop.com 1.1.0 (build 3) installed on my T-Mobile G1,
Android 1.6 phone.  When trying to use the described intent, no
application was found to handle it.
ActivityNotFoundException
No Activity found to handle Intent { act=android.intent.action.EDIT
dat = file:///sdcard/pictures/20061021_NewYorkCity_121.jpg typ=image/
* }

The code being used to launch:
String theIntentType = "image/*";
Intent theIntent = new Intent(Intent.ACTION_EDIT);
theIntent.setDataAndType(Uri.fromFile(aFile), theIntentType);
try {
startActivity(theIntent);
} catch (Exception e) {
//display dialog
}

Please advise.
--
Ryan F.


On Mar 5, 2:10 pm, Adobe DI Mobile  wrote:
> The Photoshop.com Mobile editor is now available to the Android
> developer community as an activity that handles actions of type
> Intent.ACTION_EDIT, for image content that has data of mime-type image/
> *.
>
> For more information on incorporating the editor into your Android
> application, please visit:http://mobile.photoshop.com/android/developers.html

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread Streets Of Boston
Try a 'content:' Uri instead of a 'file:' Uri.

On Mar 7, 9:38 am, ryan_f  wrote:
> I have Photoshop.com 1.1.0 (build 3) installed on my T-Mobile G1,
> Android 1.6 phone.  When trying to use the described intent, no
> application was found to handle it.
> ActivityNotFoundException
> No Activity found to handle Intent { act=android.intent.action.EDIT
> dat = file:///sdcard/pictures/20061021_NewYorkCity_121.jpg typ=image/
> * }
>
> The code being used to launch:
>                 String theIntentType = "image/*";
>                 Intent theIntent = new Intent(Intent.ACTION_EDIT);
>                 theIntent.setDataAndType(Uri.fromFile(aFile), theIntentType);
>                 try {
>                         startActivity(theIntent);
>                 } catch (Exception e) {
>                         //display dialog
>                 }
>
> Please advise.
> --
> Ryan F.
>
> On Mar 5, 2:10 pm, Adobe DI Mobile  wrote:
>
>
>
> > The Photoshop.com Mobile editor is now available to the Android
> > developer community as an activity that handles actions of type
> > Intent.ACTION_EDIT, for image content that has data of mime-type image/
> > *.
>
> > For more information on incorporating the editor into your Android
> > application, please 
> > visit:http://mobile.photoshop.com/android/developers.html- 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: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread ryan_f
> Try an actual image type (e.g., image/png) instead of image/*...
I started with this approach and it didn't work.  However, see below.

> Also, if aFile is not on the SD card, the Photoshop app may not have the
> rights to access it.
aFile is most definitely on the SD card and the world has public
access to it.

Worth mentioning again since it has a lot of merit...
(BTW, if the Adobe folk are watching this thread, you might want to
update your developer page with a pointer to where people should ask
this sort of question for you to be able to find it -- here?
StackOverflow on a specific tag? Some forum in adobe.com?)
I picked this thread since it was officially started by Adobe and not
by me.

> Try a 'content:' Uri instead of a 'file:' Uri.
Once step closer to functional. =)
Using a "content" scheme brought up Photoshop.com Mobile, but I could
not figure out how to provide it with the appropriate path to the
file.
Variations on the Uri I constructed and failed to bring up anything in
the editor besides "An error occurred while loading the photo."
Uri theUri = Uri.parse("content://"+"pictures/download/sample.jpg");
Uri theUri = Uri.parse("content://"+"/pictures/download/sample.jpg");
Uri theUri = Uri.parse("content://"+"/sdcard/pictures/download/
sample.jpg");
Uri theUri = Uri.parse("content://"+"\"/sdcard/pictures/download/
sample.jpg\"");
Uri theUri = Uri.parse("content://"+"file:///sdcard/pictures/download/
sample.jpg");
Uri theUri = Uri.parse("content://"+"file:/sdcard/pictures/download/
sample.jpg");
Uri theUri = Uri.parse("content://"+aFile.getPath());
Uri theUri = Uri.parse("content://"+aFile.getName());
Uri theUri = Uri.parse("content://"+Uri.fromFile(aFile).toString());


Update: the Uri Photoshop.com Mobile expects is a content Uri coupled
with a provider of some kind.  Creating and running their example
program meant that for any given file on the SD card, I would have to
translate it into "content://media/external/images/media/97" or
whatever internal number the
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI requires
for that file. I don't know if there is an easy way to translate a
given file to this internal int being used, but I do think that if I
wrote my own provider and supplied it instead of the default android
media store provider, it may work.  I think if I create such a
provider, it would take a path to the file as it's data path so that
the Uri for this intent could be easily constructed:
Uri theUri =
Uri.withAppendedPath(com.mybiz.myapp.myproviderUri,aFile.getPath());
Until I create such a thing, this editor feature is not very useful to
me. =/

It seems like such a lot of work on the developer side when it would
be fairly easy for Adobe to have included a "file" scheme intent
listener too.  Adobe, if you are listening, please update
Photoshop.com Mobile so that I can use a "file" scheme intent that
mimics the current "content" scheme, please. =)


On Mar 7, 1:45 pm, Streets Of Boston  wrote:
> Try a 'content:' Uri instead of a 'file:' Uri.
>
> On Mar 7, 9:38 am, ryan_f  wrote:
>
> > I have Photoshop.com 1.1.0 (build 3) installed on my T-Mobile G1,
> > Android 1.6 phone.  When trying to use the described intent, no
> > application was found to handle it.
> > ActivityNotFoundException
> > No Activity found to handle Intent { act=android.intent.action.EDIT
> > dat = file:///sdcard/pictures/20061021_NewYorkCity_121.jpg typ=image/
> > * }
>
> > The code being used to launch:
> >                 String theIntentType = "image/*";
> >                 Intent theIntent = new Intent(Intent.ACTION_EDIT);
> >                 theIntent.setDataAndType(Uri.fromFile(aFile), 
> > theIntentType);
> >                 try {
> >                         startActivity(theIntent);
> >                 } catch (Exception e) {
> >                         //display dialog
> >                 }
>
> > Please advise.
> > --
> > Ryan F.
>
> > On Mar 5, 2:10 pm, Adobe DI Mobile  wrote:
>
> > > The Photoshop.com Mobile editor is now available to the Android
> > > developer community as an activity that handles actions of type
> > > Intent.ACTION_EDIT, for image content that has data of mime-type image/
> > > *.
>
> > > For more information on incorporating the editor into your Android
> > > application, please 
> > > visit:http://mobile.photoshop.com/android/developers.html-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: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread Streets Of Boston
I agree that it should work on any (local) Uri, file: and content:

But i think they somehow need to tie it to the MediaStore content-
provider. And this makes sense, because content-providers are the main
mechanism with which data is shared amongst the applications.

This means, that if you have a file, you need to insert it into the
MediaStore's image content-provider. The insert returns you an ID
(Long value), which you then can use for Photoshop.com.

But i think that the Photoshop.com intent is designed with the idea
that another app queries the *content-provider* for images (not the
file-system)


On Mar 7, 7:49 pm, ryan_f  wrote:
> > Try an actual image type (e.g., image/png) instead of image/*...
>
> I started with this approach and it didn't work.  However, see below.
>
> > Also, if aFile is not on the SD card, the Photoshop app may not have the
> > rights to access it.
>
> aFile is most definitely on the SD card and the world has public
> access to it.
>
> Worth mentioning again since it has a lot of merit...
> (BTW, if the Adobe folk are watching this thread, you might want to
> update your developer page with a pointer to where people should ask
> this sort of question for you to be able to find it -- here?
> StackOverflow on a specific tag? Some forum in adobe.com?)
> I picked this thread since it was officially started by Adobe and not
> by me.
>
> > Try a 'content:' Uri instead of a 'file:' Uri.
>
> Once step closer to functional. =)
> Using a "content" scheme brought up Photoshop.com Mobile, but I could
> not figure out how to provide it with the appropriate path to the
> file.
> Variations on the Uri I constructed and failed to bring up anything in
> the editor besides "An error occurred while loading the photo."
> Uri theUri = Uri.parse("content://"+"pictures/download/sample.jpg");
> Uri theUri = Uri.parse("content://"+"/pictures/download/sample.jpg");
> Uri theUri = Uri.parse("content://"+"/sdcard/pictures/download/
> sample.jpg");
> Uri theUri = Uri.parse("content://"+"\"/sdcard/pictures/download/
> sample.jpg\"");
> Uri theUri = Uri.parse("content://"+"file:///sdcard/pictures/download/
> sample.jpg");
> Uri theUri = Uri.parse("content://"+"file:/sdcard/pictures/download/
> sample.jpg");
> Uri theUri = Uri.parse("content://"+aFile.getPath());
> Uri theUri = Uri.parse("content://"+aFile.getName());
> Uri theUri = Uri.parse("content://"+Uri.fromFile(aFile).toString());
>
> Update: the Uri Photoshop.com Mobile expects is a content Uri coupled
> with a provider of some kind.  Creating and running their example
> program meant that for any given file on the SD card, I would have to
> translate it into "content://media/external/images/media/97" or
> whatever internal number the
> android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI requires
> for that file. I don't know if there is an easy way to translate a
> given file to this internal int being used, but I do think that if I
> wrote my own provider and supplied it instead of the default android
> media store provider, it may work.  I think if I create such a
> provider, it would take a path to the file as it's data path so that
> the Uri for this intent could be easily constructed:
> Uri theUri =
> Uri.withAppendedPath(com.mybiz.myapp.myproviderUri,aFile.getPath());
> Until I create such a thing, this editor feature is not very useful to
> me. =/
>
> It seems like such a lot of work on the developer side when it would
> be fairly easy for Adobe to have included a "file" scheme intent
> listener too.  Adobe, if you are listening, please update
> Photoshop.com Mobile so that I can use a "file" scheme intent that
> mimics the current "content" scheme, please. =)
>
> On Mar 7, 1:45 pm, Streets Of Boston  wrote:
>
>
>
> > Try a 'content:' Uri instead of a 'file:' Uri.
>
> > On Mar 7, 9:38 am, ryan_f  wrote:
>
> > > I have Photoshop.com 1.1.0 (build 3) installed on my T-Mobile G1,
> > > Android 1.6 phone.  When trying to use the described intent, no
> > > application was found to handle it.
> > > ActivityNotFoundException
> > > No Activity found to handle Intent { act=android.intent.action.EDIT
> > > dat = file:///sdcard/pictures/20061021_NewYorkCity_121.jpg typ=image/
> > > * }
>
> > > The code being used to launch:
> > >                 String theIntentType = "image/*";
> > >                 Intent theIntent = new Intent(Intent.ACTION_EDIT);
> > >                 theIntent.setDataAndType(Uri.fromFile(aFile), 
> > > theIntentType);
> > >                 try {
> > >                         startActivity(theIntent);
> > >                 } catch (Exception e) {
> > >                         //display dialog
> > >                 }
>
> > > Please advise.
> > > --
> > > Ryan F.
>
> > > On Mar 5, 2:10 pm, Adobe DI Mobile  wrote:
>
> > > > The Photoshop.com Mobile editor is now available to the Android
> > > > developer community as an activity that handles actions of type
> > > > Intent.ACTION_EDIT, for image content that has data of mime-t

[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread ryan_f
> But i think that the Photoshop.com intent is designed with the idea
> that another app queries the *content-provider* for images (not the
> file-system)
If your app is a file browser/manager and the user wants to open a
file to edit instead of view means you only have the file in which to
work.  You have no idea what content provider supplies this particular
image since you aren't working with a provider, merely files on the SD
card itself.  The mechanism Adobe has currently for just content
providers is all well and good, but the additional one for file
schemes would be nice too. =)

I wonder if a file browser should incorporate a file content provider
specifically to handle such tasks.  *ponders*

On Mar 7, 7:33 pm, Streets Of Boston  wrote:
> I agree that it should work on any (local) Uri, file: and content:
>
> But i think they somehow need to tie it to the MediaStore content-
> provider. And this makes sense, because content-providers are the main
> mechanism with which data is shared amongst the applications.
>
> This means, that if you have a file, you need to insert it into the
> MediaStore's image content-provider. The insert returns you an ID
> (Long value), which you then can use for Photoshop.com.
>
> But i think that the Photoshop.com intent is designed with the idea
> that another app queries the *content-provider* for images (not the
> file-system)
>

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread ryan_f
> Correct me if I'm wrong, but wouldn't an inter-activity file intent fail due
> to Android's file system sandboxing model?
For files that are private to the app, you would be correct. People
can remove the SD card from the phone and plug it into a laptop/
desktop and download a bunch of content that is public to every app on
the phone.  Plus, apps can save files to the SD card specifically in
public mode so that anyone can see it, use it.  File intents are meant
specifically for public files.  Private files are indeed locked away
and cannot be used by anyone else and those would require a provider
of some kind for any app external to yours to be able to get at
anything contained within your private app space.

On Mar 7, 11:29 pm, Frank Weiss  wrote:
> Correct me if I'm wrong, but wouldn't an inter-activity file intent fail due
> to Android's file system sandboxing model? If so, then you'll need to add a
> provider to let the PS activity get the content.
>
> On Sun, Mar 7, 2010 at 7:36 PM, ryan_f  wrote:
> > > But i think that the Photoshop.com intent is designed with the idea
> > > that another app queries the *content-provider* for images (not the
> > > file-system)
> > If your app is a file browser/manager and the user wants to open a
> > file to edit instead of view means you only have the file in which to
> > work.  You have no idea what content provider supplies this particular
> > image since you aren't working with a provider, merely files on the SD
> > card itself.  The mechanism Adobe has currently for just content
> > providers is all well and good, but the additional one for file
> > schemes would be nice too. =)
>
> > I wonder if a file browser should incorporate a file content provider
> > specifically to handle such tasks.  *ponders*
>
> > On Mar 7, 7:33 pm, Streets Of Boston  wrote:
> > > I agree that it should work on any (local) Uri, file: and content:
>
> > > But i think they somehow need to tie it to the MediaStore content-
> > > provider. And this makes sense, because content-providers are the main
> > > mechanism with which data is shared amongst the applications.
>
> > > This means, that if you have a file, you need to insert it into the
> > > MediaStore's image content-provider. The insert returns you an ID
> > > (Long value), which you then can use for Photoshop.com.
>
> > > But i think that the Photoshop.com intent is designed with the idea
> > > that another app queries the *content-provider* for images (not the
> > > file-system)
>
> >  --
> > 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


[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread ryan_f
@Frank Weiss - I do not believe so.  I have not run any personal
tests, but I have not seen any data I have not put there either.  Nor
have I compared file space to see if there's any "missing".  So I
believe the permissions are still set and therefore private files are
still unreadable even external to the phone.

On Mar 8, 12:07 am, Frank Weiss  wrote:
> @ryan_f Thanks for the clarification. You taught me something new. Hope it
> helps the OP.
>
> One question: When you remove the SD card and read it externally, are all
> Android app's data accessable? Sounds like a security hole.
>
> On Sun, Mar 7, 2010 at 10:01 PM, ryan_f  wrote:
> > > Correct me if I'm wrong, but wouldn't an inter-activity file intent fail
> > due
> > > to Android's file system sandboxing model?
> > For files that are private to the app, you would be correct. People
> > can remove the SD card from the phone and plug it into a laptop/
> > desktop and download a bunch of content that is public to every app on
> > the phone.  Plus, apps can save files to the SD card specifically in
> > public mode so that anyone can see it, use it.  File intents are meant
> > specifically for public files.  Private files are indeed locked away
> > and cannot be used by anyone else and those would require a provider
> > of some kind for any app external to yours to be able to get at
> > anything contained within your private app space.
>
> > On Mar 7, 11:29 pm, Frank Weiss  wrote:
> > > Correct me if I'm wrong, but wouldn't an inter-activity file intent fail
> > due
> > > to Android's file system sandboxing model? If so, then you'll need to add
> > a
> > > provider to let the PS activity get the content.
>
> >  > On Sun, Mar 7, 2010 at 7:36 PM, ryan_f  wrote:
> > > > > But i think that the Photoshop.com intent is designed with the idea
> > > > > that another app queries the *content-provider* for images (not the
> > > > > file-system)
> > > > If your app is a file browser/manager and the user wants to open a
> > > > file to edit instead of view means you only have the file in which to
> > > > work.  You have no idea what content provider supplies this particular
> > > > image since you aren't working with a provider, merely files on the SD
> > > > card itself.  The mechanism Adobe has currently for just content
> > > > providers is all well and good, but the additional one for file
> > > > schemes would be nice too. =)
>
> > > > I wonder if a file browser should incorporate a file content provider
> > > > specifically to handle such tasks.  *ponders*
>
> > > > On Mar 7, 7:33 pm, Streets Of Boston  wrote:
> > > > > I agree that it should work on any (local) Uri, file: and content:
>
> > > > > But i think they somehow need to tie it to the MediaStore content-
> > > > > provider. And this makes sense, because content-providers are the
> > main
> > > > > mechanism with which data is shared amongst the applications.
>
> > > > > This means, that if you have a file, you need to insert it into the
> > > > > MediaStore's image content-provider. The insert returns you an ID
> > > > > (Long value), which you then can use for Photoshop.com.
>
> > > > > But i think that the Photoshop.com intent is designed with the idea
> > > > > that another app queries the *content-provider* for images (not the
> > > > > file-system)
>
> > > >  --
> > > > 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

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-11 Thread webmonkey
The document provided by Adobe does not mention how you should read
the returned Uri. For compatibility with future versions and other
image editors, you should not assume that it is a 'file:' scheme Uri,
it could also be a 'content:' scheme Uri. The ContentResolver will
handle it. here is the code:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent
data)
{
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == LAUNCH_EDITOR)
{
if (resultCode == Activity.RESULT_OK)
{
Uri savedImage = data.getData();
// savedImage is the Uri for the newly created
// edited version of the original image.

ContentResolver cr = getContentResolver();

InputStream in = null;
try {
 in = cr.openInputStream(savedImage);
 // you now have an InputStream to the saved image
 // you can copy it by saving to an OutputStream
 // or you can load it as a Bitmap
 Bitmap bitmap = BitmapFactory.decodeStream(in);

} catch (IOException e)
{
}
}
else
{
// Edit Operation canceled by user
}
}
}


On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
> ThePhotoshop.com Mobile editor is now available to the Android
> developer community as an activity that handles actions of type
> Intent.ACTION_EDIT, for image content that has data of mime-type image/
> *.
>
> For more information on incorporating the editor into your Android
> application, please visit:http://mobile.photoshop.com/android/developers.html

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-12 Thread Nivek
There is an inconsistency in their Uri handling... The app accepts
only content:// Uris but provides the result as a file:// Uri... so it
can't edit it's own result again without us having to work this
around...

They could have added the result to the MediaStore and returned that
uri... I'll have to do it myself or my edit button disappears after
editing a picture...

I think Adobe should fix this.

Kevin

On 11 mar, 16:43, webmonkey  wrote:
> The document provided by Adobe does not mention how you should read
> the returned Uri. For compatibility with future versions and other
> image editors, you should not assume that it is a 'file:' scheme Uri,
> it could also be a 'content:' scheme Uri. The ContentResolver will
> handle it. here is the code:
>
> @Override
> public void onActivityResult(int requestCode, int resultCode, Intent
> data)
> {
>     super.onActivityResult(requestCode, resultCode, data);
>     if (requestCode == LAUNCH_EDITOR)
>     {
>         if (resultCode == Activity.RESULT_OK)
>         {
>             Uri savedImage = data.getData();
>             // savedImage is the Uri for the newly created
>             // edited version of the original image.
>
>             ContentResolver cr = getContentResolver();
>
>             InputStream in = null;
>             try {
>                  in = cr.openInputStream(savedImage);
>                  // you now have an InputStream to the saved image
>                  // you can copy it by saving to an OutputStream
>                  // or you can load it as a Bitmap
>                  Bitmap bitmap = BitmapFactory.decodeStream(in);
>
>             } catch (IOException e)
>             {
>             }
>         }
>         else
>         {
>             // Edit Operation canceled by user
>         }
>     }
>
> }
>
> On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
>
>
>
> > ThePhotoshop.com Mobile editor is now available to the Android
> > developer community as an activity that handles actions of type
> > Intent.ACTION_EDIT, for image content that has data of mime-type image/
> > *.
>
> > For more information on incorporating the editor into your Android
> > application, please 
> > visit:http://mobile.photoshop.com/android/developers.html

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-12 Thread Nivek
> They could have added the result to the MediaStore and returned that
> uri... I'll have to do it myself or my edit button disappears after
> editing a picture...

Actually, this is what I will have to do as a workaround, but I can't
see any reason why they shouldn't accept a file:// uri as an input !

Kevin


On 13 mar, 03:10, Nivek  wrote:
> There is an inconsistency in their Uri handling... The app accepts
> only content:// Uris but provides the result as a file:// Uri... so it
> can't edit it's own result again without us having to work this
> around...
>
> They could have added the result to the MediaStore and returned that
> uri... I'll have to do it myself or my edit button disappears after
> editing a picture...
>
> I think Adobe should fix this.
>
> Kevin
>
> On 11 mar, 16:43, webmonkey  wrote:
>
>
>
> > The document provided by Adobe does not mention how you should read
> > the returned Uri. For compatibility with future versions and other
> > image editors, you should not assume that it is a 'file:' scheme Uri,
> > it could also be a 'content:' scheme Uri. The ContentResolver will
> > handle it. here is the code:
>
> > @Override
> > public void onActivityResult(int requestCode, int resultCode, Intent
> > data)
> > {
> >     super.onActivityResult(requestCode, resultCode, data);
> >     if (requestCode == LAUNCH_EDITOR)
> >     {
> >         if (resultCode == Activity.RESULT_OK)
> >         {
> >             Uri savedImage = data.getData();
> >             // savedImage is the Uri for the newly created
> >             // edited version of the original image.
>
> >             ContentResolver cr = getContentResolver();
>
> >             InputStream in = null;
> >             try {
> >                  in = cr.openInputStream(savedImage);
> >                  // you now have an InputStream to the saved image
> >                  // you can copy it by saving to an OutputStream
> >                  // or you can load it as a Bitmap
> >                  Bitmap bitmap = BitmapFactory.decodeStream(in);
>
> >             } catch (IOException e)
> >             {
> >             }
> >         }
> >         else
> >         {
> >             // Edit Operation canceled by user
> >         }
> >     }
>
> > }
>
> > On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
>
> > > ThePhotoshop.com Mobile editor is now available to the Android
> > > developer community as an activity that handles actions of type
> > > Intent.ACTION_EDIT, for image content that has data of mime-type image/
> > > *.
>
> > > For more information on incorporating the editor into your Android
> > > application, please 
> > > visit:http://mobile.photoshop.com/android/developers.html

-- 
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: Photoshop.com Mobile editor now available as an Intent

2010-03-14 Thread Nivek
You can use Astro File Manager or Estrongs File Explorer to backup the
Photoshop app on your sdcard.

Then, transfer the apk on your computer and install it on a running
emulator using adb.

adb install Photoshop.apk

Now, I implemented a workaround for the problem I detected before:
Photoshop can't edit its own results.

Actually, I found out that Photoshop was storing its result in
MediaStore, so it should have been able to send its result as a content://
uri since MediaStore gives one !

My workaround is to search in the MediaStore for the picture saved by
Photoshop. I use the fact that MediaStore stores the path of images in
their DATA column.

Here is the code :
http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/trunk/src/com/kg/emailalbum/mobile/util/BitmapUtil.java#99

Here is the call when receiving Photoshop's result:
http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/trunk/src/com/kg/emailalbum/mobile/creator/EmailAlbumEditor.java#590

Kevin

On 13 mar, 15:59, nayana urs  wrote:
> can we test this feature in emulator
> with regards
>    Nayana
>
>
>
> On Fri, Mar 12, 2010 at 6:18 PM, Nivek  wrote:
> > > They could have added the result to the MediaStore and returned that
> > > uri... I'll have to do it myself or my edit button disappears after
> > > editing a picture...
>
> > Actually, this is what I will have to do as a workaround, but I can't
> > see any reason why they shouldn't accept a file:// uri as an input !
>
> > Kevin
>
> > On 13 mar, 03:10, Nivek  wrote:
> > > There is an inconsistency in their Uri handling... The app accepts
> > > only content:// Uris but provides the result as a file:// Uri... so it
> > > can't edit it's own result again without us having to work this
> > > around...
>
> > > They could have added the result to the MediaStore and returned that
> > > uri... I'll have to do it myself or my edit button disappears after
> > > editing a picture...
>
> > > I think Adobe should fix this.
>
> > > Kevin
>
> > > On 11 mar, 16:43, webmonkey  wrote:
>
> > > > The document provided by Adobe does not mention how you should read
> > > > the returned Uri. For compatibility with future versions and other
> > > > image editors, you should not assume that it is a 'file:' scheme Uri,
> > > > it could also be a 'content:' scheme Uri. The ContentResolver will
> > > > handle it. here is the code:
>
> > > > @Override
> > > > public void onActivityResult(int requestCode, int resultCode, Intent
> > > > data)
> > > > {
> > > >     super.onActivityResult(requestCode, resultCode, data);
> > > >     if (requestCode == LAUNCH_EDITOR)
> > > >     {
> > > >         if (resultCode == Activity.RESULT_OK)
> > > >         {
> > > >             Uri savedImage = data.getData();
> > > >             // savedImage is the Uri for the newly created
> > > >             // edited version of the original image.
>
> > > >             ContentResolver cr = getContentResolver();
>
> > > >             InputStream in = null;
> > > >             try {
> > > >                  in = cr.openInputStream(savedImage);
> > > >                  // you now have an InputStream to the saved image
> > > >                  // you can copy it by saving to an OutputStream
> > > >                  // or you can load it as a Bitmap
> > > >                  Bitmap bitmap = BitmapFactory.decodeStream(in);
>
> > > >             } catch (IOException e)
> > > >             {
> > > >             }
> > > >         }
> > > >         else
> > > >         {
> > > >             // Edit Operation canceled by user
> > > >         }
> > > >     }
>
> > > > }
>
> > > > On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
>
> > > > > ThePhotoshop.com Mobile editor is now available to the Android
> > > > > developer community as an activity that handles actions of type
> > > > > Intent.ACTION_EDIT, for image content that has data of mime-type
> > image/
> > > > > *.
>
> > > > > For more information on incorporating the editor into your Android
> > > > > application, please visit:
> >http://mobile.photoshop.com/android/developers.html
>
> > --
> > 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 > cr...@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


[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread webmonkey
For your storePicture function it is better to run the MediaScanner to
add an image file to the MediaStore, see

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

Just create a MediaScannerConnection, provide a
MediaScannerConnectionClient, and scan the file. The
MediaScannerConnectionClient will give you the Uri in onScanCompleted.

You can also use the MediaScanner in the getContentUriFromFile
function. If should give you the Uri that already exists for the file,
if not, it will add it automatically.

It is much more future proof than adding an image manually using the
MediaStore database.


On Mar 15, 12:47 am, Nivek  wrote:
> You can use Astro File Manager or Estrongs File Explorer to backup the
> Photoshop app on your sdcard.
>
> Then, transfer the apk on your computer and install it on a running
> emulator using adb.
>
> adb install Photoshop.apk
>
> Now, I implemented a workaround for the problem I detected before:
> Photoshop can't edit its own results.
>
> Actually, I found out that Photoshop was storing its result in
> MediaStore, so it should have been able to send its result as a content://
> uri since MediaStore gives one !
>
> My workaround is to search in the MediaStore for the picture saved by
> Photoshop. I use the fact that MediaStore stores the path of images in
> their DATA column.
>
> Here is the code 
> :http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
>
> Here is the call when receiving Photoshop's 
> result:http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
>
> Kevin
>
> On 13 mar, 15:59, nayana urs  wrote:
>
>
>
> > can we test this feature in emulator
> > with regards
> >    Nayana
>
> > On Fri, Mar 12, 2010 at 6:18 PM, Nivek  wrote:
> > > > They could have added the result to the MediaStore and returned that
> > > > uri... I'll have to do it myself or my edit button disappears after
> > > > editing a picture...
>
> > > Actually, this is what I will have to do as a workaround, but I can't
> > > see any reason why they shouldn't accept a file:// uri as an input !
>
> > > Kevin
>
> > > On 13 mar, 03:10, Nivek  wrote:
> > > > There is an inconsistency in their Uri handling... The app accepts
> > > > only content:// Uris but provides the result as a file:// Uri... so it
> > > > can't edit it's own result again without us having to work this
> > > > around...
>
> > > > They could have added the result to the MediaStore and returned that
> > > > uri... I'll have to do it myself or my edit button disappears after
> > > > editing a picture...
>
> > > > I think Adobe should fix this.
>
> > > > Kevin
>
> > > > On 11 mar, 16:43, webmonkey  wrote:
>
> > > > > The document provided by Adobe does not mention how you should read
> > > > > the returned Uri. For compatibility with future versions and other
> > > > > image editors, you should not assume that it is a 'file:' scheme Uri,
> > > > > it could also be a 'content:' scheme Uri. The ContentResolver will
> > > > > handle it. here is the code:
>
> > > > > @Override
> > > > > public void onActivityResult(int requestCode, int resultCode, Intent
> > > > > data)
> > > > > {
> > > > >     super.onActivityResult(requestCode, resultCode, data);
> > > > >     if (requestCode == LAUNCH_EDITOR)
> > > > >     {
> > > > >         if (resultCode == Activity.RESULT_OK)
> > > > >         {
> > > > >             Uri savedImage = data.getData();
> > > > >             // savedImage is the Uri for the newly created
> > > > >             // edited version of the original image.
>
> > > > >             ContentResolver cr = getContentResolver();
>
> > > > >             InputStream in = null;
> > > > >             try {
> > > > >                  in = cr.openInputStream(savedImage);
> > > > >                  // you now have an InputStream to the saved image
> > > > >                  // you can copy it by saving to an OutputStream
> > > > >                  // or you can load it as a Bitmap
> > > > >                  Bitmap bitmap = BitmapFactory.decodeStream(in);
>
> > > > >             } catch (IOException e)
> > > > >             {
> > > > >             }
> > > > >         }
> > > > >         else
> > > > >         {
> > > > >             // Edit Operation canceled by user
> > > > >         }
> > > > >     }
>
> > > > > }
>
> > > > > On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
>
> > > > > > ThePhotoshop.com Mobile editor is now available to the Android
> > > > > > developer community as an activity that handles actions of type
> > > > > > Intent.ACTION_EDIT, for image content that has data of mime-type
> > > image/
> > > > > > *.
>
> > > > > > For more information on incorporating the editor into your Android
> > > > > > application, please visit:
> > >http://mobile.photoshop.com/android/developers.html
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developer

[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread webmonkey
There is also a bug in PS mobile, and one more reason why you should
not assume anything about the resulting intent data. When you send a
PNG file for editing, PS returns a file with the PNG extension but it
is actually a JPEG.

On Mar 15, 4:54 pm, webmonkey  wrote:
> For your storePicture function it is better to run the MediaScanner to
> add an image file to the MediaStore, see
>
> http://developer.android.com/reference/android/media/MediaScannerConn...
>
> Just create a MediaScannerConnection, provide a
> MediaScannerConnectionClient, and scan the file. The
> MediaScannerConnectionClient will give you the Uri in onScanCompleted.
>
> You can also use the MediaScanner in the getContentUriFromFile
> function. If should give you the Uri that already exists for the file,
> if not, it will add it automatically.
>
> It is much more future proof than adding an image manually using the
> MediaStore database.
>
> On Mar 15, 12:47 am, Nivek  wrote:
>
>
>
> > You can use Astro File Manager or Estrongs File Explorer to backup the
> > Photoshop app on your sdcard.
>
> > Then, transfer the apk on your computer and install it on a running
> > emulator using adb.
>
> > adb install Photoshop.apk
>
> > Now, I implemented a workaround for the problem I detected before:
> > Photoshop can't edit its own results.
>
> > Actually, I found out that Photoshop was storing its result in
> > MediaStore, so it should have been able to send its result as a content://
> > uri since MediaStore gives one !
>
> > My workaround is to search in the MediaStore for the picture saved by
> > Photoshop. I use the fact that MediaStore stores the path of images in
> > their DATA column.
>
> > Here is the code 
> > :http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
>
> > Here is the call when receiving Photoshop's 
> > result:http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
>
> > Kevin
>
> > On 13 mar, 15:59, nayana urs  wrote:
>
> > > can we test this feature in emulator
> > > with regards
> > >    Nayana
>
> > > On Fri, Mar 12, 2010 at 6:18 PM, Nivek  wrote:
> > > > > They could have added the result to the MediaStore and returned that
> > > > > uri... I'll have to do it myself or my edit button disappears after
> > > > > editing a picture...
>
> > > > Actually, this is what I will have to do as a workaround, but I can't
> > > > see any reason why they shouldn't accept a file:// uri as an input !
>
> > > > Kevin
>
> > > > On 13 mar, 03:10, Nivek  wrote:
> > > > > There is an inconsistency in their Uri handling... The app accepts
> > > > > only content:// Uris but provides the result as a file:// Uri... so it
> > > > > can't edit it's own result again without us having to work this
> > > > > around...
>
> > > > > They could have added the result to the MediaStore and returned that
> > > > > uri... I'll have to do it myself or my edit button disappears after
> > > > > editing a picture...
>
> > > > > I think Adobe should fix this.
>
> > > > > Kevin
>
> > > > > On 11 mar, 16:43, webmonkey  wrote:
>
> > > > > > The document provided by Adobe does not mention how you should read
> > > > > > the returned Uri. For compatibility with future versions and other
> > > > > > image editors, you should not assume that it is a 'file:' scheme 
> > > > > > Uri,
> > > > > > it could also be a 'content:' scheme Uri. The ContentResolver will
> > > > > > handle it. here is the code:
>
> > > > > > @Override
> > > > > > public void onActivityResult(int requestCode, int resultCode, Intent
> > > > > > data)
> > > > > > {
> > > > > >     super.onActivityResult(requestCode, resultCode, data);
> > > > > >     if (requestCode == LAUNCH_EDITOR)
> > > > > >     {
> > > > > >         if (resultCode == Activity.RESULT_OK)
> > > > > >         {
> > > > > >             Uri savedImage = data.getData();
> > > > > >             // savedImage is the Uri for the newly created
> > > > > >             // edited version of the original image.
>
> > > > > >             ContentResolver cr = getContentResolver();
>
> > > > > >             InputStream in = null;
> > > > > >             try {
> > > > > >                  in = cr.openInputStream(savedImage);
> > > > > >                  // you now have an InputStream to the saved image
> > > > > >                  // you can copy it by saving to an OutputStream
> > > > > >                  // or you can load it as a Bitmap
> > > > > >                  Bitmap bitmap = BitmapFactory.decodeStream(in);
>
> > > > > >             } catch (IOException e)
> > > > > >             {
> > > > > >             }
> > > > > >         }
> > > > > >         else
> > > > > >         {
> > > > > >             // Edit Operation canceled by user
> > > > > >         }
> > > > > >     }
>
> > > > > > }
>
> > > > > > On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
>
> > > > > > > ThePhotoshop.com Mobile editor is now available to the Android
> > > > > > > developer community as an activity that handles actions of type
> > > > >

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread Mark Murphy
ryan_f wrote:
> I have Photoshop.com 1.1.0 (build 3) installed on my T-Mobile G1,
> Android 1.6 phone.  When trying to use the described intent, no
> application was found to handle it.
> ActivityNotFoundException
> No Activity found to handle Intent { act=android.intent.action.EDIT
> dat = file:///sdcard/pictures/20061021_NewYorkCity_121.jpg typ=image/
> * }
> 
> The code being used to launch:
>   String theIntentType = "image/*";
>   Intent theIntent = new Intent(Intent.ACTION_EDIT);
>   theIntent.setDataAndType(Uri.fromFile(aFile), theIntentType);
>   try {
>   startActivity(theIntent);
>   } catch (Exception e) {
>   //display dialog
>   }

Try an actual image type (e.g., image/png) instead of image/*, and see
if that has an impact.

Also, if aFile is not on the SD card, the Photoshop app may not have the
rights to access it.

(BTW, if the Adobe folk are watching this thread, you might want to
update your developer page with a pointer to where people should ask
this sort of question for you to be able to find it -- here?
StackOverflow on a specific tag? Some forum in adobe.com?)

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 14-18 June 2010: http://bignerdranch.com

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


Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread Frank Weiss
Correct me if I'm wrong, but wouldn't an inter-activity file intent fail due
to Android's file system sandboxing model? If so, then you'll need to add a
provider to let the PS activity get the content.

On Sun, Mar 7, 2010 at 7:36 PM, ryan_f  wrote:

> > But i think that the Photoshop.com intent is designed with the idea
> > that another app queries the *content-provider* for images (not the
> > file-system)
> If your app is a file browser/manager and the user wants to open a
> file to edit instead of view means you only have the file in which to
> work.  You have no idea what content provider supplies this particular
> image since you aren't working with a provider, merely files on the SD
> card itself.  The mechanism Adobe has currently for just content
> providers is all well and good, but the additional one for file
> schemes would be nice too. =)
>
> I wonder if a file browser should incorporate a file content provider
> specifically to handle such tasks.  *ponders*
>
> On Mar 7, 7:33 pm, Streets Of Boston  wrote:
> > I agree that it should work on any (local) Uri, file: and content:
> >
> > But i think they somehow need to tie it to the MediaStore content-
> > provider. And this makes sense, because content-providers are the main
> > mechanism with which data is shared amongst the applications.
> >
> > This means, that if you have a file, you need to insert it into the
> > MediaStore's image content-provider. The insert returns you an ID
> > (Long value), which you then can use for Photoshop.com.
> >
> > But i think that the Photoshop.com intent is designed with the idea
> > that another app queries the *content-provider* for images (not the
> > file-system)
> >
>
>  --
> 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

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-07 Thread Frank Weiss
@ryan_f Thanks for the clarification. You taught me something new. Hope it
helps the OP.

One question: When you remove the SD card and read it externally, are all
Android app's data accessable? Sounds like a security hole.

On Sun, Mar 7, 2010 at 10:01 PM, ryan_f  wrote:

> > Correct me if I'm wrong, but wouldn't an inter-activity file intent fail
> due
> > to Android's file system sandboxing model?
> For files that are private to the app, you would be correct. People
> can remove the SD card from the phone and plug it into a laptop/
> desktop and download a bunch of content that is public to every app on
> the phone.  Plus, apps can save files to the SD card specifically in
> public mode so that anyone can see it, use it.  File intents are meant
> specifically for public files.  Private files are indeed locked away
> and cannot be used by anyone else and those would require a provider
> of some kind for any app external to yours to be able to get at
> anything contained within your private app space.
>
> On Mar 7, 11:29 pm, Frank Weiss  wrote:
> > Correct me if I'm wrong, but wouldn't an inter-activity file intent fail
> due
> > to Android's file system sandboxing model? If so, then you'll need to add
> a
> > provider to let the PS activity get the content.
> >
>  > On Sun, Mar 7, 2010 at 7:36 PM, ryan_f  wrote:
> > > > But i think that the Photoshop.com intent is designed with the idea
> > > > that another app queries the *content-provider* for images (not the
> > > > file-system)
> > > If your app is a file browser/manager and the user wants to open a
> > > file to edit instead of view means you only have the file in which to
> > > work.  You have no idea what content provider supplies this particular
> > > image since you aren't working with a provider, merely files on the SD
> > > card itself.  The mechanism Adobe has currently for just content
> > > providers is all well and good, but the additional one for file
> > > schemes would be nice too. =)
> >
> > > I wonder if a file browser should incorporate a file content provider
> > > specifically to handle such tasks.  *ponders*
> >
> > > On Mar 7, 7:33 pm, Streets Of Boston  wrote:
> > > > I agree that it should work on any (local) Uri, file: and content:
> >
> > > > But i think they somehow need to tie it to the MediaStore content-
> > > > provider. And this makes sense, because content-providers are the
> main
> > > > mechanism with which data is shared amongst the applications.
> >
> > > > This means, that if you have a file, you need to insert it into the
> > > > MediaStore's image content-provider. The insert returns you an ID
> > > > (Long value), which you then can use for Photoshop.com.
> >
> > > > But i think that the Photoshop.com intent is designed with the idea
> > > > that another app queries the *content-provider* for images (not the
> > > > file-system)
> >
> > >  --
> > > 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
>

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

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-08 Thread Mark Murphy
ryan_f wrote:
> @Frank Weiss - I do not believe so.  I have not run any personal
> tests, but I have not seen any data I have not put there either.  Nor
> have I compared file space to see if there's any "missing".  So I
> believe the permissions are still set and therefore private files are
> still unreadable even external to the phone.

There are no permissions on FAT32 (a.k.a., vfat) tied to Android. Any
file written there by applications is visible when you use the card
elsewhere.

This is a "security hole" only in the hands of foolish developers who
put secure data in an insecure medium, just as Facebook is a "security
hole" for anyone who publishes their list of personal passwords on their
Facebook page for all to see.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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


Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-13 Thread nayana urs
can we test this feature in emulator
with regards
   Nayana


On Fri, Mar 12, 2010 at 6:18 PM, Nivek  wrote:

> > They could have added the result to the MediaStore and returned that
> > uri... I'll have to do it myself or my edit button disappears after
> > editing a picture...
>
> Actually, this is what I will have to do as a workaround, but I can't
> see any reason why they shouldn't accept a file:// uri as an input !
>
> Kevin
>
>
> On 13 mar, 03:10, Nivek  wrote:
> > There is an inconsistency in their Uri handling... The app accepts
> > only content:// Uris but provides the result as a file:// Uri... so it
> > can't edit it's own result again without us having to work this
> > around...
> >
> > They could have added the result to the MediaStore and returned that
> > uri... I'll have to do it myself or my edit button disappears after
> > editing a picture...
> >
> > I think Adobe should fix this.
> >
> > Kevin
> >
> > On 11 mar, 16:43, webmonkey  wrote:
> >
> >
> >
> > > The document provided by Adobe does not mention how you should read
> > > the returned Uri. For compatibility with future versions and other
> > > image editors, you should not assume that it is a 'file:' scheme Uri,
> > > it could also be a 'content:' scheme Uri. The ContentResolver will
> > > handle it. here is the code:
> >
> > > @Override
> > > public void onActivityResult(int requestCode, int resultCode, Intent
> > > data)
> > > {
> > > super.onActivityResult(requestCode, resultCode, data);
> > > if (requestCode == LAUNCH_EDITOR)
> > > {
> > > if (resultCode == Activity.RESULT_OK)
> > > {
> > > Uri savedImage = data.getData();
> > > // savedImage is the Uri for the newly created
> > > // edited version of the original image.
> >
> > > ContentResolver cr = getContentResolver();
> >
> > > InputStream in = null;
> > > try {
> > >  in = cr.openInputStream(savedImage);
> > >  // you now have an InputStream to the saved image
> > >  // you can copy it by saving to an OutputStream
> > >  // or you can load it as a Bitmap
> > >  Bitmap bitmap = BitmapFactory.decodeStream(in);
> >
> > > } catch (IOException e)
> > > {
> > > }
> > > }
> > > else
> > > {
> > > // Edit Operation canceled by user
> > > }
> > > }
> >
> > > }
> >
> > > On Mar 5, 9:10 pm, Adobe DI Mobile  wrote:
> >
> > > > ThePhotoshop.com Mobile editor is now available to the Android
> > > > developer community as an activity that handles actions of type
> > > > Intent.ACTION_EDIT, for image content that has data of mime-type
> image/
> > > > *.
> >
> > > > For more information on incorporating the editor into your Android
> > > > application, please visit:
> http://mobile.photoshop.com/android/developers.html
>
> --
> 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

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread Kevin Gaudin
Thanks for the tip, my storePicture() function was based on some code that I
had read in the android camera app... and I wasn't really happy with it so I
will sure modify this soon.

Thanks again !

On Mon, Mar 15, 2010 at 4:54 PM, webmonkey  wrote:

> For your storePicture function it is better to run the MediaScanner to
> add an image file to the MediaStore, see
>
>
> http://developer.android.com/reference/android/media/MediaScannerConnection.html
>
> Just create a MediaScannerConnection, provide a
> MediaScannerConnectionClient, and scan the file. The
> MediaScannerConnectionClient will give you the Uri in onScanCompleted.
>
> You can also use the MediaScanner in the getContentUriFromFile
> function. If should give you the Uri that already exists for the file,
> if not, it will add it automatically.
>
> It is much more future proof than adding an image manually using the
> MediaStore database.
>
>
> On Mar 15, 12:47 am, Nivek  wrote:
> > You can use Astro File Manager or Estrongs File Explorer to backup the
> > Photoshop app on your sdcard.
> >
> > Then, transfer the apk on your computer and install it on a running
> > emulator using adb.
> >
> > adb install Photoshop.apk
> >
> > Now, I implemented a workaround for the problem I detected before:
> > Photoshop can't edit its own results.
> >
> > Actually, I found out that Photoshop was storing its result in
> > MediaStore, so it should have been able to send its result as a
> content://
> > uri since MediaStore gives one !
> >
> > My workaround is to search in the MediaStore for the picture saved by
> > Photoshop. I use the fact that MediaStore stores the path of images in
> > their DATA column.
> >
> > Here is the code :
> http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
> >
> > Here is the call when receiving Photoshop's result:
> http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
> >
> > Kevin
> >
> > On 13 mar, 15:59, nayana urs  wrote:
> >
> >
> >
> > > can we test this feature in emulator
> > > with regards
> > >Nayana
> >
> > > On Fri, Mar 12, 2010 at 6:18 PM, Nivek  wrote:
> > > > > They could have added the result to the MediaStore and returned
> that
> > > > > uri... I'll have to do it myself or my edit button disappears after
> > > > > editing a picture...
> >
> > > > Actually, this is what I will have to do as a workaround, but I can't
> > > > see any reason why they shouldn't accept a file:// uri as an input !
> >
> > > > Kevin
> >
> > > > On 13 mar, 03:10, Nivek  wrote:
> > > > > There is an inconsistency in their Uri handling... The app accepts
> > > > > only content:// Uris but provides the result as a file:// Uri... so
> it
> > > > > can't edit it's own result again without us having to work this
> > > > > around...
> >
> > > > > They could have added the result to the MediaStore and returned
> that
> > > > > uri... I'll have to do it myself or my edit button disappears after
> > > > > editing a picture...
> >
> > > > > I think Adobe should fix this.
> >
> > > > > Kevin
> >
> > > > > On 11 mar, 16:43, webmonkey  wrote:
> >
> > > > > > The document provided by Adobe does not mention how you should
> read
> > > > > > the returned Uri. For compatibility with future versions and
> other
> > > > > > image editors, you should not assume that it is a 'file:' scheme
> Uri,
> > > > > > it could also be a 'content:' scheme Uri. The ContentResolver
> will
> > > > > > handle it. here is the code:
> >
> > > > > > @Override
> > > > > > public void onActivityResult(int requestCode, int resultCode,
> Intent
> > > > > > data)
> > > > > > {
> > > > > > super.onActivityResult(requestCode, resultCode, data);
> > > > > > if (requestCode == LAUNCH_EDITOR)
> > > > > > {
> > > > > > if (resultCode == Activity.RESULT_OK)
> > > > > > {
> > > > > > Uri savedImage = data.getData();
> > > > > > // savedImage is the Uri for the newly created
> > > > > > // edited version of the original image.
> >
> > > > > > ContentResolver cr = getContentResolver();
> >
> > > > > > InputStream in = null;
> > > > > > try {
> > > > > >  in = cr.openInputStream(savedImage);
> > > > > >  // you now have an InputStream to the saved
> image
> > > > > >  // you can copy it by saving to an OutputStream
> > > > > >  // or you can load it as a Bitmap
> > > > > >  Bitmap bitmap = BitmapFactory.decodeStream(in);
> >
> > > > > > } catch (IOException e)
> > > > > > {
> > > > > > }
> > > > > > }
> > > > > > else
> > > > > > {
> > > > > > // Edit Operation canceled by user
> > > > > > }
> > > > > > }
> >
> > > > > > }
> >
> > > > > > On Mar 5, 9:10 pm, Adobe DI Mobile 
> wrote:
> >
> > > > > > > ThePhotoshop.com Mobile editor is now available to the Android
> > > > > > > developer communit