Go Back   Android Forums > Android Discussion > Android Applications
Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old October 14th, 2010, 04:46 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Audio player

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 {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

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

tenz is offline  
Reply With Quote
Sponsors
Reply


Go Back   Android Forums > Android Discussion > Android Applications
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 03:57 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.