I
I
int02h2012-11-10 11:51:31
Android
int02h, 2012-11-10 11:51:31

How to add support for tablets in AndroidManifest that can receive / send SMS, but cannot call?

Hello, dear Habra community!
I made an Android application that only works with SMS and I don't need any calls. To do this, I wrote the following lines in the AndroidManifest:

<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_SMS"></uses-permission>

The specified permissions automatically include the following hardware requirement:
<uses-feature android:name="android.hardware.telephony" />

Thus, it turns out that tablets that have a GSM module fall into the category of unsupported devices, although they can receive and send SMS. Is it correct if I forcibly disable android.hardware.telephony? For example like this:
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_SMS"></uses-permission>
<uses-feature android:name="android.hardware.telephony" android:required="false" />

And what will happen on tablets that do not know how to send SMS?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
shadowspok, 2012-11-11
@int02h

my application intercepts received sms and can make calls.
the manifest says:

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

When you start on a tablet that does not know how to do anything, nothing bad happens. when you try to make a call, the system shows a dialog where you can only add the specified number to the phone book, and registering the SMS receiver does not disrupt the program.

D
Dreddik, 2012-11-10
@Dreddik

Thus, it turns out that tablets that have a GSM module fall into the category of unsupported devices.

This conclusion is not entirely correct.
It is described in detail in the documentation
As this very documentation says, uses-feature is a kind of filter for displaying to the user, however, the application can function without this function.
android:required
Boolean value that indicates whether the application requires the feature specified in android:name.
When you declare "android:required="true" for a feature, you are specifying that the application cannot function, or is not designed to function, when the specified feature is not present on the device.
When you declare "android:required= »false" for a feature, it means that the application prefers to use the feature if present on the device, but that it is designed to function without the specified feature, if necessary.

The big question is how good are you at error checking?

G
grishkaa, 2012-11-10
@grishkaa

It seems to me that android.hardware.telephony means exactly the presence of a cellular communication module (not necessarily GSM, maybe CDMA or something even more exotic), and the ability to call can almost certainly be checked by checking the presence of the dialer itself - the com package. android.phone. By the way, I just have a tablet with 3G, which can send sms and at the same time does not know how to call, I can look at it.

L
legioner1916, 2016-01-14
@legioner1916

Hello. I have an asus transformer tf101g. Is it possible to force him to make calls and receive them? Thanks in advance!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question