Interesting numbers in the Windows Mobile 5.0 Device Emulator February 6, 2006
Posted by suniljagadish in .NET CF, Old posts, Programming, Windows Mobile.add a comment
Check out Barry Bond's post about a few numbers in the WM 5.0 Device Emulator that can be used to test busy numbers, never answer numbers etc.
Windows Mobile 5.0 Message Interception January 30, 2006
Posted by suniljagadish in .NET CF, Old posts, Programming, Windows Mobile.4 comments
I delivered a session on Windows Mobile programming with a focus on WM 5.0 in Coimbatore during the MSDN @ Campus event. I demonstrated a Bluetooth application using the 32feet API and Message Interception API in WM 5.0. I am reminded to point out that Peter Foot of the OpenNETCF fame, has separated a few APIs including the Bluetooth library into 32feet, which is worth noting for Bluetooth enthusiasts.
I have uploaded my demos here-
Bluetooth demo (scenario was communication between a PPC and a Desktop machine at a Pizza Company)
[Demo will be upload the shortly]
Download the SMS interception demo
The SMS Interception demo has inline documentation to help you understand its working.
/*
*
* ———————————
* Running the application
* ———————————
*
* 1. Make sure you have VS 2005 and Windows Mobile 5.0 PocketPC SDK installed
* 2. Run the application and use the Windows Mobile 5.0 PocketPC Phone Emulator
* 3. Click on the “Start” button to start the SMS Interceptor
* 4. This application will peek at all SMS’s received henceforth and process them
* if the SMS body is prefixed with the word “ASTRO”
* 5. Valid format for getting prediction: ASTRO dd-mm
* 6. Open the “Messages” in the PocketPC and create a new SMS, say, ASTRO 20-8
* (for 20th Aug) and send it to +14250010001, which is a fake number.
* Any Phone calls or SMS’s to this number is a reference to the emulator itself.
* 7. Once the SMS is sent, it appears in the list box. If it were to be an SMS
* without prefix “ASTRO”, the application will leave it to be read by the user.
* 8. This can be observed when the prediction is sent. This SMS lands in the Inbox.
* 9. To stop the Message Interception, click the Stop button
*
* More reading info on SMS interception API in WM 5.0:
* http://blogs.msdn.com/windowsmobile/archive/2005/07/09/437189.aspx
* http://www.pcquest.com/content/search/showarticle1.asp?arid=75833&mode=disp
*
* Windows Mobile 5.0 PPT – TechEd
* http://download.microsoft.com/download/9/f/a/9fadc29f-8df1-486f-b200-94f79ee7a7de/MED%20303%20New%20Managed%20APIs%20Controls,%20Messaging%20and%20Telephony.ppt
*
*/
I got mails from many people reporting a problem in downloading the code. So, I’ve uploaded it here – http://suniljagadish.googlepages.com/SMSInterception.zip
Visual Studio Power Toys and Code Snippet Editor January 19, 2006
Posted by suniljagadish in .NET, Old posts, Programming.1 comment so far
I just completed a bluetooth demo for a Windows Mobile presentation that I'd doing at MSDN @ Campus, Coimbatore.
Code snippets is a very good feature which is helpful especially while doing demos. It is good to see the snippets wrapped within a neat XML schema. But, I thought it is slightly cumbersome to create a code snippet. The Powertoys blog has a pointer to a very cool tool – Snippy, which makes snippet creation quite simple.
Creating code snippets [MSDN]
Creating and Using Code Snippets in Visual Studio 2005 [4Guys From Rolla]
Code snippet XML schema reference [MSDN]
You can find some ready-to-use code snippets in GotCodeSnippets. It doesnt contain many snippets, but a cool initiative.
Web Services – Cool demo November 30, 2005
Posted by suniljagadish in .NET, Old posts, Programming.add a comment
The other demo I showed during the launch of Microsoft Academic Projects was to demonstrate the web services. Though this demo may not have real business application, one will be able to guess the power of Web Services and its extensibility.
I setup my webcam at home and used TinCam, to dump images shot from the webcam into a folder at a given interval. I referred this article and used Binary Serialization to transmit the images from my PC to the Web Service consumer application which is a simple WinForms application.
A very simple application, but cool to watch. Download the source here.
Power Management API in Platform SDK November 30, 2005
Posted by suniljagadish in .NET, Old posts, Programming.add a comment
I demonstrated the Power Management API of the Microsoft Platform SDK during the launch of Microsoft's Academic Projects Program here in Bangalore.
Microsoft Platform SDK is a colelction of powerful APIs which you can play around with to do a bit of system-level programming. You could use the Microsoft VC++ compiler to compile your programs.
The Power Management Demo I showed is pretty simple and straight-forward. The user is intimated through an alert when there is a change in power source. In a real-time scenario one could perform actions to change the execution state/processor consmption of the application when the computer is running on battery. This is done using one simple function:
BOOL GetSystemPowerStatus(
LPSYSTEM_POWER_STATUS lpSystemPowerStatus
);
to which you would have to pass the reference of an object of type SYSTEM_POWER_STATUS structure. The power source is indicated by the value of the structure variable ACLineStatus (0 – Battery, 1 – AC Power & 255 – Unknown).
In the main window message processing function (WndProc), you can invoke this function when the WM_POWERBROADCAST message is received.
case WM_POWERBROADCAST:
BOOL ret;
SYSTEM_POWER_STATUS sps;
ret = GetSystemPowerStatus(&sps);
if(sps.ACLineStatus)
MessageBox(hWnd,TEXT("You are on AC power"),TEXT("Power Management Demo"),0);
else
MessageBox(hWnd,TEXT("You are on battery power"),TEXT("Power Management Demo"),0);
By responding to the PBT_APMQUERYSUSPEND message, an application can put off a suspend request from the operating system. The application will need to respond with a BROADCAST_QUERY_DENY, if the application cannot allow the system operations to be suspended. The Power Management API has other useful features to support automatic wake-up using the System Wake-up Events.
Read about using Microsoft Visual C++ 2005 Express with Platform SDK.
Imagine Cup 2006 – India October 29, 2005
Posted by suniljagadish in Imagine Cup, Microsoft, Old posts.add a comment
Its been a long time since I posted here and I have lots of excuses for that.
India is hosting Microsoft’s most awaited Global Student Competition – Imagine Cup. Imagine Cup 2005 Global finals was hosted by Japan and everyone throughout the world witnessed real cool applications developed by students.
“It’s amazing to see all these passionate students doing such great work. The Imagine Cup brings fun competition and tough challenges to the next generation of software innovators, and I’m excited that Microsoft is helping them succeed.”
- Microsoft® founder and Chief Software Architect Bill Gates
The theme for Imagine Cup 2006 -
“Imagine a world where technology enables people to live healthier lives”
[Source]
There are already lots of sites/blogs on the web which have published details of this years Imagine Cup, though I havent found an official competition details fromMicrosoft. If you are tempted to get clicking, here are a few pointers -
http://blogs.msdn.com/msozacademic/comments/475194.aspx
http://www.fmi.uni-sofia.bg/microsoft/initiatives/imaginecup2006india.html
http://www.schrankmonster.de/PermaLink,guid,cd64d0f2-dcba-454f-83b6-ff21b75f5015.aspx
Apart from these, to get a regular dose of updated information about IC ‘06, you must stay tuned to thespoke.net, becuase that is where all the ’stuff’ is going to happen.
- An active IC ‘06 thread on theSpoke
- The official Visual Gaming invitational details.
Sharath and I have teamed up for Imagine Cup 2006
(Update: We didn’t participate in Imagine Cup 2006. Looking forward for IC 2007)
Microsoft Command Shell “Monad” July 10, 2005
Posted by suniljagadish in Old posts, Windows.add a comment
What is Monad?
Monad is the new command line shell developed by Microsoft. Microsoft does come out with interesting codenames for its products, which reminds me of the Whisteler, Longhorn and Blackcomb funda.
I got this from wikipedia-
The word monad comes from the Greek word µ???? (from the word µ????, which means “one”, “single”, “unique”) and has had many meanings in different contexts.
Goal of Monad is to deliver an extensible scripting environment that is secure,interactive, programmable and production-ready to enable consistent and reliable automation of administrative tasks.
Some key things about it:
- A Scripting Language called Msh Script
- An interactive shell called Msh.exe
- SDK to produce task-oriented commands and providers
- A set of domain independent utility commands
- A mechanism to do remote scripting.
If you are wondering how to get your hands on a copy of this, visit the Microsoft Betas Site. Arul Kumaravel (a Dev Lead at Microsoft) posted a Quick Start for those who want to get started with Monad. The essence of object-orientedness can be seen in the syntax and usage. Eg.: $a.SubString(0,3). Someone did complain that Monad has been left out in the PDC ‘05 agenda.