ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number - Tech Jobs - Nairaland
Nairaland Forum › Science/Technology › Programming › Tech Jobs › ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number (1310 Views)
| ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by beefsupreme(op): 5:24am On Feb 01, 2015 |
Hi, please i need help with my creating an android app with a text field where users can enter phone number and a test and click send and the message is sent. |
| Re: ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by Urine: 7:50pm On Feb 01, 2015 |
beefsupreme:Lol. I can create an app like that with a contact picker under 20 minutes. Google is your friend though. |
| Re: ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by MrFlexible(m): 10:46pm On Feb 01, 2015 |
Urine:really, how??...please share. |
| Re: ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by Appguru(m): 12:57pm On Feb 02, 2015 |
@beefsupreme @mrflexible I hope you have basic knowledge of android development. 1.) Add the permission to your manifest <uses-permission android:name="android.permission.SEND_SMS" /> 2.) Use this method to send sms public void sendSMS (String tel, String message){ if (tel.trim().equalsIgnoreCase("" ){Toast.makeText(this, "Invalid telephone number!", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(this, "Sending ...", Toast.LENGTH_SHORT).show(); try { SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(tel.trim, null, message, null, null); Toast.makeText(this,"SMS Sent!", Toast.LENGTH_SHORT).show(); } catch (Exception e) { Toast.makeText(this,"SMS not sent, please try again later!", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } } //where tel=recipient number, message=message body 3.) You then register a click listener for a button on your UI, and send the sms on clicking. - In you onCreate() method. TextView tel_textbox = (TextView) findViewById(R.id.tel); TextView msg_textbox = (TextView) findViewById(R.id.tel); Button sendSms= (Button)findViewById(R.id.send_sms); sendSms.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { String tel = tel_textbox.getText().toString(); String message = msg_textbox.getText().toString(); sendSMS (tel, message); }}); |
| Re: ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by kunletoks(m): 8:54pm On Apr 29, 2015 |
Do you want it to send the sms using a bulk sms portal? |
Professional Android Developer Needed • Are You Mobile Android Developer? Come In • Android Developer Needed • 2 • 3 • 4
Hotel Software • C# & Visual Studio 2013 • Programmer Wanted For Mobile Solution
){