android.permission.CALL_PHONE for tablets

后端 未结 5 1120
故里飘歌
故里飘歌 2020-12-05 02:26

I am developing an app and in the manifest I have:




        
相关标签:
5条回答
  • 2020-12-05 02:46

    From google docs:

    Declared elements are informational only, meaning that the Android system itself does not check for matching feature support on the device before installing an application

    usage is only for google play

    0 讨论(0)
  • 2020-12-05 02:53

    In the AndroidManifest you need:

    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    

    The CALL_PHONE permission implies telephony is required, but if you specify that is not you won't be filtered.

    0 讨论(0)
  • 2020-12-05 02:53

    Instead of adding a user with the ACTION_CALL identifier, change it to ACTION_INSERT_OR_EDIT.

    You'll need these permissions too, instead of the CALL_PHONE permission:

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

    Take a look at this related question:

    can't find app on market

    0 讨论(0)
  • 2020-12-05 02:58

    Try to use Intent.ACTION_DIAL instead Intent.ACTION_CALL.

    For example:

    try {
       Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone_number));
       startActivity(intent);
    } catch (Exception e) {
        //TODO smth       
    }
    

    And in this case you can completely remove these tags from AndroidManifest.xml:

    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    
    0 讨论(0)
  • 2020-12-05 02:59

    Regarding "uses-feature" and it crashing - are you checking that telephony is available before actually making the call? It might be you need to do that extra step for the case when the app is on tablets. All you are saying in the manifest is that the feature is not required. It probably relies on you to actually implement the logic around that.

    0 讨论(0)
提交回复
热议问题