tags:

views:

188

answers:

1

Hi,

What class can we use to send a text message? I tried this on the emulator, 2.0:

import android.telephony.SmsManager;
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(...);

and that works ok. On my G1 running 1.5, I get a verify error, guessing because SmsManager is not available in 1.5. Maybe for 1.5 we need to use the deprecated class?:

android.telephony.gsm.SmsManager

is that correct, or is there some other class we're supposed to use for sending text messages?

Thanks

+2  A: 

Correct. android.telephony.SmsManager is only available for API level 4 and up (a.k.a Android 1.6). See the docs. You can use Android.os.Build.Version to figure out which to use on a given platform.

Yoni Samlan