There isn't a forum setup as of right now. Perhaps a Google Group would be the way to go. Do you have any thoughts about that? Actually, I just created one and am cross-posting this to that group. (http://groups.google.com/group/android-media-developers)
Not a dumb question at all. I think the issue is that it assumes an SD card is available and mounted by your device. Any chance yours is removed? (It could automatically be mounted by your computer when you connect via USB and therefore unavailable on the phone itself.)
You could try using the INTERNAL_CONTENT_URI instead which will attempt to store the image in the internal phone memory rather than the SD card.
Let me know (hopefully via the android-media-developers group) how it goes.
Best,
shawn
On Feb 8, 2011, at 4:59 PM, ambrose lewis wrote:
> Hi Shawn:
> Very excited about your Android Media book...I just got it yesterday and it seems like it will be a big help!
>
> I'm running into a issue with the second program...is there some forum to ask questions about the book?
> My development environment is a windows pc/eclipse and a Verizon Droid 2 (Version 2.3.20.A955.Verizon.en.US) connected via USB.
> I downloaded the source code from the book's APress page and imported them into eclipse as android applications. When I try to run "Pro Android Media Ch 1 - MediaStore Camera Intent", I get the following error:
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): java.lang.UnsupportedOperationException: Unknown URI: content://media/external/images/media
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1859)
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1801)
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:168)
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at android.os.Binder.execTransact(Binder.java:304)
> 02-08 16:50:04.113: ERROR/DatabaseUtils(1425): at dalvik.system.NativeStart.run(Native Method)
> I used log statements to zero in on the line:
>
> imageFileUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, new ContentValues());
>
> Any ideas???
>
> Sorry if this is a dumb question
>
> amb
>
Shawn Van Every
vane...@walking-productions.com
Mobile and Streaming Consulting
http://www.walking-productions.com/notslop
Author: Pro Android Media: http://amzn.to/eYb48C
Thanks for the repost. Were you able to resolve the issue?
I have heard (I haven't used a Droid myself) that it might automount the SD card on your computer and therefore it would be unavailable on the phone making anything that attempts to use it during that time fail.
-s
Shawn Van Every
vane...@walking-productions.com
Mobile and Streaming Consulting
Any chance you tried it with the INTERNAL_CONTENT_URI rather than the EXTERNAL_CONTENT_URI?
I'll have to try this out on a Droid and report back.
Shawn Van Every
vane...@walking-productions.com
Mobile and Streaming Consulting
What version of Android is your Droid 2 running?
Attached is an updated version of the project. If you could run it and give the logcat output I would appreciate it.