As I want to record audio in background I use service..But I am not able to record the audio in service.
I tried same code in Activity it works for me. but how to do
For starting the recording in backgroun you can either
create a thread and do the recording inside a thread.
create a service which will run in background.
Hope it helps.
Thread recordInBackGround= new Thread(new Runnable() {
@Override
public void run() {
//Your recording portion of the code goes here.
}
});
recordInBackGround.start();