Standard Android Music Player

by Nick Mitin » Tue, 09 Feb 2010 01:41:56 GMT


Sponsored Links
 Is there any way to pass a file or a playlist to a standard Android
Music Player? I guess almost all applications, for instance, i Music
do it.

--



Standard Android Music Player

by Sean Hodges » Tue, 09 Feb 2010 16:52:59 GMT


 Accroding to a comment in the OpenIntents site
( http://www.openintents.org/en/node/112 ), this should work:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("file:///sdcard/song.mp3");
String type = "audio/mp3";
intent.setDataAndType(data, type);
startActivity(intent);

Haven't tested it though.




>


Sponsored Links


Other Threads

1. what is difference between startActivity and startSubActivity()

hi,
what is the scenario that makes me to pick between startActivity and
startSubActivity

--~--~---------~--~----~------------~-------~--~----~

2. Why standard component with private members?

I write my own text display component, which similar to TextView, but
I wanna handle the spacing between words, and show cursor if user
clicked on spacing, or show selection mark if user clicked on word.

I suppose this implementation is an easy job, I should write my own
component extended from TextView, and overrides a few functions, such
as onDraw(), onTouch(), etc.

However, I found it's more difficult than my anticipation, after I
study the source code of TextView. Because the TextPaint is a private
member in TextView, and be used everywhere. That means if I wanna
override onDraw(), I have to create my own TextPaint member, and
override each functions which use the private TextPaint member.

I don't understand why the TextPain member in TextView is private? I
don't know why TextView do not allows subclass to use its members
(TextPaint just one of them)? I just know this design is unfavorable
to extend from standard component to develop my own component.

Eventually, I write my own component extended from View, and write
each function manually. I think components in SDK should not with
private member, it is not convenient for Android designer, I suggests
to review it.
--~--~---------~--~----~------------~-------~--~----~

3. BroadcastReceiver for a Service to catch broadcast Intent ACTION_BOOT_COMPLETED

4. Shared preferences not accessible in service

5. Looks promising ...

6. Incorrect use of SkAlpha255To256 trick in Skia

7. Android Browser - Downloading files with square brackets in the name [ ]