private TelephonyManager tm; tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); String sim = tm.getSimSerialNumber();
需要TelephonyManager 加权限
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(phone, null, "msg !", null, null);发短信权限
创建raw 目录拷贝需要用的音乐文件
写播放音乐的代码:
MediaPlayer mediaPlayer =MediaPlayer.create(context, R.raw.ylzs); mediaPlayer.setVolume(1.0f, 1.0f);//声道 mediaPlayer.setLooping(false);//是否循环播放 mediaPlayer.start(); abortBroadcast();//4.3一下版本屏蔽短信收发
原文地址:http://blog.csdn.net/zeb_perfect/article/details/44786677