Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

android - Exclude Tablets from APK publishing

I need to limit the installation availability of my android app to only Phones (or devices that have SMS capability or SIM Card)

I know I can limit the devices by screen size. But that won't work for me, because as you know we now have phones that have bigger and better resolution screens than some tablets.

The functionality of my app revolves around sending SMS (Text) messages. If the device does not have a SIM Card, I don't want my app to get installed on that device because user reviews be like "the app does not work on my tablet".

I'm also aware that it's probably not possible to filter out devices that do not have an "Active" SIM card. That I might get a person with a phone that is on WiFI and not SIM card. That's okay. If I can target phones and exclude tablets, i'm happy.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If I can target phones and exclude tablets, i'm happy.

Whether or not a device supports telephony has little to do with whether it is a "phone" or a "tablet".

If you need telephony, add <uses-feature android:name="android.hardware.telephony" /> to your manifest. This is implied by holding the SEND_SMS permission, so if you have SEND_SMS, you will already be restricted to devices with telephony capability.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...