[REQ] Help for app development: SetPowerRequirement and invoke Appointment - Windows Mobile Software Development

Hello,
I am very new with CF development.
I try to create my first app in C#.
At the moment I am struggling with two problems:
1.
I wrote an appliactian what is running like a "Service". I used the managedservices class of CodePlex. (Sorry, I am not allowed to post links here)
The app is running fine until my device turned off the screen (timeout as configured in the settings). The applications stopps until I press the power button to awaik it.
I already red a lot of SetPowerRequirement and PowerPolicyNotify but I was unable to implement it. Could somebody provide me a code snippet for that?!
2.
At a specific event I want to invoke an appointment. Means, I want to play the device configured appointment sound, display the appointment form and let the LED flashing.
Is there a class or an API that I can use?
Or do I have to invoke all these things manually? If so, how can I invoke the sound and the LED flashing?
Would be very cool if somebody could give me some support!
Thank you in advance.
Matthias

Agamemnon81 said:
Hello,
I am very new with CF development.
I try to create my first app in C#.
At the moment I am struggling with two problems:
1.
I wrote an appliactian what is running like a "Service". I used the managedservices class of CodePlex. (Sorry, I am not allowed to post links here)
The app is running fine until my device turned off the screen (timeout as configured in the settings). The applications stopps until I press the power button to awaik it.
I already red a lot of SetPowerRequirement and PowerPolicyNotify but I was unable to implement it. Could somebody provide me a code snippet for that?!
2.
At a specific event I want to invoke an appointment. Means, I want to play the device configured appointment sound, display the appointment form and let the LED flashing.
Is there a class or an API that I can use?
Or do I have to invoke all these things manually? If so, how can I invoke the sound and the LED flashing?
Would be very cool if somebody could give me some support!
Thank you in advance.
Matthias
Click to expand...
Click to collapse
exactly what event will be used to trigger the creation of an appointment? you might be able to use the notification queue of Windows Mobile. which means the OS will trigger the event even if ithe OS is suspended.

mb286 said:
exactly what event will be used to trigger the creation of an appointment? you might be able to use the notification queue of Windows Mobile. which means the OS will trigger the event even if ithe OS is suspended.
Click to expand...
Click to collapse
Thank you very much.
That was the first very important hint for me. I always searched for "appointment" but did not find the notification class.
I got it running. Only problem is the LED is not flashing. Maybe this is a special thing?!
Is there a HTML code available which lets the notification just look like that one of a calendar appointment? I am not very firm with HTML.
BR
Matthias

Related

can i be of any help?

i reckon a majority of programs/applications here are developed with technologies like c++/java. however, as a 6+ years developers in .NET, i'm wondering if anyone might want to find ppl talking about .NET stuff and developing some stuff with .NET framework?
dunno if this is the right place to say this. sorry if it's bothering.
I could do with a bit of a hand with my first ever vb.NET app if you have a spare minute....
I managed to 'lay my hands on' a copy of VS2008 and have installed the SDK's from M$ and have been messing about with it for about 2 months now with some success.
I've managed to program a simple alarm clock app which uses a SDF database for the alarm functions which works well (but still needs more work before I release it).
The main problem I have right now is that I cannot get the phone to wakeup from a standby state when the alarm is supposed to sound (as all programs are suspended when the device goes into standby).
I found this article on MSDN about the 'CeRunAppAtTime' function and have placed it in my code with a calculation for the milliseconds needed (until wakeup occurs) The milliseconds-until-wakeup are calculated using the hours and minutes between the current time and the set alarm time, converted to Integers using the built in time functions of VB.
The problem is that this does not seem to wake the device from standby when it's supposed to.
I've scoured the web for any info on this but have been stuck at this stage for about 3 weeks now, messing with the code so much I've lost track of what I've tried.
Is there any alternative to this function call or am I stuck trying to work it out?
I would post that section of my code but it's on my other PC which I can't get to right now....sorry.
I think you'll find the answers you're looking for here:
http://www.koushikdutta.com/2008/07/cerunappattime-cesetusernotificationex.html
A while back I found a c# compiler that worked ON THE DEVICE -- it was totally cool to compile and mess around with c# on the phone.
That compiler only supported the compact framework 1.0, and the developer seemingly disappeared off the face of the earth without releasing his source.
It would be cool if someone knowledgeable soul could make a version that supports CF 3.5.
Understand that there was no IDE here, you simply loaded your c# source into it, told it to compile, and you got an EXE.
godefroi said:
I think you'll find the answers you're looking for here:
http://www.koushikdutta.com/2008/07/cerunappattime-cesetusernotificationex.html
Click to expand...
Click to collapse
Thanks for the link but I'm not quite sure that this gives me what I'm after.
I don't want to have to schedule a system notification to wake the device as other devs on other sites have reported issues with the dialogue and not being able to assign a sound to it other than the default one for notifications.
CeRunAppAtTime would do the job but I just can't get it to work.
Anyone got any working VB code using this API?
...problem finally solved and the Alarm clock is available for download here:
http://forum.xda-developers.com/showthread.php?p=5551369#post5551369

Im a developer, I know some basics. Give me ideas.

As the title says, Im a developer but I dont know anything majorly complicated.
I want YOUR ideas for something to make.
Stuff I know:
Things to do with the file system - copy, paste, delete, create etc
Read/write/create text files
Simple or even more complex UIs (nothing too extreme though)
most of the basic stuff
Heres a video of stuff Ive done before:
http://www.youtube.com/watch?v=g3_5xBqf-eQ
If you have any idea for simple apps, please let me know and Ill tell you if I can make them or not
Thanks
Maybe a new app to replace and improve SmileySMS ( development is stopped, and on windows mobile we can't have smileys in sms without this buggy app).
I wish a prog for my HD2, very simple : Use Webradio (with url) as ringtone !
Hi Cris,
I am looking for an app that can do the following:
Disable the touchscreen.
Why?
It's annoying when you watch movies and accidentaly touch the screen (especially with core player).
The app would have to disable the touchscreen after a set time, so you have enough to start the movie (or other application).
A certain area of the screen would have to be defined as touchable, so that you can disable again. Maybe with a gesture? ie. swipe from bottom left hand corner to top right???
just an idea
idea
it would be amazingg if you could make an application that allows the drag down notifications panel like android has
antdawg702 said:
it would be amazingg if you could make an application that allows the drag down notifications panel like android has
Click to expand...
Click to collapse
you know what, im gonna look into this one.
I cant promise anything.
I cant say I have any idea how to do that.
but I can say that im gonna look into it ^_^
wm7
can you make a windosmobile7series for nontouchscreen windowsmobile.need help with it.its just navigaating threw it with the arrow keys
Hi Cris,
Can I suggest a application that can do 2 things which I can't find something similar to this (suggestion).
To create a application for both "Shopping List" + "Inventory".
Let me know if you interested, I can share the idea ..
Hope you can consider it .. thanks
antdawg702 said:
it would be amazingg if you could make an application that allows the drag down notifications panel like android has
Click to expand...
Click to collapse
do you have a screenshot?
how about an application like e-mail and walk for the iphone..........so that wed be able to type and walk at the same time with the background being whats in front of us fed by our camera....
I would like a app that does the following:
All for the Sense music tab!
When NOT in a call:
Long press : Play / pause
Pressed twice : Next song
(If possible:
Pressed three times: previous song
pressed shot : call)
When you are being called:
short press: pickup / hangup
PLUS
The hardware buttons (buttons on the PHONE) MUST be disabled,
But ONLY when the headset is plugged in!
With no headset plugged in everything should be as normal!
Could some developer please make this?
Maybe you can use code from the following:
http://forum.xda-developers.com/showthread.php?t=502881
http://forum.xda-developers.com/showthread.php?t=556801
Great Greet Giblet
I've actually been pitching this one around but no luck yet ... A small GPS toggle cmd app. Here's an OSS project that may have usefull code.
What I would like it to have is:
1- Commands to toggle GPS on or off
2- Stay running and output number of connected satellites and connection status (position fixed/not fixed) as a reg name/value
3- Maybe other stuff (like coordinates, hour/date, update system time... but what I really want is the first point 1 and 2).
Why would I want such an app? To add a GPS connection manager to my today screen HS++ skin (also maybe make a script that will only launch my device navigation software when it has a position fix).
PS:
Other stuff I'd like to see are either other small cmd apps or small updates/fixes of some OSS apps like GSFinder+ or even emulators (small stuff like adding onscreen controls using existing sources, emulate mutli touch or improving controls by mixing the use of oncreen keys with hw ones or minor GUI standardization and fixes related with new devices screen resolution).
cris_rowlands said:
As the title says, Im a developer but I dont know anything majorly complicated.
I want YOUR ideas for something to make.
Stuff I know:
Things to do with the file system - copy, paste, delete, create etc
Read/write/create text files
Simple or even more complex UIs (nothing too extreme though)
most of the basic stuff
Heres a video of stuff Ive done before:
http://www.youtube.com/watch?v=g3_5xBqf-eQ
If you have any idea for simple apps, please let me know and Ill tell you if I can make them or not
Thanks
Click to expand...
Click to collapse
OK here is an idea for a simple but useful application please would you consider making this
http://forum.xda-developers.com/showpost.php?p=5711236&postcount=1
Slide2Action
Hi cris, How about a simple slide to do anything? Just a scrollable list of blank sliders that you can assign a function too, eg launch an app, blank screen, reset, close all, new message, WiFi, bluetooth etc. the list could be endless. Just a scrollable action screen with sliders instead of buttons. Transparency would be a bonus for a nice visual.
well folks, youve given me plenty of ideas.
A few of them ill try to work on, sadly many of your ideas are a little beyond me
Anyway, Ive got some stuff to be doing so I wont be checking out this thread anymore.
If any developers feel they want to take up any of these, please feel free ^_^
zinconnu said:
Maybe a new app to replace and improve SmileySMS ( development is stopped, and on windows mobile we can't have smileys in sms without this buggy app).
Click to expand...
Click to collapse
I was going to make this same suggestion. I hope somebody with the skills stumbles upon this and can continue the development for this.
cris_rowlands said:
well folks, youve given me plenty of ideas.
A few of them ill try to work on, sadly many of your ideas are a little beyond me
Anyway, Ive got some stuff to be doing so I wont be checking out this thread anymore.
If any developers feel they want to take up any of these, please feel free ^_^
Click to expand...
Click to collapse
Hi Cris,
if you can consider my suggestion to develop a "shopping List" + "Inventory" apps I think is not that difficult to develop. It almost similar to like any shopping list app & you be able to keep track of the inventory list maybe with photo or pic is good enough.
pls do consider this apps, as both iPhone & WinMo still do not have such app yet. If you do build up, you will be the 1st to come out with.
Lockscreen Slider
Please try to do a Lockscreen Slider for WM 6.5
http://forum.xda-developers.com/showthread.php?t=638230
Thanks
salo1 said:
Please try to do a Lockscreen Slider for WM 6.5
http://forum.xda-developers.com/showthread.php?t=638230
Thanks
Click to expand...
Click to collapse
yes let's steal some more apple patents!!! The idea is great! Few months ago I already asked this topic in the S2U thread but no response, probably my request got overseen or the guy is just too busy with other stuff.

[Q] Need Suggestion

Hi Friends,
I am going to develop a windows mobile application for a big shopping mall using VB.NET.
I will appreciate for your suggestion for the below.
1- Can i filter Message using VB.NET and display in my application. For the example if our company send some promotional message, same time i need to invoke my application and display the message in his own window. and not let it go to the default phone message folder?
2- Is there any Service which can run background and keep filtering for all incoming SMS?
3- I will appreciate if anyone can give me link for the messaging development in VB.NET
Thank You
Hi,
For filtering incoming SMS messages, you need to look into the MessageInterceptor class:
h t t p://msdn.microsoft.com/en-us/library/bb932385.aspx
As for a background "service", you can create an exe project and have it auto-minimise on startup. Add the code to set up the Message Interceptor and display your custom form when a matching message comes in. When the user closes the form, simply minimise back down again. The exe will continue to run unless the user kills it (i.e. in task manager).
When you create your CAB file setup project, open the File System dialog and add a shortcut to the Windows Folder\Startup which targets the Primary Output of your exe. This will ensure the app runs when the user restarts their device.
Hope that helps!
Kind Regards,
PaulM
PaulM,
Thank you for your suggestion, i made a small test application and works like charm )):
After filtering i need to save the message and display it when user need in future. What is the best way to save? XML will be good or other com type should i use to act as database?
Thank You
Hi go4voip,
XML springs to mind, but it depends on security - XML is plain text and can easily be edited by the user on the device.
However, if you wanted more security, you could still use XML but encrypt the data before saving it to a file, then decrypt it before loading it into the XML document. See the System.Security.Cryptography namespace - it's dead easy to use.
Kind Regards,
PaulM
go4voip said:
PaulM,
Thank you for your suggestion, i made a small test application and works like charm )):
After filtering i need to save the message and display it when user need in future. What is the best way to save? XML will be good or other com type should i use to act as database?
Thank You
Click to expand...
Click to collapse
Hi go4voip,
well just to add one more thing here if u use messageinterceptor it may not work for some HD2s as i have faced a lot of issues because of it in one of my app, so i went for a different way. It is basically a native dll.
about saving it google "SQLite" it is mobile db, very small and just a dll...no installation. I used it for my app.
PS: Let me know if you need any help... also you can see two apps in my signature one is SMSFilter that uses the native way of filtering the sms and other one smsrule which uses the messageinterceptor way of filtering. It is verymuch simmilar to what you want.
Thanks,
Mohit

