play external .mp3 file

by Victor Hugo » Fri, 23 Apr 2010 00:18:00 GMT


Sponsored Links
 Hi people,

im playing a mp3 file on my emulador using
that code:

MediaPlayer mediaPlayer = Player.create(getApplicationContext(),
R.raw.mymusic);
mediaPlayer.start();

but i need play a mp3 file from my server
example:  http://www.myserver.com/mymusic.mp3 

how do i to play that mp3 file????

hugs

--



play external .mp3 file

by Rog茅rio de Souza Moraes » Fri, 23 Apr 2010 00:43:15 GMT


 Hi Victor,

take a look at this tutorial. I think this is what you want.

 http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/ 

Regards,

Rogerio

2010/4/22 Victor Hugo <vhs...@gmail.com>

>


Sponsored Links


play external .mp3 file

by Victor Hugo » Fri, 23 Apr 2010 03:04:48 GMT


 ty Rogrio

On 22 abr, 13:43, Rogrio de Souza Moraes <rogerio.so...@gmail.com>


> >



Other Threads

1. Eclipse not recoginizing my attached Hero, Ubuntu 9.10

[Solved]
Slightly unrelated topic but provided the solution none the less.

2. nullPointerException with custom ArrayAdapter

You need something like this in the getView to create the view if it 
hasn't been created already.:


                 if (convertView == null)
                 {
LayoutInflater inflater = Groups.this.getLayoutInflater(); convertView = inflater.inflate(R.layout.groupitem, null); }
hello, I have written a custom ArrayAdapter for a ListActivity : private class StepItemAdapter extends ArrayAdapter<Step> { public StepItemAdapter(Context context, List<Step> objects) { super(context, R.layout.step_list_item, R.id.list_item_sb, objects); } @Override public View getView(final int pos, View convertView, ViewGroup parent) { View v = super.getView(pos, convertView, parent); // will crash here // etc ... } } On the "onCreate" method of the activity I tell the activity to use this adapter with a list of object I get from somewhere else ("t.getSteps()") : adapter = new StepItemAdapter(this, t.getSteps()); this.setListAdapter(adapter); Everything works fine and the activity is displayed. But if I add a new object to the list and tell the adapter to refresh the view I've got an error : t.getSteps().add(3, new Step()); adapter.notifyDataSetChanged(); The "getView" method of my adapter is called, which is ok since the list view need to be updated, but I've got an exception on the call to "super.getView(pos, convertView, parent)". The stack trace : java.lang.NullPointerException at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java: 355) at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323) at pkr.tm.activities.EditTemplateActivity $StepItemAdapter.getView(EditTemplateActivity.java:145) at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java: 220) at android.widget.AbsListView.obtainView(AbsListView.java:1294) at android.widget.ListView.makeAndAddView(ListView.java:1727) at android.widget.ListView.fillDown(ListView.java:652) at android.widget.ListView.fillSpecific(ListView.java:1284) at android.widget.ListView.layoutChildren(ListView.java:1558) at android.widget.AbsListView.onLayout(AbsListView.java:1147) ... Do you guy have any ideas of what is going on ??
-- Sincerely, Brad Gies ----------------------------------------------------------------------- Bistro Bot - Bistro Blurb http://www.bgies.com http://www.bistroblurb.com http://www.bistrobot.com ----------------------------------------------------------------------- Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead --

3. Eclipse not recoginizing my attached Hero, Ubuntu 9.10

4. nullPointerException with custom ArrayAdapter

5. Downloads & Active installs numbers frozen on Developer Console?

6. Developer Console - update "Total" download count

7. Same problem