Reputation: 319
I want to use Multiple APK support in Android to create 2 different APKs.
One APK for devices which supports "PHONE CALL & SMS".
Another APK for devices which doesn't support "PHONE CALL & SMS".
Rest of the features are common in both the APKs.
I've achieved the first APK when I keep required feature & permissions in Manifest.xml
.
<uses-feature android:name="android.hardware.telephony" android:required="true"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
I tried to create another APK for devices which should not have "PHONE CALL & SMS" feature with the following Manifest
changes.
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<!-- <uses-permission android:name="android.permission.SEND_SMS"/> -->
But, I did't succeed. Could anyone please let me know how to achieve this.
Thanks in advance.
Upvotes: 1
Views: 3050
Reputation: 484
There is no need to create multiple APK.
If you use:
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
Your apk will be available for devices that support this feature and for device that does not support it. Just simply in your code check if the instance of the telephony adapter is null or not:
hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
or
getPhoneType()
Upvotes: 4