[CODE] Blockclock - Free Code Giveaway - A Metro Style Alarm Clock for WM6+

A lot of people I spoke to whilst leaning programming didn't want to help with the Visual Basic side of things and started moaning about me not using C# - but that was my choice to make. So I make this post with similar minded people in mind - maybe there is someone else out there that doesn't want to learn C# to code apps?!?
A while back I started learning about Windows Mobile development but I left it a bit late in the OS's lifecycle and sadly lost my motivation for producing apps for it.
Now that I have left my Windows Mobile development behind I am willing to contribute my, slightly messy but, working code to anyone that might find a use for it.
I am willing to donate my code to the community in the hope someone will finish it off - if they can decypher my workings - or make use of it in their own projects.
It's an Alarm Clock in the Metro UI style (see attached screenshots) which wakes the device at the set time and sounds an alarm and is written in VB and is for Windows Mobile 6 and above. Most of the functionality is already in place.
It requires the Smart Device Framework libraries to be installed on the PC used to code it.
Working Features:
One working alarm which wakes the device when required
Snooze function
Customisable colours - working selector screen with 46 colours to choose (you can even use a custom hex colour if the XML settings file is manually edited)
Selection of different date formats
Rotation support for WVGA devices works...sort of but could probably be tweaked.
Things left to finish:
Add additional alarm(s)
Allow naming of alarms
Put dialogue in place to select a sound for the alarm(s)
Put an 'if -> then' statement in place in the alarm sounding procedure to vibrate the device if vibration is enabled
Graphics are minimal to reduce on memory usage but I think it looks quite good...even if I do say so myself (Please see the screenshots attached)
The program was never finished due to changing my main OS on my phone from Windows Mobile to WP7 and Android and I don't think I'll be returning to Windows Mobile 6.5 development.
The following imports are required:
Imports System.IO
Imports System.Threading
Imports System.Media
Imports OpenNETCF
Imports OpenNETCF.WindowsCE
Imports OpenNETCF.AppSettings
...and the following references in the project references:
OpenNETCF.AppSettings
OptnNETCF.WindowsCE
The app creates an XML file for the settings which is stored in the program folder and in its current state it works for 1 alarm with one alarm tone ('alarm.wav' in the resources folder).
Any questions...feel free to ask. There is one menu template which is configured in various procs to create the menus for alarms and preferences so it can look more complicated than it actually is in the code.
Glad to see some people may have found this useful! Keep me updated with any developments, it'd be interesting to see if this goes anywhere....I ask for no credit.
Hi thank you for the source code. I prefer C# syntax wise but they share the same runtime environment and get compiled into the same MSIL language so in theory they are the same. Just some things are done differently. Cheers again.
sb.oddworld said:
Hi thank you for the source code. I prefer C# syntax wise but they share the same runtime environment and get compiled into the same MSIL language so in theory they are the same. Just some things are done differently. Cheers again.
Click to expand...
Click to collapse
No problem at all. Some of the form layouts can be a little confusing so if you need a hand just yell. Glad that it might be of use to someone.
Thanks welki1979 being a non C programmer I fully appreciate how hard it is to find suitable code to get examples from. Even if it turns out to be totally useless it is still a very nice gesture.
Ok got it up and running (didn't need the Smart Device Framework listed above as I already had Microsoft .NET Compact Frameworkwork 3.5 installed).
First impressions... It's really cool (especially the random item close), haven't had much chance to go through the code yet as it threw up an exception when I first ran it that needed to be sorted out first.
What I was hoping to see was the application being triggered from one of the menus items but instead it just fires up on load.
I was hoping to learn how to code it so it could be fired off the start menu icons, but I can't seem to work out how those applications are triggered.
Not sure what value I can add to the program, but given enough time to learn a bit more about mobile coding I might be able to add something.

[Tasker] Glasker: Send Anything to Glass with only TASKER!

I have a Pebble, which doing a great job of getting Android Notifications! I just wonder if I can do the same thing with Google Glass.
There are some notification forwarder on the Market now, however, since I am already running Tasker, so I wonder if I could use
Tasker + Google's Mirror API
to achieve same thing without running any other APP on my phone, nor on my Glass, and here it is: "Glasker"
"Glasker" encapsulated Mirror API's token and authorization process into several Tasker tasks so you only need to write simple tasker "Profile" based on trigger you want then send anything to Glass!
With "Glasker", you could:
1. Forward ANY Android notification (as far as Tasker can get) to your Glass.
2. Forward Music Track info on your Phone to Glass while playing by Phone.
3. All of communications are just between your phone, Google's cloud and your Glass. Nothing go through another server.
4. You tell me!
Before we start, here are the disclaimer:
1. As Tasker is just plain text, you can see everything how those tasks works. Please review the code before proceed and once you run the tasks, I am not responsible what happened to your phone, your glass, Google's cloud or your washing machine, etc...
2. I am NOT affliated to the author of "Tasker" nor "RESTask for Tasker". Thus I am do NOT know if any of them send your message somewhere else. Don't use this project if you suspect anything.
Okay, Here are the setup steps:
0. Install a Tasker plugin "RESTask for Tasker" https://play.google.com/store/apps/details?id=com.freehaha.restask This is used to send REST message to Google's cloud. (Tasker's internal PUT doesn't work here...)
1. Setup your OAuth2.0 Client ID and Client secret at https://console.developers.google.com/project (If you have no idea on what I am saying here, I will try to add a walk thru in 3rd post when I got time!)
2. Turn on your Glass and make sure it connected to your phone via MyGlass app. Make sure your phone and Glass can access the network.
3. Import downloaded "Glass.prj.xml" file into Tasker
4. Open task "TimeInZulu" and modify Variable Substract: %deliverytime, xxxxx according to your time zone!
In Taiwan (GMP+0800), xxxxx=8*60*60=28800
In LA, USA (GMP-0800), please change Variable Substract-->Variable add: %deliverytime, 28800
Other time zone please modify as needed or you will not hear a chime when message delivered to your Glass!
5. Run Task "Get Authorization 1" once and input your Client ID, Client secret (Those two variables will be kept in Tasker Variables in PLAIN text since it will be used later), than your default browser will fire
6. After grant yourself with the priviledge of "Glass timeline request", than you will be directed to a web page with a code. Please copy the code.
7. Return to Tasker, than run "Get Authorization 2" (hence Google's Two-Step Authorization....), than input the code you get from last step.
8. Let the Task run a while (10~20 second), then you should see a message on Glass says "My Notification forwarder Setup Completed!" (If not, lease scroll to right of timeline to see this message. It should be the 1st message)
9. Now, go back to Tasker/Profile than setup your trigger. (My default trigger are with Line, a Whatsapp like messanger very popular in Taiwan)
10. Profit!
If you find this useful, Thanks button is just a click away! Also, if you can make this project better, please also share what you modified here!
Profile explaination:
1. GlassConnected: Master switch for all sending profiles. I disable the forwarding of message if my Glass is not connected to my phone via BT directly for apparently security reason. In theory as long as both your Phone and Glass are connected to the network, you can forward message even they are at opposite side of the world!
2. SendLineMsg: Send message from Line, a Whatsapp like app wildly used in certain parts of world (4 billion active user!). You can modify this to any other messanger!
3. SendMusicInfo: Not necessary, it's just a demo to show it can send something else.
Task explaination:
1. Get Authorization 1/2: To get authorization from Google to allow access to Mirror API.
2. Remove All TimeLine Items: Utility task. As name suggests, it removes all timeline items created (only) by Glasker. It also reset several Tasker variables should you encounter problem. (No need to re-do Get Authorization)
3. Get Time Line: Used in "Remove All TimeLine Items" to get all timeline items created by Glasker
4. GetAccessToken: Utility task. Used to get new access token from Google (since token are temporarily and expires about 360 seconds). Usually you don't need to mess with this task
5. TimeInZulu: Convert local time to Zulu time. It seems Mirror API only accepts Zulu time format. (You need to modify this task based on your timezone as above step 4 or you wil not hear reminder chime when mesasge delivered
6. SendStaticCard: This task is used to send customized content to Glass.
7. SendLineMsg: Send nofication from Line app to the Glass. I update both "Boundle Cover" as will as content
8. SendMusicInfo: Send the music track info for the music playing at stock music player on your PHONE. (This is a demo of non-chimed Card send to glass)
Reserved
**Reserved**
This looks pretty cool. Sorry if I missed it, but does glass automatically turn on, visual, for each notification?
jewnersey said:
This looks pretty cool. Sorry if I missed it, but does glass automatically turn on, visual, for each notification?
Click to expand...
Click to collapse
Yes, you can make a sound when notification push to Glass. However, the Glass will not turn on the screen. (This is explicitly mentioned by Google that such ability will not be allowed in Mirror API, only for APP running on Glass itself).
What's cool here is that when you hear the notification sound, if you turn on the Glass in about 5 second (by touchpad or head-up activation), the Glass will show the notification card directly instead of the regular card with time.
The task of "SendLineMsg" is an example to have a card with notification sound, while "SendMusicInfo" doesn't have sound.
Got any way to go the other way? From Glass to phone? Would be great for voice commands for home automation.
Frunple said:
Got any way to go the other way? From Glass to phone? Would be great for voice commands for home automation.
Click to expand...
Click to collapse
Yes, it's possible to go the other way (from glass to Phone). However you need to run a HTTP server on your phone.... The whole Mirror API is two way...
I was thinking to have Tasker to enable/disable the HTTP server on phone based on the message sent (to save phone resource-->Battery when no message are needed) but don't have time to do it yet...
You are welcome to make modification here!
I don't understand step 4. I'm supposed to change variable from subtract to add?
foxdog66 said:
I don't understand step 4. I'm supposed to change variable from subtract to add?
Click to expand...
Click to collapse
It's depends on your time zone. If you are in US, you need replace the "Variable Substract" action with "Variable add" action than put your time zone difference in second.
I'm trying to use this to forward YouTube videos to glass. Getting close I think.
foxdog66 said:
I'm trying to use this to forward YouTube videos to glass. Getting close I think.
Click to expand...
Click to collapse
Any luck on this? Does the timeline card open up the correct application? Can I send myself a location from my phone and open it up with maps on glass? This would be awesome!
Does this still work without MyGlass ?

Categories

Resources