Sunil Jagadish

Windows Mobile 5.0 Emulator and Webservice woes

with 15 comments

Many people (including me) have faced the issue of connecting to a webservice from a Windows Mobile 5.0 emulator. The error generally encountered is- “Unable to connect to network”.

I was able to overcome this problem after learning from this post that I need to cradle1 the emulator and then deploy the application. Before you cradle the emulator, make sure you have a compatible version of ActiveSync running on your machine. Configure your ActiveSync to connect using DMA (because the intention is to connect to the emulator).

I used my desktop’s IP address (and not “localhost”, nor the machine name) to add the webreference (of the webserivce) in the mobile device project.

Rest of the steps in cradling the emulator is neatly laid out in this post.

Note:
1. To cradle your emulator, first connect to it using the Device Emulator Manager, only after which the “Cradle” option in the Actions menu will be enabled.

Written by Sunil

2006.11.24 at 12:59 PM

Posted in .NET

Imagine Cup 2007

leave a comment »

Soon after Imagine Cup 2006, India concluded, with Italy taking home the cup for the Software Design invitational (Photographs), Microsoft announced the theme and the venue for Imagine Cup 2007. Korea would be hosting this mega-event in 2007. The theme being:

“Imagine a world where technology enables better education for all”

Frankly, the theme of IC ’06 (Imagine a world where technology enables people to live healthier lives) didn’t appeal to me, but, this one is really good and equally interesting. In addition to the invitationals present in IC ’06, Imagine Cup 2007 will have 3 (not completely ‘brand’) new invitationals- Web development (was there in 2005), Embedded development (probably Windows Embedded Challenge merged into IC) and Photography (wow! If time permits, I’d love to get clicking with my Canon S2 IS).

Good luck to all those of you getting ready to rock!

Note: My first blog post from Windows Live Writer. It rocks! Yes, it does.

Written by Sunil

2006.08.27 at 01:30 PM

Posted in Uncategorized

Windows Dev Live Beta launched

with one comment

When everything is going the Live way (Mail Live, Windows Live, Live Messenger etc.), why not something for Developers?

http://dev.live.com

Written by Sunil

2006.06.10 at 05:56 PM

Posted in Microsoft, Programming

LINQ – Language INtegrated Query

leave a comment »

Language INtegrated Query (LINQ) is an extension to the capabilities of .NET languages (currently C# 3.0 and VB 9.0) to perform SQL-like operations on any source of data. The conventional data sources that we’ve been using today are databases, flat files, XML documents etc. LINQ defines certain standard query operators that enable set operations, traversal, projection, selection, join (the relational algebra stuff) to be performed on non-conventional sources of data, which is IEnumerable<T>-based. This means that you can use LINQ to query data from sources such as the enumeration of the list of processes running on your machine. I found this neat example here.

To get started with LINQ, you need to download the LINQ SDK (May 2006). I delivered a session on LINQ at the BDotNETStudent UG meet.

One of my demos included querying a String collection.

Code:

string[] names = {"Burke", "Connor", "Frank", "Everett", "Albert", "George", "Harris", "David"};
var q = names
           .Where(s => s.Length > 4)
           .OrderBy(s => s.Length)
           .Select(s => s);
foreach(var i in q)
           Console.WriteLine(i);

A simple query which selects those names from the collection which have a length greater than 4 and the same is then ordered based on the length of each string (in ascending order).

The output:

Frank
David
Burke
George
Harris
Connor
Albert
Everett

Here you’d observe that though “Burke” appears before “Frank” in the original collection, after the execution of the query, the order isn’t preserved. This is because; the OrderBy operator implements an unstable sort algorithm to order the elements.The subtle difference between OrderBy in LINQ and SQL is that, in case of SQL, a query like-

select * from tab_names order by len(sname)

would result in:

Burke
Frank
David
Albert
George
Harris
Connor
Everett

Links:

LINQ Project on MSDN
Download LINQ SDK
LINQ Samples
Anders Hejlsberg on LINQ [Channel9 video]
LINQ Intro

Written by Sunil

2006.06.04 at 11:50 AM

Posted in .NET, Programming

Hello, World!

leave a comment »

If you have been following my earlier blog and this you know that I am Sunil Jagadish, a Microsoft Student Ambassador, pursuing Master of Computer Applications in RV College of Engineering (RVCE), Bangalore.. As I mentioned in the last post on Dotnetjunkies.com, comment spam succeded in forcing me to say “Good Bye!” to Dotnetjunkies. Thanks to the really huge and irritating banner ads on GeeksWithBlogs.net, I moved on from there. WordPress is decent and a calm place to blog.

If you search through the archives of most of the technical blogs and look for the first post, you will find a “Hello World” post. I was wondering why I should be calling this post “Hello World” and looked into Wikipedia and this is what I found –

A "hello world" program is a computer program that prints out "Hello, world!" on a display device. It is used in many introductory tutorials for teaching a programming language and many students use it as their first programming experience in a language.

A "hello world" program can be a useful sanity test to make sure that a language's compiler, development environment, and run-time environment are correctly installed.

However, the first known instance of the usage of the words "hello" and "world" together in computer literature is in A Tutorial Introduction to the Language B, by Brian Kernighan, 1973. [1] (http://cm.bell-labs.com/cm/cs/who/dmr/bintro.html)

Gramatically – “Hello, world!“ is the right way to say it, but some programming language syntax places constraints on the usage of strings.

All this is history. Something that is really cool and something that I had once planned to do is already there. A comprehensive collection of “Hello, world!” programs written in various programming languages. Its just awesome! A nice way to get an idea of what a programming language tastes like. The list if growing. Check it out.

PS: I have posted the old posts from my earlier blog below, under the category "Old posts"

Written by Sunil

2006.06.04 at 05:11 AM

Posted in Uncategorized

Interesting numbers in the Windows Mobile 5.0 Device Emulator

leave 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.

Written by Sunil

2006.02.06 at 05:57 AM

Posted in Programming

Windows Mobile 5.0 Message Interception

with 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

Written by Sunil

2006.01.30 at 05:53 AM

Posted in Programming