Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,342 members, 7,957,912 topics. Date: Wednesday, 25 September 2024 at 12:42 AM |
Nairaland Forum / Science/Technology / Programming / Software/Programmer Market / ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number (1231 Views)
Professional Android Developer Needed / Are You Mobile Android Developer? Come In / Android Developer Needed (2) (3) (4)
ANDROID DEVELOPER. An SMS App That Sends Sms To A Specific Number by beefsupreme: 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? |
(1) (Reply)
Professional Python & Java Programmer Needed For A Big Contract Job / School Management System / Create Iphone Apps Without Coding - Appsify.me
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |