background services

http://www.pocketpcdn.com/articles/services.html
is this still up to date
somebody who has experiences withit


Answer this question

background services

  • Baan Ravi

    I'm wondering if it's usefull to work with time based model for registering a task.
    eg. At 08.00 pm and 15.00 pm : send message to server

    what if the device is off, which is very likely (when working on battery, thus most of the time, it turns off after 3-5 minutes of being inactive)

    for example the device was off 08.00.

    The user turns the device on at 10.00. Will the pda execute his task ->send message to server
    or will it be discarded

    ...
    Do you understand what I mean

  • fieda

    StudentDev,

    If your requirement is just doing something at predefined time, services.exe is both an overkill and won't work the way you want, as you observed, the device sleeps.

    The API you should use is CeSetUserNotificationEx, and you need to understand the device's power management. Read my series of articles here. Altogether 9 articles, good read if you are curious why the device sleeps and how to force or request it to wake up...

    ---
    Lao K
    Visit my Blog for
    Windows Mobile Pocket PC Smartphone Programming Hints and Tips



  • MBowen

    Even better, does somebody understand it :) and knows how to use it. The sample files can you find below.

    I want an alltime backgroundservice that for example always on 3 o' clock do function.

  • MichaelMcD

    how to use c++ with managed c#

  • Mr. SOAPitStop

    OK, I'll do ;)

  • Eric Cosky

    It depends on the state of the device.. if it is just 'sleeping', then it should wake up and send your message at 08:00. (it won't wait for you to fully activate it)

    If it is actually turned off (i.e. no power at all) then the Broker will not have received the notification at 08:00, and nothing will get sent.



  • BillAtP.A.S.

    I just see it turns out after max 5 minutes.

  • hghrp

    (1) All the codes are there. You need a little bit of C++ experiences to compile and use the code.

    (2) ClearRunApp is to clear the scheduled task. If you want to run something at 10AM, you should call ClearRunApp after 10AM. Where to put the code is completely up to your own business logic. For example, if you only need to run the program once at 10AM, then call ClearRunApp before the program exits. If your program runs 1 minutes, then ClearRunApp is executed at 10:01AM. Is that clear

    (3) When the device sleeps, your code won't execute, so how do you test whether the device is "active" or not Are you talking about the screen

    ---
    Lao K
    Visit my Blog for
    Windows Mobile Pocket PC Smartphone Programming Hints and Tips



  • Brian Layden

    I've looked at this, and currently there is no way to do this with Compact Framework, so I would recommend the C++ forum instead:

    http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=35&SiteID=1

    The short answer is: services.exe is very tricky! You have to implement a native dll and sign it properly

    If you are targeting Windows Mobuile 5.0, then maybe you should use the State and Notification Broker

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


    You could then programatically enter a schedule into the PIM, and use this API to launch your task.

  • Robert Beaubien

    I'll take a look at the state and notfication broker.

    thanks


  • Thomas Olsson

    about 1)
    what are the steps to do, to use the function from c#

    or ...

    make new c++ project, and then

  • vikas mishra

    Lao K wrote:
    StudentDev,

    If your requirement is just doing something at predefined time, services.exe is both an overkill and won't work the way you want, as you observed, the device sleeps.

    The API you should use is CeSetUserNotificationEx, and you need to understand the device's power management. Read my series of articles here. Altogether 9 articles, good read if you are curious why the device sleeps and how to force or request it to wake up...

    ---
    Lao K
    Visit my Blog for
    Windows Mobile Pocket PC Smartphone Programming Hints and Tips



    hello I read your, articles.
    About series 6 :
    http://windowsmobilepro.blogspot.com/2005/12/pocket-pc-power-management-series-6.html

    is there a link to the code of 6, or is all the code on the page

    1)How to use this code I'm not confidential with unmanaged code (how to compile , adding it as unmanaged file to my project where I want to use it , making a dll of it ->with csc )

    2) and doiing this:

    And remember to clear it after some time:

    eg. ClearRunApp(TEXT("\\Windows\\iexplore.exe"));

    when putting it after: ScheduleRunApp(TEXT("\\Windows\\iexplore.exe"), TEXT("URLXXX""), 600);

    is ok


    3) add the line: if ppc active : do not run ->try 5 minutes later
    else executeAPP

    How

    THx;)



  • background services