2

我一直在阅读有关 stackoverflow 的许多问题,但我无法完全解决这个问题。我有一个具有通话功能的应用程序,但我仍然希望平板电脑能够访问它。如果我通过 USB 手动安装该应用程序,该应用程序可以在平板电脑上运行,但它不会出现在市场上。我知道关于这个问题还有其他问题,但我也想知道我是否有其他权限不适用于平板电脑。

这是我的清单..

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="17"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="false"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    <!-- External storage for caching. -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <!-- My Location -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <!-- Maps API needs OpenGL ES 2.0. -->

    <uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>
    <!-- End of copy. -->
    <supports-screens android:smallScreens="true" 
        android:normalScreens="true" 
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true" />

我原本只是有<uses-permission android:name="android.permission.CALL_PHONE"/>

但我最近添加了..

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

这会解决平板无法拨打电话的问题,并在平板市场上架吗?

另外,我列出的还有其他需要添加的权限android:required="false"吗?

另外,这就是我在代码中调用的方式......

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + markPhone));
startActivity(callIntent);
4

1 回答 1

2

ACTION_DIAL使用not将代码更改为调用ACTION_CALL

try {
   Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));
   startActivity( intent );
} catch ( Exception e ) {
   // no dialer activity found...
}

那么您可以完全删除这些:

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

从您的清单中,因为您的应用程序不再需要它们。

于 2013-08-13T15:33:49.987 回答