In fact want to determine if MediaPlayer supports playback of WMA.
Now that I think of it, the Android background music scanner must have
that
info somewhere, to index files it can manage.


On Aug 24, 8:38 am, James <[email protected]> wrote:
> Hi Mark,
> 1,This is only sample code demonstrate how to do it. As I have
> notified, it even *may not pass compile*.
> 2,Do you think any OEM who support some kind of codec, But distribute
> a device without a built-in corresponding media player ?? One thing
> more, My sample code could also detect if any 3rd apps installed on
> the device has implements the codec.
>
> On Aug 24, 12:57 pm, Mark Murphy <[email protected]> wrote:
>
>
>
>
>
>
>
> > There are a couple of flaws here:
>
> > 1. /sdcard is probably invalid.
>
> > 2. This only detects if there is a player advertising that it handles
> > audio/wma files. This does not mean that the player is correct, nor
> > does it mean that anything other than the player can play WMA files
> > (e.g., via MediaPlayer)
>
> > On Tue, Aug 23, 2011 at 9:10 PM, James <[email protected]> wrote:
> > > Of course there is:
> > > ---------------------------------------------------------------------------
> > >  --------------------------
> > >  Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
> > >  Uri data = Uri.fromFile(new File("/sdcard/test.wma"));
> > > intent.setDataAndType(data, "audio/wma");
> > >  List<ResolveInfo> resolveInfos=
> > > getPackageManager().queryIntentActivities (intent, 0);
> > > boolean wmaCodecReady=resolveInfos.size()>0;
> > > ---------------------------------------------------------------------------
> > >  -----------------------------------
> > > the above code may not pass compile and is just FYI.
> > > Hope it helps!
>
> > > On Aug 24, 6:40 am, b0b <[email protected]> wrote:
> > >> Is there a sensible way to detect if a particular audio decoder  which
> > >> may or may not be present depending on manufaturers,  is available
> > >> (for example: WMA) ?
>
> > >> Right now I'm asking the user. There has to be a better way ?
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android 3.1 Programming 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to