ApiLevel 21 batteryLevel 0.63 charging false freeDisk 4.0 freeMemory 182602840 jailbroken false locale enUS locationStatus allowed manufacturer HTC model HTC One networkAccess wifi orientation portrait osBuild LRX22C.H3 release-keys osName android osVersion 5.0.1 screenDensity 3 screenResolution 1920x1080 totalMemory 201326592. 如何在Android Gradle配置中获取当前的buildType 在活动生命周期中处理RxJava / RxAndroid中的订阅的正确方法是什么? 如何改变摄像头预览callback缓冲区的方向? 在Android中启动新活动后调用finish()是个好主意吗?.
I want to use MediaRecorder to record voice, my code is:
Or
On a Samsung all is OK, but on a Dell two methods do not succeed
Here is logcat:
First at all you code looks fine. Have you added the required permissions to your manifest file?
If yes, then try replacing:
by
Don't forget to check if the path of your video file is correct.
Lazy NinjaLazy NinjaThis is a big problem but has a very small solution
In most cases, the filename that we get from this.file.getAbsolutePath() contains file:/// as a prefix
Hope you find this answer helpful
This Exception will be raised . if any of the following things failed:
file not found: Ensure that output file location that yu have specified is existing, otherwise it will throw you filenotfoundexception
Write Permission: You must specify Write permission in your manifest file.
Record permission : specify Record permission in your manifest file.
you can use this..
Still you get error..try display the error. Like this
mRecorder.start();
I deleted
this.mediaRecorder.setAudioEncodingBitRate(16);
at method 2 and now it's working.
CopsOnRoadIt's just crazy, my app will work fine on a Nexus 4 running KitKat but be laggy on a Nexus 5, similarly with an S3, and HTC One?
I'm using the media recorder and media player API in the app, is there seriously this much of a difference between phones or am I missing something?
EDIT: Thanks everyone for the help! Much appreciated I think I've solved the problem with the app crashing now simply by checking if the file I'm looking to play exists using..
if (arg1.getAction() MotionEvent.ACTION_DOWN) {