1. Check out our companion app, Forums for Android! Download from Google Play

Audio player

Discussion in 'Android Apps & Games' started by tenz, Oct 14, 2010.

  1. tenz

    tenz New Member
    Thread Starter

    Oct 14, 2010
    First off, please forgive me. I am a complete noob in the world of android and eclipse.

    I am trying to write an app that
    - Will play an .mp3 and gets called from adb shell.
    - I need the audio to play in the background (I don't ever want the app to be visible to the user).
    - I need to be able to 'mix' audio files (song B plays on top of song A).

    In my research I have read that the way to do this on Android is as a Service, but I have not been able to figure one out. I am using Eclipse. Below is the Activity that I have written. I call it from adb shell using this:
    am start -n com.icon.mediaplayer/.play -d "/mnt/sdcard/here.mp3"

    Can anyone offer me some advise?

    package com.icon.mediaplayer;

    import android.app.Activity;
    import android.os.Bundle;
    import java.io.IOException;
    import android.util.Log;

    public class play extends Activity {

    public void onCreate(Bundle savedInstanceState) {

    try {
    Global.mp.setDataSource( this.getIntent().getDataString() );
    //Global.mp.setDataSource( "/mnt/sdcard/here.mp3" );
    } catch(IOException e) {
    Log.v(getString(R.string.app_name), e.getMessage());


Share This Page