Created
September 12, 2014 08:37
-
-
Save goodzsq/1319a3744a2e62004d30 to your computer and use it in GitHub Desktop.
android 发送短信
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//发送短信 | |
public void sendSMS(String tel, String msg){ | |
PendingIntent paIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0); | |
SmsManager sms = SmsManager.getDefault(); | |
sms.sendTextMessage(tel, null, msg, paIntent, null); | |
} | |
//UUID | |
public String getMyUUID(){ | |
TelephonyManager tm = (TelephonyManager)getBaseContext().getSystemService("phone"); | |
String tmDevice = tm.getDeviceId(); | |
String tmSerial = tm.getSimSerialNumber(); | |
String androidId = Settings.Secure.getString(getContentResolver(), "android_id"); | |
UUID deviceUuid = new UUID(androidId.hashCode(), tmDevice.hashCode() << 32 | tmSerial.hashCode()); | |
String uniqueId = deviceUuid.toString(); | |
return uniqueId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment