PhoneFinder--寻找丢失的手机
开发这样的应用程序,我们首先需要了解一下几方面的内容:
1.State and Notifications Broker API
2.Pocket Outlook Object Model Application Development for Windows Mobile-based Devices
在应用程序的主界面上,我们可以让用户输入信息内容,并且设置应用是否允许。这样,在设备接收到含有预先设定的短信之后,就会做出相应的动作,如弹出提示框,播放声音等等。其中,开启短信拦截的关键代码段如下:
interceptor =newMessageInterceptor(InterceptionAction.NotifyAndDelete);
interceptor.MessageCondition =newMessageCondition();
interceptor.MessageCondition.CaseSensitive =true;
interceptor.MessageCondition.ComparisonType =MessagePropertyComparisonType.Equal;
interceptor.MessageCondition.ComparisonValue = pin.Text;
interceptor.MessageCondition.Property =MessageProperty.Body;
interceptor.EnableApplicationLauncher(ruleName);
播放声音使用PlaySound方法,通过PInvoke得到:
#regionPlaySound
[System.Runtime.InteropServices.DllImport("coredll.dll")]
staticexternintPlaySound(stringpszSound,IntPtrhMod,intfdwSound);
constintSND_FILENAME = 0x20000;
constintSND_SYNC = 0x0;
constintSND_ASYNC = 0x1;
constintSND_LOOP = 0x8;
#endregion
主人信息通过SystemState获得:
stringowner =SystemState.OwnerName;
stringemail =SystemState.OwnerEmail;
stringphone =SystemState.OwnerPhoneNumber;
测试这个应用程序我们可以使用Device Emulator和Cellular Emulator。首先,打开设备模拟器和蜂窝模拟器,并将它们建立联系,具体步骤参考《Ring Tone Manager on Windows Mobile》。然后将程序部署到设备进行调试。调试时,应用程序的主界面如下图1所示:

图1:应用程序主界面
在Pin的text中设置好相应的文字以后,点击“Enabled”,启动短信拦截,然后点击左下方的Exit退出界面。这时候,我们在蜂窝模拟器里面给设备模拟器发送字符串“1234”,如下图2所示:

图2:蜂窝模拟器中的SMS发送界面
这时候,我们就可以在设备模拟器中看到相应的消息框,并听到声音了。如下图3所示:

图3:设备模拟器中看到的提示消息框
参考链接:
Google:PhoneFinder
MSDN:
1.State and Notifications Broker API
2.Pocket Outlook Object Model Application Development for Windows Mobile-based Devices
I am from Congo and , too, and now am writing in English, give please true I wrote the following sentence: "Lamisil jock itch generic terbinafine product."
Thanks :-). Watson.
I am from Micronesia and , too, and now am writing in English, tell me right I wrote the following sentence: "Each flea that is on any one of your pets."
With best wishes 8-), Ritter.
WEB: pedalstopeople.org/members/hydrocodonehere.aspx :smile:
,
:roll:
.
leimq
vxbiquo
|
[smiley=wink]
:twisted:
ymg
tgzslva
bfuwyrd
jgehsui
art
yikzsuj
zmlngr
xjahyg
tconrk
~
sftvxzl
ohs
xdatpr
*SCRATCH*
...
:arrow:
zqw
.
(!)
*CRAZY*
[smiley=evil]
urdihwv
.
oglekqw
xuw
jfet
...
*TIRED*
flp
havkwl
[smiley=happy]
:angry:
ftvbmc
:tongue:
kuca
;;
,-
--
atxswqy
yhtrq
:cry:
[smiley=evil]
...