Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Android Wear, House and Home & Automotive forums!
Please report any threads you come across that should be moved to these new sections!

test: Reply
 
LinkBack Thread Tools
Old October 1st, 2012, 10:49 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create sdcard in emulater to save recorded file??

Hi all,
i am beginner in android development.i am trying to recording on button click.

mycode is following::
HTML Code:
HTML Code:
private void StartAudioRecording() {
		File sampleDir=Environment.getExternalStorageDirectory();
		try {
			audioFile=File.createTempFile("sound","3gp",sampleDir);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
		recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
		recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
		recorder.setOutputFile(audioFile.getAbsolutePath());
		try {
			recorder.prepare();
		} catch (IllegalStateException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		recorder.start();
	}
when i was running application in debug mode application getting crash.pls tell me what is wrong in this code.....
i am not getting sdcard path .

pls help me how to solve my issue.

thanks in advance
Ambrish Singh

ambblr108 is offline  
Reply With Quote
sponsored links
Old October 2nd, 2012, 08:07 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 480 Times in 294 Posts
Default

Can you please post the log cat output?
jonbonazza is offline  
Reply With Quote
Old October 2nd, 2012, 10:06 AM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is my LOG CAT::
10-02 20:13:01.220: W/ActivityThread(274): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:13:01.240: I/System.out(274): Sending WAIT chunk
10-02 20:13:01.320: I/dalvikvm(274): Debugger is active
10-02 20:13:01.450: I/System.out(274): Debugger has connected
10-02 20:13:01.450: I/System.out(274): waiting for debugger to settle...
10-02 20:13:01.650: I/System.out(274): waiting for debugger to settle...
10-02 20:13:01.850: I/System.out(274): waiting for debugger to settle...
10-02 20:13:02.049: I/System.out(274): waiting for debugger to settle...
10-02 20:13:02.250: I/System.out(274): waiting for debugger to settle...
10-02 20:13:02.452: I/System.out(274): waiting for debugger to settle...
10-02 20:13:02.659: I/System.out(274): waiting for debugger to settle...
10-02 20:13:02.859: I/System.out(274): waiting for debugger to settle...
10-02 20:13:03.060: I/System.out(274): waiting for debugger to settle...
10-02 20:13:03.260: I/System.out(274): waiting for debugger to settle...
10-02 20:13:03.460: I/System.out(274): waiting for debugger to settle...
10-02 20:13:03.669: I/System.out(274): debugger has settled (1443)
10-02 20:15:42.639: D/AndroidRuntime(274): Shutting down VM
10-02 20:15:42.639: W/dalvikvm(274): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-02 20:15:42.700: E/AndroidRuntime(274): FATAL EXCEPTION: main
10-02 20:15:42.700: E/AndroidRuntime(274): java.lang.NullPointerException
10-02 20:15:42.700: E/AndroidRuntime(274): at com.example.acumobile.AcuAudioRecording.StartAudio Recording(AcuAudioRecording.java:54)
10-02 20:15:42.700: E/AndroidRuntime(274): at com.example.acumobile.AcuAudioRecording.StartRecor ding(AcuAudioRecording.java:27)
10-02 20:15:42.700: E/AndroidRuntime(274): at com.example.acumobile.Dictatte$2.onClick(Dictatte. java:34)
10-02 20:15:42.700: E/AndroidRuntime(274): at android.view.View.performClick(View.java:2408)
10-02 20:15:42.700: E/AndroidRuntime(274): at android.view.View$PerformClick.run(View.java:8816)
10-02 20:15:42.700: E/AndroidRuntime(274): at android.os.Handler.handleCallback(Handler.java:587 )
10-02 20:15:42.700: E/AndroidRuntime(274): at android.os.Handler.dispatchMessage(Handler.java:92 )
10-02 20:15:42.700: E/AndroidRuntime(274): at android.os.Looper.loop(Looper.java:123)
10-02 20:15:42.700: E/AndroidRuntime(274): at android.app.ActivityThread.main(ActivityThread.jav a:4627)
10-02 20:15:42.700: E/AndroidRuntime(274): at java.lang.reflect.Method.invokeNative(Native Method)
10-02 20:15:42.700: E/AndroidRuntime(274): at java.lang.reflect.Method.invoke(Method.java:521)
10-02 20:15:42.700: E/AndroidRuntime(274): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
10-02 20:15:42.700: E/AndroidRuntime(274): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
10-02 20:15:42.700: E/AndroidRuntime(274): at dalvik.system.NativeStart.main(Native Method)
10-02 20:16:12.050: W/ActivityThread(304): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:16:12.081: I/System.out(304): Sending WAIT chunk
10-02 20:16:12.081: I/dalvikvm(304): Debugger is active
10-02 20:16:12.131: I/System.out(304): Debugger has connected
10-02 20:16:12.131: I/System.out(304): waiting for debugger to settle...
10-02 20:16:12.330: I/System.out(304): waiting for debugger to settle...
10-02 20:16:12.581: I/System.out(304): waiting for debugger to settle...
10-02 20:16:12.781: I/System.out(304): waiting for debugger to settle...
10-02 20:16:12.980: I/System.out(304): waiting for debugger to settle...
10-02 20:16:13.181: I/System.out(304): waiting for debugger to settle...
10-02 20:16:13.380: I/System.out(304): waiting for debugger to settle...
10-02 20:16:13.589: I/System.out(304): debugger has settled (1491)
10-02 20:17:15.080: D/AndroidRuntime(304): Shutting down VM
10-02 20:17:15.080: W/dalvikvm(304): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-02 20:17:15.161: E/AndroidRuntime(304): FATAL EXCEPTION: main
10-02 20:17:15.161: E/AndroidRuntime(304): java.lang.NullPointerException
10-02 20:17:15.161: E/AndroidRuntime(304): at com.example.acumobile.AcuAudioRecording.StartAudio Recording(AcuAudioRecording.java:54)
10-02 20:17:15.161: E/AndroidRuntime(304): at com.example.acumobile.AcuAudioRecording.StartRecor ding(AcuAudioRecording.java:27)
10-02 20:17:15.161: E/AndroidRuntime(304): at com.example.acumobile.Dictatte$2.onClick(Dictatte. java:34)
10-02 20:17:15.161: E/AndroidRuntime(304): at android.view.View.performClick(View.java:2408)
10-02 20:17:15.161: E/AndroidRuntime(304): at android.view.View$PerformClick.run(View.java:8816)
10-02 20:17:15.161: E/AndroidRuntime(304): at android.os.Handler.handleCallback(Handler.java:587 )
10-02 20:17:15.161: E/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:92 )
10-02 20:17:15.161: E/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123)
10-02 20:17:15.161: E/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.jav a:4627)
10-02 20:17:15.161: E/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method)
10-02 20:17:15.161: E/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521)
10-02 20:17:15.161: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
10-02 20:17:15.161: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
10-02 20:17:15.161: E/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method)
10-02 20:17:47.550: W/ActivityThread(329): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:17:47.601: I/System.out(329): Sending WAIT chunk
10-02 20:17:47.601: I/dalvikvm(329): Debugger is active
10-02 20:17:47.610: I/System.out(329): Debugger has connected
10-02 20:17:47.620: I/System.out(329): waiting for debugger to settle...
10-02 20:17:47.931: I/System.out(329): waiting for debugger to settle...
10-02 20:17:48.130: I/System.out(329): waiting for debugger to settle...
10-02 20:17:48.330: I/System.out(329): waiting for debugger to settle...
10-02 20:17:48.530: I/System.out(329): waiting for debugger to settle...
10-02 20:17:48.789: I/System.out(329): waiting for debugger to settle...
10-02 20:17:48.990: I/System.out(329): debugger has settled (1364)
10-02 20:21:08.590: W/ActivityThread(351): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:21:08.600: I/System.out(351): Sending WAIT chunk
10-02 20:21:08.609: I/dalvikvm(351): Debugger is active
10-02 20:21:08.809: I/System.out(351): Debugger has connected
10-02 20:21:08.809: I/System.out(351): waiting for debugger to settle...
10-02 20:21:09.009: I/System.out(351): waiting for debugger to settle...
10-02 20:21:09.220: I/System.out(351): waiting for debugger to settle...
10-02 20:21:09.419: I/System.out(351): waiting for debugger to settle...
10-02 20:21:09.619: I/System.out(351): waiting for debugger to settle...
10-02 20:21:09.829: I/System.out(351): waiting for debugger to settle...
10-02 20:21:10.029: I/System.out(351): debugger has settled (1405)
10-02 20:23:14.284: D/AndroidRuntime(351): Shutting down VM
10-02 20:23:14.284: W/dalvikvm(351): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-02 20:23:34.239: E/AndroidRuntime(351): FATAL EXCEPTION: main
10-02 20:23:34.239: E/AndroidRuntime(351): java.lang.NullPointerException
10-02 20:23:34.239: E/AndroidRuntime(351): at com.example.acumobile.AcuAudioRecording.StartAudio Recording(AcuAudioRecording.java:54)
10-02 20:23:34.239: E/AndroidRuntime(351): at com.example.acumobile.AcuAudioRecording.StartRecor ding(AcuAudioRecording.java:27)
10-02 20:23:34.239: E/AndroidRuntime(351): at com.example.acumobile.Dictatte$2.onClick(Dictatte. java:34)
10-02 20:23:34.239: E/AndroidRuntime(351): at android.view.View.performClick(View.java:2408)
10-02 20:23:34.239: E/AndroidRuntime(351): at android.view.View$PerformClick.run(View.java:8816)
10-02 20:23:34.239: E/AndroidRuntime(351): at android.os.Handler.handleCallback(Handler.java:587 )
10-02 20:23:34.239: E/AndroidRuntime(351): at android.os.Handler.dispatchMessage(Handler.java:92 )
10-02 20:23:34.239: E/AndroidRuntime(351): at android.os.Looper.loop(Looper.java:123)
10-02 20:23:34.239: E/AndroidRuntime(351): at android.app.ActivityThread.main(ActivityThread.jav a:4627)
10-02 20:23:34.239: E/AndroidRuntime(351): at java.lang.reflect.Method.invokeNative(Native Method)
10-02 20:23:34.239: E/AndroidRuntime(351): at java.lang.reflect.Method.invoke(Method.java:521)
10-02 20:23:34.239: E/AndroidRuntime(351): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
10-02 20:23:34.239: E/AndroidRuntime(351): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
10-02 20:23:34.239: E/AndroidRuntime(351): at dalvik.system.NativeStart.main(Native Method)
10-02 20:24:11.749: W/ActivityThread(375): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:24:11.779: I/System.out(375): Sending WAIT chunk
10-02 20:24:11.789: I/dalvikvm(375): Debugger is active
10-02 20:24:11.979: I/System.out(375): Debugger has connected
10-02 20:24:11.979: I/System.out(375): waiting for debugger to settle...
10-02 20:24:12.180: I/System.out(375): waiting for debugger to settle...
10-02 20:24:12.390: I/System.out(375): waiting for debugger to settle...
10-02 20:24:12.590: I/System.out(375): waiting for debugger to settle...
10-02 20:24:12.789: I/System.out(375): waiting for debugger to settle...
10-02 20:24:12.989: I/System.out(375): waiting for debugger to settle...
10-02 20:24:13.189: I/System.out(375): debugger has settled (1395)
10-02 20:26:37.609: D/AndroidRuntime(375): Shutting down VM
10-02 20:26:37.609: W/dalvikvm(375): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-02 20:26:37.689: E/AndroidRuntime(375): FATAL EXCEPTION: main
10-02 20:26:37.689: E/AndroidRuntime(375): java.lang.NullPointerException
10-02 20:26:37.689: E/AndroidRuntime(375): at com.example.acumobile.AcuAudioRecording.StartAudio Recording(AcuAudioRecording.java:54)
10-02 20:26:37.689: E/AndroidRuntime(375): at com.example.acumobile.AcuAudioRecording.StartRecor ding(AcuAudioRecording.java:27)
10-02 20:26:37.689: E/AndroidRuntime(375): at com.example.acumobile.Dictatte$2.onClick(Dictatte. java:34)
10-02 20:26:37.689: E/AndroidRuntime(375): at android.view.View.performClick(View.java:2408)
10-02 20:26:37.689: E/AndroidRuntime(375): at android.view.View$PerformClick.run(View.java:8816)
10-02 20:26:37.689: E/AndroidRuntime(375): at android.os.Handler.handleCallback(Handler.java:587 )
10-02 20:26:37.689: E/AndroidRuntime(375): at android.os.Handler.dispatchMessage(Handler.java:92 )
10-02 20:26:37.689: E/AndroidRuntime(375): at android.os.Looper.loop(Looper.java:123)
10-02 20:26:37.689: E/AndroidRuntime(375): at android.app.ActivityThread.main(ActivityThread.jav a:4627)
10-02 20:26:37.689: E/AndroidRuntime(375): at java.lang.reflect.Method.invokeNative(Native Method)
10-02 20:26:37.689: E/AndroidRuntime(375): at java.lang.reflect.Method.invoke(Method.java:521)
10-02 20:26:37.689: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
10-02 20:26:37.689: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
10-02 20:26:37.689: E/AndroidRuntime(375): at dalvik.system.NativeStart.main(Native Method)
10-02 20:27:06.679: W/ActivityThread(399): Application com.example.acumobile is waiting for the debugger on port 8100...
10-02 20:27:06.729: I/System.out(399): Sending WAIT chunk
10-02 20:27:06.729: I/dalvikvm(399): Debugger is active
10-02 20:27:06.933: I/System.out(399): Debugger has connected
10-02 20:27:06.933: I/System.out(399): waiting for debugger to settle...
10-02 20:27:07.140: I/System.out(399): waiting for debugger to settle...
10-02 20:27:07.339: I/System.out(399): waiting for debugger to settle...
10-02 20:27:07.539: I/System.out(399): waiting for debugger to settle...
10-02 20:27:07.739: I/System.out(399): waiting for debugger to settle...
10-02 20:27:07.939: I/System.out(399): waiting for debugger to settle...
10-02 20:27:08.149: I/System.out(399): debugger has settled (1407)


i am getting exception::
Source file not found when i am debugging the application......
pls help me
ambblr108 is offline  
Reply With Quote
Old October 2nd, 2012, 01:36 PM   #4 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 480 Times in 294 Posts
Default

What is line 54 in your AcuAudioRecording class (AcuAudioRecording.java file)?
jonbonazza is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
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 08:40 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.