Title: How can I disable (and then enable) text messaging feature from Android SDK
Tags: java;android
Question: I am working with Android SDK for less than a week now. I was able to build sample apps and run them on Nexus 5. One of my requirements is to 1) disable the SMS text messaging feature based on certain criteria and 2) then enable the SMS text messaging feature after certain duration.

I understand that Android SDK has API to send text messaging from the app. Is there also any API to disable (and then enable) the SMS text messaging programmatically

Comment: Do you want to block outgoing and incoming messages programmatically?

Comment: Yes, I want to block them programmatically

Here is the accepted answer: If the app has root level access, or is using a framework such as Exposed, then yes app can access low level API's to affect SMS.

Otherwise, there is no known official API for that yet. Though Android has introduced device admin API, There seems to be no SMS specific policy present.

Comment for this answer: Alternatively, is it possible to lock the keyboard (that should disable the SMS, besides everything on the phone). Thanks, I am going to look at the links


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:09/28/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><android>', 'Title': 'How can I disable (and then enable) text messaging feature from Android SDK', 'ViewCount': 751, 'id': 26081632, 'user_AboutMe': None, 'user_AccountId': 1890950.0, 'user_DisplayName': 'kashili kashili', 'user_Reputation': 935.0, 'user_Views': 94.0, 'user_id': 1709046.0}}