android


Android-Sending sms from android application


This is my code.I have added permission in manifest file but then my app is unfortunately stopped.Why is it so?
If i had try catch,catch part is getting executed.
import android.app.Activity;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class SendSMSActivity extends Activity {
/** Called when the activity is first created. */
EditText eTextMsg, eTextMblNumber;
Button btnSendSMS;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
eTextMblNumber = (EditText) findViewById(R.id.etextMblNumber);
eTextMsg = (EditText) findViewById(R.id.etextMsg);
btnSendSMS = (Button) findViewById(R.id.btnSendSMS);
btnSendSMS.setOnClickListener(new OnClickListener()
{
public void onClick(View v) {
// TODO Auto-generated method stub
sendSMS();
}
});
}
public void sendSMS()
{
SmsManager sm = SmsManager.getDefault();
String number = eTextMblNumber.getText().toString();
String msg = eTextMsg.getText().toString();
sm.sendTextMessage(number, null, msg, null, null);
}

Related Links

How to use new layout editor for Android project in Eclipse
How to display Textview for a array item
Android radial gradient background changes when keyboard is on-screen
Internet not working in android emulator on ubuntu 11.04
Google Maps marker shown in the wrong place
how do i view methods/step through code during orientation change in android
Efficient way to request touch focus from WindowManager?
Appcelerator titanium - MapView on android causes app crash
How can I recreate a dialog, including its whole content?
Opengl scrolling world guidance
Use this.setVolumeControlStream(AudioManager.STREAM_MUSIC); to control android phone rocker when activity is out of focus (with service)?
How to avoid getting both called: onItemClicked and onTextChanged on AutoCompleteTextView
How to check internet accessibility in hotspot (Android)
Allowing rectangle to be clickable - android
Phonegap Plugin Error during initialization
Android XML Rich Text Processing

Categories

HOME
cygwin
adal
wakanda
amp-html
alexa-skills-kit
datastore
angular2-material
youtube-data-api-v3
camera
echo
special-characters
joomla3.0
sendgrid-api-v3
spin
plist
angular-dart
tput
azure-powershell
null-pointer
pyramid
cgbitmapcontext
pagespeed
named-entity-recognition
google-api-client
opentk
pylons
asymptotic-complexity
soot
record
hibernate-validator
git-squash
linkedhashmap
sharding
least-squares
jpad
release
protein-database
railstutorial.org
dcmtk
logback-groovy
mesosphere
dynamic-linq
httrack
serde
netbeans6.8
zenhub
static-cast
er-diagram
check-mk
type-theory
vcloud-director-rest-api
gets
rocks
meteor-packages
redistributable
centrifuge
adafruit
dup
lean
google-query-language
nss
data-protection
beanstalk
mobiledoc-kit
character-replacement
ess
text-search
canalyzer
amiga
dronekit-android
linked-tables
snoop
typeconverter
android-vibration
crowd
teaspoon
formview
device-tree
matrix-inverse
synapse
scrypt
cffile
flex++
screen-size
xcelsius
exponentiation
appledoc
objective-j
blender-2.49
feasibility
asynchronous-wcf-call
dsoframer
ifilter
information-management

Resources

Encrypt Message