Click here to Skip to main content
15,889,462 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: need help !!!!!! Pin
gif20205-Nov-11 0:38
gif20205-Nov-11 0:38 
GeneralRe: need help !!!!!! Pin
Richard MacCutchan5-Nov-11 3:48
mveRichard MacCutchan5-Nov-11 3:48 
GeneralRe: need help !!!!!! Pin
Dennis E White7-Nov-11 6:37
professionalDennis E White7-Nov-11 6:37 
QuestionAdobe Flash Builder 4.5 with Flex Pin
Member 42219283-Nov-11 7:32
Member 42219283-Nov-11 7:32 
AnswerRe: Adobe Flash Builder 4.5 with Flex Pin
parthibandharma3-Nov-11 23:31
professionalparthibandharma3-Nov-11 23:31 
QuestionRecycle bin for android mobile Pin
Navdeep Kumar Jain31-Oct-11 19:19
Navdeep Kumar Jain31-Oct-11 19:19 
AnswerRe: Recycle bin for android mobile Pin
Peter_in_278031-Oct-11 19:43
professionalPeter_in_278031-Oct-11 19:43 
QuestionHow to register sound in Android Emulator? Pin
Alex_RO31-Oct-11 4:02
Alex_RO31-Oct-11 4:02 
I'm trying to record sound using Android Emulator.I know that this question is popular over the internet, i checked many posts, it seems that only one person succeded:
http://stackoverflow.com/questions/5254994/can-the-android-emulator-record-and-play-back-audio-using-pc-hardware/6972022#6972022
and following his advice and the official site tutorial http://developer.android.com/guide/topics/media/audio-capture.html and also other resources, I'm still not able to record. My application throws exception at line

fMediaRecorder.start();

I added both audio record and external storage permisions in AndroidManifest.xml and both audio hardware settings to the emulator 2.3.3 on Win 7.Is anything wrong within my app,the way I storage the file or somethingelse? Please, if any body has any ideea feel free to share, it will be apreciated.Thanks. Here is the full source code:
Java
<pre>package your.pack.newsound;

import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
import android.app.Activity;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class RecordSoundActivity extends Activity {
	
	private MediaRecorder fMediaRecorder =null;
	private Button btnrecord;
	private Button btnstop;
	String fTmpFile;
	
	public RecordSoundActivity(){
		
		fTmpFile = Environment.getExternalStorageDirectory().getPath();
		fTmpFile +="/audiorecordtest.3gp";
	}
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        btnrecord=(Button)findViewById(R.id.button1);
        btnstop = (Button)findViewById(R.id.button2);
        
        btnrecord.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
					Toast.makeText(RecordSoundActivity.this, "Recording...", Toast.LENGTH_LONG).show();
				 Recording();
			}
		});
        
        btnstop.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				fMediaRecorder.stop();
				fMediaRecorder.release();
			}
		});
    }  
    
     public void Recording(){   
        fMediaRecorder= new MediaRecorder();
        fMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        fMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP );
        fMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        
        fMediaRecorder.setAudioChannels(1);
        fMediaRecorder.setAudioSamplingRate(8000);
        
        fMediaRecorder.setOutputFile(fTmpFile);
   
        try {
			fMediaRecorder.prepare();
		} catch (IOException e) {
			// TODO: handle exception
			Log.e("Trying to record.. ", "prepare() failed");
		}
        try{
		fMediaRecorder.start();
		}
        catch (Exception e) {
			// TODO: handle exception
        	Log.e("Start", "crash at start");
        	//e.printStackTrace();
		}
		
		//fMediaRecorder.stop();
		//fMediaRecorder.release();
    }
}

QuestionGraphic problem? Pin
Macdon7824-Oct-11 21:57
Macdon7824-Oct-11 21:57 
AnswerRe: Graphic problem? Pin
Richard MacCutchan25-Oct-11 0:45
mveRichard MacCutchan25-Oct-11 0:45 
Questionwhat is mobile application? Pin
sathyan_829424-Oct-11 0:18
sathyan_829424-Oct-11 0:18 
AnswerRe: what is mobile application? Pin
Richard MacCutchan24-Oct-11 1:20
mveRichard MacCutchan24-Oct-11 1:20 
AnswerRe: what is mobile application? Pin
elgaabeb14-Nov-11 2:54
elgaabeb14-Nov-11 2:54 
QuestionCan bitmaps be inserted and rendered along with text in an Android text box or other control Pin
Stevej18-Oct-11 10:27
Stevej18-Oct-11 10:27 
AnswerRe: Can bitmaps be inserted and rendered along with text in an Android text box or other control Pin
Nagy Vilmos18-Oct-11 22:08
professionalNagy Vilmos18-Oct-11 22:08 
GeneralRe: Can bitmaps be inserted and rendered along with text in an Android text box or other control Pin
Stevej19-Oct-11 8:10
Stevej19-Oct-11 8:10 
AnswerRe: Can bitmaps be inserted and rendered along with text in an Android text box or other control Pin
Stevej20-Oct-11 11:37
Stevej20-Oct-11 11:37 
QuestionWP7 q Pin
David Crow18-Oct-11 7:29
David Crow18-Oct-11 7:29 
AnswerRe: WP7 q Pin
Pete O'Hanlon18-Oct-11 7:35
mvePete O'Hanlon18-Oct-11 7:35 
GeneralRe: WP7 q Pin
David Crow18-Oct-11 8:40
David Crow18-Oct-11 8:40 
GeneralRe: WP7 q Pin
Pete O'Hanlon18-Oct-11 9:06
mvePete O'Hanlon18-Oct-11 9:06 
QuestionHow to capture inserting terminal to cradle Pin
Gali197814-Oct-11 21:41
Gali197814-Oct-11 21:41 
AnswerRe: How to capture inserting terminal to cradle Pin
david_acr28-Nov-11 22:49
david_acr28-Nov-11 22:49 
QuestionHelp deciding on mobile/tablet platform. Pin
Stevej13-Oct-11 5:56
Stevej13-Oct-11 5:56 
AnswerRe: Help deciding on mobile/tablet platform. Pin
RobCroll13-Oct-11 16:17
RobCroll13-Oct-11 16:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.