sms

android - Request correct permissions to save an SMS on Inbox

橙三吉。 提交于 2019-12-13 01:43:54
问题 I want my Android program to be able to save an SMS on the user's inbox. I already found this question which does exactly that, but this statement: getContentResolver().insert(Uri.parse("content://sms/sent"), values); throws a SecurityException . I already requested the SMS_WRITE permission in the manifest file. Any ideas? 回答1: Took me some time too, seems like you also need the READ_SMS permission (found it there: http://www.andreabaccega.com/blog/2010/08/12/write-an-sms-without-sending-it

Receive an read SMS with correct encoding and convert to UTF8

喜夏-厌秋 提交于 2019-12-13 01:43:37
问题 I am writing a BroadcastReceiver to receive SMS messages. I will need to compare the message with a string that was set by the user in the settings, but the string can be non-ASCII. The below code works only for SMS-es that contain only ASCII characters. How can I convert the message to UTF8 encoding? public class SmsReceiver extends BroadcastReceiver { final static String TAG = "SmsReceiver"; public SmsReceiver() { } @Override public void onReceive(final Context context, final Intent intent)

Sending Special characters as a message;

北战南征 提交于 2019-12-12 21:23:03
问题 I'm running Kannel which i use as an SMS gateway. But I've just realized some special symbols are not received on phone as they should; @, ^ and $ are sent as some triangle; How can i resolve this? 回答1: Probably a charset problem. SMSes are usually received with GSM7 charset, and the characters you gave have different GSM7 numeric codes that, for example, ISO-8859-1. You should convert from GSM7 to your own character encoding. The char @ may be problematic for another reason. In GSM7 it is s

ANDROID How to pass data (like Latitude and Longitude from GPS) to a SMS process, and send it

安稳与你 提交于 2019-12-12 19:57:16
问题 I have a class in getting latitude and longitude, and another one in receiving an SMS and sending it back to the one who requested it. It is an autoreply, For example, user A requests a location of user B via SMS without knowing that user A has this kind of request. Then automatically, it will get the current latitude and longitude of user B and send it back to user A. How to implement this? I'm very new to android development. Here's the snippet of my code. Thank you String rtMessage =

How to send sms using contacts in phonebook instead of writing the phone number?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 18:28:37
问题 I'm sending sms to a person by writing his phone number but now I want to add functionality of getting number automatically from phone book contacts by selecting sender's contact.Can anyone give me some idea how to add that functionality in my application ? Thanks in avance. 回答1: This can be done as follows: Load contacts from your phonebook (on a button click or on clicking on the EditText you use to collect phone number) // Pick contacts when clicked @Override public void onActivityResult

Twilio Ruby sending SMS - undefined method `messages'

拥有回忆 提交于 2019-12-12 18:11:21
问题 I am trying to send an SMS message from my Rails app via the Twilio API. I'm following the instructions here (https://github.com/twilio/twilio-ruby) but I can't seem to figure this one out. Here is the code in my rails controller require 'twilio-ruby' account_sid = '[I inserted account_sid here]' auth_token = '[I inserted auth_token here]' @client = Twilio::REST::Client.new(account_sid, auth_token) @client.account.messages.create( from: '+[number here]', to: '+[number here]', body: 'Hey there

How to send SMS with GSM module SIM800 and Arduino Uno?

a 夏天 提交于 2019-12-12 17:10:06
问题 I am trying to send a text message from Arduino through a SIM800 GSM module. The message gets to the given number but not in the correct format. It shows "Message format not supported". I am including my code here and a fast reply is much appreciated. #include <SoftwareSerial.h> SoftwareSerial GPRS(11, 12); //11 = TX, 12 = RX unsigned char buffer[64]; //port int count=0; int i = 0; //if i = 0, send SMS. void setup() { GPRS.begin(9600); // the GPRS baud rate Serial.begin(9600); // the Serial

Sending and receiving SMS

£可爱£侵袭症+ 提交于 2019-12-12 17:01:08
问题 I'm looking for information how to receive and send SMS using own application. I don't know what devices I should use, what programming language has an appropiate API and so on. 回答1: You might want to look into Twilio. They have services for sending and receiving SMS messages. 回答2: Check out SMSLib at http://smslib.org/ SMSLib is a programmer's library for sending and receiving SMS messages via a GSM modem or mobile phone. SMSLib also supports a few bulk SMS operators. SMSLib is distributed

Unable to delete SMS programmatically

蓝咒 提交于 2019-12-12 15:53:52
问题 I have tried variations on deleting all or some messages from the SMS, including but not limited to thread id, id, where clause, etc. Android manifest reflects read and write permissions. I tried with variations on the SMS content, from inbox etc. Nothing seems to delete the record. Here is the last iteration: Cursor c = getApplicationContext().getContentResolver().query(Uri.parse("content://sms/"), null, null, null,null); try { while (c.moveToNext()) { int Id = c.getInt(0); String pid = c

Can't remove SMS logs from call log on Samsung devices

谁都会走 提交于 2019-12-12 15:41:26
问题 I'm trying to remove all SMS messages from the device via my app, but for some reason SMS logs still appear on the call log on some of the Samsung devices. I've tried a more "radical" approach, and deleted the following URI's using the ContentResolver : content://call_log/calls content://sms content://sms/inbox content://sms/sent content://mms/inbox content://mms content://mms-sms content://mms/address content://mms/part content://mms/sent content://mms/outbox Delete was done with the