sms

Delay for loop cycle in Java

不打扰是莪最后的温柔 提交于 2020-01-06 20:21:39
问题 I am building an SMS messaging app, with a list of phone numbers in an array which I would like to send to. When I press the SEND button in the app, the message that I type would be sent to all the numbers in that array. I am using a for loop to run through the numbers and sending the same message to each of them: for (i=0; i<names.length; i++) { phoneNo = names[i][3]; sendMessage(phoneNo, message); } private void sendMessage(String phoneNo, String message) { try { SmsManager smsManager =

Android send sms pending Intent

自作多情 提交于 2020-01-06 19:24:47
问题 I'm using the following code to send SMS in my android app: PendingIntent pending = PendingIntent.getBroadcast(activity, 0, new Intent(PENDING), 0); activity.registerReceiver(new BroadcastReceiver() { public void onReceive(Context arg0, Intent intent) { switch (getResultCode()) { case Activity.RESULT_OK: { sendJsonData(false); break; } case SmsManager.RESULT_ERROR_GENERIC_FAILURE: { sendJsonData(true); break; } case SmsManager.RESULT_ERROR_NO_SERVICE: { sendJsonData(true); break; } case

Arduino Sim900 with no echo but SMS was sent out

送分小仙女□ 提交于 2020-01-06 17:36:44
问题 I just got a new Sim900 and connected to an Arduino Uno. I used the code below to send a text to myself. I received the text on my cell, but I did not receive any echo on my serial monitor (ie. "OK"). I have tried swapping the RX/TX pins and different baud rates with no success. void setup() { Serial.begin(9600); //Baud rate of the GSM/GPRS Module Serial.println(""); delay(2000); Serial.println("AT+CMGF=1"); delay(1000); Serial.println("AT+CMGS=\"+120########\""); //Number to which you want

How can I save output image from camera directly to file without compression?

泪湿孤枕 提交于 2020-01-06 15:52:38
问题 After compressing the file and then texting it, it recompresses again and is very choppy I use Intent to bring up the camera. I get the result and bring up Intent to send as text. private void takePic() { Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, 2); } public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 2) { Bitmap photo = (Bitmap) data.getExtras().get("data"); File file

How can I use my gps coordinates via sms-body android

六眼飞鱼酱① 提交于 2020-01-06 14:44:19
问题 I have to send my GPS coordinates via SMS, How can I take the latitude and longitude values in SMS body? I tried something but i cant make it with +@id/lat or +String.valueOf(location.getLongitude() in intent.putExtra("sms_body","there would be latitude and longitude values.."); Here is the SmsActivity.java public class SmsActivity extends MainActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

How to use output from a splited sms [closed]

馋奶兔 提交于 2020-01-06 14:26:30
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . How can l capture the output from a split and use it for example as an action or comparing with data in the database String myString = (msg.getText()); String[] a = myString.split("\\*"); for (String b : a)

contentobserver works only for insert and delete but not for an update

亡梦爱人 提交于 2020-01-06 12:54:16
问题 I am developing an app that notify the user when any SMS marked as read even if the app isn't running I simply created a contentobserver and I registered it in a service the problem is that the contentobserver runs if the new SMS inserted or deleted but when the SMS marked as read ( Update operation) it doesn't work here is my service code public class Smssendservice extends Service { private static Timer timer = new Timer(); private Context ctx; public IBinder onBind(Intent arg0) { return

How to read a sms from specific mobile number in android [duplicate]

ぃ、小莉子 提交于 2020-01-06 12:35:19
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Read all SMS from a particular sender I want to know how to read sms and how split mobile number and message body. Please give me a sample code. 回答1: Code for the intent receiver that will read the SMS from intent received and show the message. public class SmsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { //---get the SMS message passed in--- Bundle bundle

How can I send 140 byte in one SMS by sendDataMessage()

我只是一个虾纸丫 提交于 2020-01-06 10:54:22
问题 I have read on different forums that we can send 160 (7 bit) characters and 140 (8 bit) bytes in one SMS message. I want to send 140 bytes of data in one SMS. I am can successfully send up to 133 bytes but not more than 133 bytes, Can any one guide Why I am unable to send 140 bytes of 8 bit data in one SMS through smsManager.sendDataMessage Below is my code. int MAX_SMS_MESSAGE_LENGTH = 140; byte[] bArray = new byte [MAX_SMS_MESSAGE_LENGTH]; for(int i=0;i<MAX_SMS_MESSAGE_LENGTH;i++) { bArray

How to Read OTP from mobile website?

十年热恋 提交于 2020-01-06 08:58:07
问题 My requirement is to listen for SMS messages from a Mobile website. The SMS will contain a OTP (One Time Password). Technologies used in our site are ASP.Net MVC and bootstrap. This is plain mobile site and not a hybrid app. Are there any plugins that can allow me do this? Can it be done with plain javascript? 来源: https://stackoverflow.com/questions/48201215/how-to-read-otp-from-mobile-website