Posted By: thomanil | Sep 6th, 2007 @ 6:35 AM
page 1 of 1
Comments: 4 | Views: 1650
Hello, I have a question for you more seasoned win mobile developers Smiley

I'm writing a small windows mobile app for my smartphone. What I basically want to do is set up a process/daemon which listens for incoming phonecalls and does <foo> whenever incoming calls are detected.

The first step is creating a process which stays in memory permanently and comes back up by itself after reboot. If possible I want to stay in .NET/managed code (C#) when implementing this process.

Anyone got any tips?

Regards,
Thomas Kjeldahl Nilsson, Oslo

If your device is Windows Mobile 5+, just take a look at the State And Notification Broker API. Add a reference to the Microsoft.WindowsMobile.Status assembly and then look for the PhoneIncomingCall member of the SystemProperty enum.

You have samples here

http://www.developer.com/ws/pc/article.php/3547381

Cheers,

Alejandro Mezcua
A nice solution would be to write a service.
This way your application will stay in the services.exe and won't occupy one of the 'process-slots'.
Off-course you'll have less possibilities with a service. At the moment I don't have an article ready under my [paste]-button, but I'm sure there's something to be found on the msdn website. That's where I got some information from it.
The "problem" with writing a service, or a driver, is that the code can not be managed code but a native dll. You might find also issues there with the code having to be signed under a trusted certificate, but perfecly valid nonetheless...
page 1 of 1
Comments: 4 | Views: 1650