com.android.camera replaced by com.motorola.camera

by Mark Murphy » Fri, 01 Jan 2010 10:46:01 GMT


Sponsored Links
 otobjects wrote:

Magic 8-Ball.

("Do I need an extra on this Intent?" "Signs point to no")

:-)


It's one starting point, to be certain.

In this case, it's using a standard action (ACTION_VIEW) and a
reasonable-looking MIME type. One would hope that there will be 1+
applications on the device that support viewing that MIME type. As it
turns out, there are 2+ in Android proper, as the OP reported that the
Browser handled the request, probably based on scheme.

You'll note that ACTION_VIEW of video/mpeg is not documented in the SDK
anywhere, at least that I can find. This means that it is possible that
a given device may have 0 apps that can support it, if some future
Android edition modifies or drops the intent filter, or if some OEM
messes around too much. That's the reason for my "tell the client there
is no default video player" answer from earlier today, because,
technically, there *isn't* a default video player, at least not one
that's part of the SDK contract.


That depends a bit on what you want to do and how you want to do it.

Given an Intent, you can use methods on PackageManager to figure out if
there is anything that would satisfy that Intent. So, if the feature is
optional, you could use that to disable a menu choice or button or
something, so the user couldn't attempt to use something that would fail.

Similarly, you can use createChooser() to deal with the case of 2+ apps
thinking they can handle the Intent (e.g., email or GMail or SMS or
Twidroid for an ACTION_SEND of text/plain).

If, however, the feature is mandatory (i.e., your app can't run without
it), you're better served trying to handle it yourself, at least as a
fallback option. For example, the OP could implement a simple video
player using VideoView and only resort to using it on devices that fail
to offer anything that can ACTION_VIEW a video/mpeg.

Where things get icky is if there is some device or app that does
"support" ACTION_VIEW of a video/mpeg URL, but its support is broken
somehow. This is not significantly different than a desktop OS video
player not necessarily having the right codecs to play back such-and-so
video content, and there's no great answer for that case, either.

Intents and MIME types are not significantly different concepts from
their equivalents in desktop OSes. We think that Android should know how
to play video because we see our desktops able to play video from a URL.
However, at the same time, those of us who don't use Windows much are
used to the notion that certain things can't readily be viewed (e.g.,
link to a Microsoft Access database), MIME type or not. Just as savvy
developers try to make their desktop or Web applications deal with
varying end user support for different MIME types, so should Android
developers.

Now, it would be really cool if Google stepped up and declared a more
extensive list of Intent actions and Uri/MIME types that all Android
devices should support. That would go a long way towards clearing up the
sorts of issues the OP encountered. Right now, there's only a half-dozen
in the list, and none are based on MIME type:

http://developer.android.com/guide/appendix/g-app-intents.html

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

_The Busy Coder's Guide to Android Development_ Version 2.8
Available!

--



Other Threads

1. Application Android keyboard stoppe

Every time I restart Android I'm getting the error:

The application Android keyboard (process
com.android.inputmethod.latin) has stopped unexpectedly. Please try
again.

With logcat I get the following:

I/InputManagerService( 2104): Enabled input methods:
com.example.android.softkeyboard/.SoftKeyboard:com.android.inputmethod.latin/.LatinIME
I/ActivityManager( 2104): Start proc com.android.inputmethod.latin for
service com.android.inputmethod.latin/.LatinIME: pid=2162 uid=10002
gids={3003}
E/dalvikvm( 2162): Could not find method
android.view.inputmethod.InputConnection.getTextBeforeCursor,
referenced from method
com.android.inputmethod.latin.LatinIME.doubleSpace
W/dalvikvm( 2162): VFY: unable to resolve interface method 158:
Landroid/view/inputmethod/InputConnection;.getTextBeforeCursor (II)
Ljava/lang/CharSequence;
W/dalvikvm( 2162): VFY:  rejecting opcode 0x72 at 0x0011
W/dalvikvm( 2162): VFY:  rejected Lcom/android/inputmethod/latin/
LatinIME;.doubleSpace ()V
W/dalvikvm( 2162): Verifier rejected class Lcom/android/inputmethod/
latin/LatinIME;
W/dalvikvm( 2162): Class init failed in newInstance call (Lcom/android/
inputmethod/latin/LatinIME;)
D/AndroidRuntime( 2162): Shutting down VM
W/dalvikvm( 2162): threadid=3: thread exiting with uncaught exception
(group=0xa8007df8)
E/AndroidRuntime( 2162): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 2162): java.lang.VerifyError:
com.android.inputmethod.latin.LatinIME
E/AndroidRuntime( 2162):        at java.lang.Class.newInstanceImpl
(Native Method)
E/AndroidRuntime( 2162):        at java.lang.Class.newInstance
(Class.java:1458)
E/AndroidRuntime( 2162):        at
android.app.ActivityThread.handleCreateService(ActivityThread.java:
2334)
E/AndroidRuntime( 2162):        at android.app.ActivityThread.access
$2800(ActivityThread.java:112)
E/AndroidRuntime( 2162):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1638)
E/AndroidRuntime( 2162):        at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime( 2162):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime( 2162):        at android.app.ActivityThread.main
(ActivityThread.java:3790)
E/AndroidRuntime( 2162):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2162):        at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime( 2162):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:745)
E/AndroidRuntime( 2162):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:503)
E/AndroidRuntime( 2162):        at dalvik.system.NativeStart.main
(Native Method)
I/Process ( 2104): Sending signal. PID: 2162 SIG: 3
I/dalvikvm( 2162): threadid=7: reacting to signal 3

Any suggests what could be wrong?
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. How do the services communicate with each other?

HI there,
I am trying to send AT commands via Ril from LocationManager as there
is only one AT port I can use. But it seems like that there is no
ways
to call the function refer to Ril. Can I just new a commandsinterface
and to call ril's functions via it?

Any ideas will be great appreciated.

Thanks&BestRegards,
Nio
--~--~---------~--~----~------------~-------~--~----~

3. Any more info about android.os.RemoteException ??

4. Any more info about android.os.RemoteException ??

5. setup of darwin streaming server

6. handle Camera preview data without a SurfaceView

7. opencore and alsa