-
android 短信拦截 实例完整源码下载
可实现拦截短信,自动转发的功能。 部分代码:import android.app.AlarmManager;import android.app.PendingIntent;import android.app.Service;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.IBinder;import android.os.PowerManager;import android.os.PowerManager.WakeLock;public class MyService extends Service{ SMSReceiver rs=null; static MyService service; private static PendingIntent pi = null; public static AlarmManager am = null; @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { // TODO Auto-generated method stub super.onCreate(); service=this; pm = (PowerManager) getSystemService(Context.POWER_SERVICE); registerAlarm(); acquireWakeLock(this); registerRecever(); } @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); releaseWakeLock(); unregisterAlarm(); } private void registerRecever(){ rs=new SMSReceiver(); IntentFilter filter=new IntentFilter(); filter.addAction("android.provider.Telephony.SMS_RECEIVED"); filter.setPriority(1000); registerReceiver(rs, filter); } @Override public int onStartCommand(Intent intent, int flags, int startId) { // TODO Auto-generated method stub if(rs==null)registerRecever(); return START_STICKY; } public static WakeLock wakeLock = null; private static PowerManager pm = null; public static synchronized void acquireWakeLock(Context c) { if (null == wakeLock) { wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "smslock"); wakeLock.acquire(); } } public static synchronized void releaseWakeLock() { if (wakeLock == null) return; if (wakeLock.isHeld()) { wakeLock.release(); wakeLock = null; } } /** * 启动重复型定时器 */ public static void registerAlarm() { if(Config.getAlarm())return; Intent intent = new Intent(service, AlarmReceiver.class); pi = PendingIntent.getBroadcast(service, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); // 设置一个PendingIntent对象,发送广播 am = (AlarmManager) service.getSystemService(Context.ALARM_SERVICE); // 获取AlarmManager对象, Config.setAlarm(true); am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 30*60*1000, pi); } /** * 取消定时器 */ public static void unregisterAlarm() { am.cancel(pi); am = null; Config.setAlarm(false); }}
- 2014-05-21下载
- 积分:1
-
Android-Training-PPT
一个安卓开发的培训课件,详细介绍了安卓系统的开发步骤和流程。(an android training PPT)
- 2012-12-30 14:48:56下载
- 积分:1
-
C8051F30X-software-SPI-example
说明: 此应用笔记收集了用软件实现的主模式SPI程序。提供了8 个不同的SPI 主模式传输例。示例中包含SPI时钟相位和极性两个子例程:一个是用C 语言编写的例程,一个是为了提高速度用汇编语言编写的可被C 语言调用的例程。一个例子是在“C”程序中如何调用汇编同时提供了EEPROM接口例子。SPI是摩托罗拉商标。
此文档中描述的SPI功能使SPI处理的软件
最小化。在系统中使用C8051F30X 器件作为
总线上的SPI 主器件。(This application note collection implemented in software SPI master mode procedures. Provides 8 different SPI master mode transfer cases. Examples include SPI clock phase and polarity of the two sub-routines: one is written in C language routines, one is to increase the speed of assembly language written in C language can be called routine. One example is in the " C" programs how to call assembly also provides examples of EEPROM Interface. SPI is a Motorola trademark. SPI described in this document processing software capabilities to minimize the SPI. In the system C8051F30X SPI device as the primary device on the bus.)
- 2011-02-23 11:14:23下载
- 积分:1
-
AuthenticatorDescription
A Parcelable value type that contains information about an account authenticator for Andriod.
- 2013-10-21 16:23:50下载
- 积分:1
-
-Mp3Player03
播放音乐功能,实现界面切换 按钮隐藏和显示(Play music interface toggle button to hide and show)
- 2013-01-24 10:58:05下载
- 积分:1
-
fetnelregarde
通信仿真 jakes改进模型的程序,仿真基本理论()
- 2018-07-09 05:02:37下载
- 积分:1
-
uvision2_rumen
说明: uvision 2 单片机C语言开发系统使用说明。(uvision 2 single-chip C language development system for use.)
- 2009-07-29 13:43:41下载
- 积分:1
-
安卓模仿微信代码(主要是UI实现,android studio)
安卓模仿微信代码(主要是UI实现,android studio)
- 2018-04-06下载
- 积分:1
-
android 通过wifi传输文件的例子源码,参考茄子快传的原理
android 通过wifi传输文件的例子源码,参考茄子快传的原理
- 2014-08-29下载
- 积分:1
-
APF-hardware-and-software
采用空间矢量法作为滞环电流控制的APF软硬件设计(Using space vector method as hysteresis current control of APF hardware and software design)
- 2011-11-08 20:02:35下载
- 积分:1