0

My app has voip functionality and works fine on an emulator. But when I usb debug on a real device I get the MissingPermissionException for recording audio.

I have the line:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

in my manifest file. Is there something else I need to do to give permission to my app?

By the way, I also use internet and internet permission is working fine (App is able to access internet)

<uses-permission android:name="android.permission.INTERNET" />

The device android version is 6.0.1.

uylmz
  • 1,480
  • 2
  • 23
  • 44
  • 2
    I'm not sure whether Android treats RECORD_AUDIO as privacy-sensitive permission, but if you are running your code on Android 6.0+ try to ask for this permission in runtime according to new permission model since 6.0. – Viacheslav Dec 16 '16 at 09:35
  • yes I'm running on android 6.0.1. so there are different policies for different permissions now? – uylmz Dec 16 '16 at 09:37
  • 2
    Yes, they updated permission model, check this out https://developer.android.com/training/permissions/requesting.html. As I can see here https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous RECORD_AUDIO indeed considered as a dangerous permission, so it is definitely need to be requested in runtime. – Viacheslav Dec 16 '16 at 09:39
  • please go through this https://guides.codepath.com/android/Understanding-App-Permissions – Basi Dec 16 '16 at 09:44
  • In Android 6.0 Marshmallow, application will not be granted any permission at installation time. Instead, application has to ask user for a permission one-by-one atenash runtime. Please note that permission request dialog shown above will not launch automatically. Developer has to call for it manually. In the case that developer try to call some function that requires a permission which user has not granted yet, the function will suddenly throw an Exception which will lead to the application crashing. – Rez Dec 16 '16 at 10:42

0 Answers0