.NET Compact Framework and Smart Device Programming (February 14, 2006)

Please note: Portions of this transcript have been edited for clarity

Introduction:

mikefos_msft (Moderator):
Welcome to today’s MVP-hosted chat regarding the Smart Device Programming with Visual Studio .NET!!
We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.

Ginny (Expert):
Hi, I'm Ginny Caughey. I'm president of Carolina Software Inc., an ISV company that provides vertical market solutions on desktop and mobile devices to the solid waste industry.

AlexFeinman (Expert):
Hello, I am Alex Feinman - an engineer at Corrigo Inc and a member of OpenNETCF.org. I am also a Microsoft MVP for .Net Compact Framework

PeterFoot (Expert):
Hi, I'm Peter Foot a UK .NETCF MVP from In The Hand Ltd. I'm also a part of OpenNETCF.org

AlexYakhnin_MVP (Expert):
Hi my name is Alex Yakhnin from Intelliprog and a member of OpenNETCF

mikefos_msft (Moderator):
Let’s begin the chat!

Start of chat

PeterFoot (Expert):
Q: For a WM2005 Smartphone app, I am looking for a way to wake the device up at a scheduled time and start my app. There seems to be an interface IApplicationLauncher, but there's virtually no documentation for it. Any ideas how I can get the required function
A: IApplicationLauncher is specific to the managed SMS implementation on Windows Mobile 5.0. However do not dispair you can launch an app at a specific time by P/Invoking either CeRunAppAtTime or CeSetNotificationEx - and there is a wrapped implementation in the OpenNETCF SDF

AlexYakhnin_MVP (Expert):
Q: So by device I assume it is devices such as Tablet PC and Pocket PC?
A: Since the Compact Framework is supported on Windows CE (Windows Mobile) devices this chat doesnt inlcude Tablet PC

PeterFoot (Expert):
Q: Just Pocket PC?
A: No not just Pocket PC - but Windows CE platforms which support .NET Compact Framework, which includes Pocket PC and Smartphone

Ginny (Expert):
Q: Is there a way to create a shortcut on the desktop using the Smart Device Cab Project File System Editor?
A: Here's a walkthrough that shows how to create a cab file that includes creating a shortcut: https://msdn2.microsoft.com/en-us/library(d=robot)/zcebx8f8.aspx

PeterFoot (Expert):
Q: @Peter (regarding Q1): OK, just wanted to make sure that there is no managed API for that?
A: No there isn't anything in the .NETCF libraries themselves in either v1 or v2.

AlexFeinman (Expert):
Q: Is possible send a text message from a vb.net application to a mobile phone ?
A: Under CF 2.0 on WM5 devices you can use Microsoft.WindowsMobile.PocketOutlook.SmsMessage class. On the older devices it's quite cumbersome, but eventually boils down to P/Invoking SmsSendMessage

AlexYakhnin_MVP (Expert):
Q: Does it need certain Operating System like Windows Mobile 5? Or can it work on Windows Mobile 2003 First Edition?
A: CF v1 and CF v2 are supported on WM 2003 first and SE.

AlexFeinman (Expert):
Q: A question for Alex Feinman: It relates to your AxHost demonstration from several months ago: I can get it to work in the emulator with WMP10 but not with the ActiveX control that I would really like to get it working with. The exception it throws is ...
A: If the error you are getting is E_NOINTERFACE, it might be that the control is strictly windowless. My wrapper does not expect this. You could contact me offline and we could see what can be done

PeterFoot (Expert):
Q: Today I tried to install the Express Version of Visual Studio and afterwards I installed the .Net Compact Framework 2.0 but I didn't get an option about programming for a Smart Device. Isn't that possible?
A: Smart Device development is not supported with the Express editions. You'll need Standard Edition or higher.

AlexFeinman (Expert):
Q: Is it possible and if yes, how, to use Windows CE as a WebService Server?
A: The HTTPD component is a part of optional components shipped with the SDK - in 4.2 under support\httpserver, in 5.0 as a separate download

AlexYakhnin_MVP (Expert):
Q: Is there any plan to provide a CodeDom type functionality or Reflection.Emit in OpenNETCF or even in a future rev. of CF, or other 3rd party offering you are aware of?
A: This will be a pretty hard undertaking for OpenNETCF. In my opinion it should be done in the CF itself and this idea was conveyed to the MS. Will they implement it? We will see.

AlexFeinman (Expert):
Q: My application uses keyboard wedge barcode scanners. I am trying to process the input in CF 2.0, using keypreview. I seem to have got it working, but some users are still having problems. Is there any sample code for this?
A: There isn't much to show - you just activate the wedge and catch the input in the KeyDown or KeyPress event. What exactly is not working?

Ginny (Expert):
Q: q3: I have gone thru the walkthrough and have created the shortcut in Start, Programs. However, I can find no way to put it on the Desktop of my CE 4.20 device. Desktop is not one of the special folders, and I see no way to try to trick it.
A: On my CE apps I copy the shortcut .lnk file to the \windows\desktop folder on my devices. This isn't a general solution though since the name might be different in different languages.

PeterFoot (Expert):
Q: When targeting a specific device (T-Mobile MDA Vario) and deploying to it, a new version of .NET CF 2.0 is installed as well. Any way I can specify during development that I want to use the installed version of the 2.0 framework?
A: No devices currently ship with .NETCF v2.0 in ROM, however once it has been deployed the first time it shouldn't get pushed to the device again, unless installation failed - is this what you are seeing?

AlexFeinman (Expert):
Q: Yes, I already built an Image include the httpd, but what about generating .wsdl file and configuration of the webserver in CE?
A: You mean Web Services? No, there is not much in terms of helping to implement them. It would be quite an exercise. HTTP hosting is not a part of Compact Framework

AlexFeinman (Expert):
Q: Thank you Alex - The exception is actually 'No such interface supported' - sorry about the misquote. Can you pleas advise how I can contact you offline?
A: You can send me an email at public_news@alexfeinman.com

PeterFoot (Expert):
Q: When installing an app on a WM2005 Smartphone, is there a way to have the app show up by default in the application bar at the top of the screen (without having to run it first)?
A: The application bar is an MRU (Most Recently Used) list, so while it may be possible to add an entry via the registry it's probably not a safe option. Also the bar you see will depend on the home screen layout used.

AlexFeinman (Expert):
Q: and if I use the Microsoft.WindowsMobile.PocketOutlook.SmsMessage class, the target mobile phone must be one with windows mobile operating system or just a mobile phone that accept text messages ?
A: Any SMS target. All you are doing is sending a generic SMS text message. You won't be able to send special messages, like OTA config or anything similar

PeterFoot (Expert):
Q: @Peter (Q15): You mean that current WM2005 devices don't have .NET CF 2.0 in ROM? I believed that was part of any WM2005 installation.
A: No, all WM5.0 devices currently ship with .NETCF v1.0 SP3 in ROM, an OEM may pre-install .NETCF v2.0 but it's not a given.

AlexYakhnin_MVP (Expert):
Q: What is the best approach for designing a business web site for use by both desktop and PocketPC and smartphone? Should you design two sets of pages for both worlds, or design separate CSS files, one for media=display and another for media=handheld?
A: If you separate presentation layer from business logic it should be logically to have 2 sets of pages. You can also use ASP.NET Mobile controls that will take care of resolution and supported html issues.

AlexFeinman (Expert):
Q: Just some theory. If I'm going to build a WebService with Visual Studio 2005 as asp.net web service, take that .wsdl file and put it into the CE Device. Then configure the httpd at CE to load MyWebService.dll ...
A: But you cannot load a desktop DLL on the device. That on top of other issues like not having System.Web.Services from the full framework, full SOAP serialization or HTTP hosting support in the framework

Ginny (Expert):
Q: is possible that a mobile phone can get information from a SQL Server Enterprise ?
A: There are several ways to get data from SQL Server: merge replication with SQL Mobile or SQL CE on the device, RDA with SQL Mobile or SQL CE, and web services are three popular approaches. If you have constant connectivity, you can also use the SQLClient namespace on the device to access data on SQL Server.

AlexFeinman (Expert):
Q: That's right, but i can built a DLL for smart devices or not?
A: You can build DLLs for smart devices, but they will be using whatever platform support present. If the http hosting is not supported on the platform, then you can’t do much in terms of hosting a web service

AlexFeinman (Expert):
Q: Isn't SOAP 1.2 fully implemented in Compact Framework 2.0?
A: Yes, the client, not the service side

PeterFoot (Expert):
Q: Is there a reason why a CreateProcess call to cplmain.cpl would work on the emulator but not on my device (PSC Falcon 5500)? It should display the date/time applet, but instead does absolutely nothing.
Dim progPath As String = "ctlpnl"
Dim progCmdLine As String = "cplmain.cpl,16"
Dim pi As New ProcessInfo
WaitCursor(True)
If Not CreateProcess(progPath, progCmdLine, pi) Then
MessageBox.Show(String.Format("Failed!" + ControlChars.Lf + "System Error = 0x{0:X8}" + ControlChars.Lf + "({0})", GetLastError()), "Done waiting...")
End If
WaitCursor(False)
A: The 5500 is a CE.NET device - the control panel applets may be named differently, have a look at the cpl files in your \windows folder on the device.

Ginny (Expert):
Q: Do you have any performance data accessing data via rda vs web services? Which one do you recommend for large amounts of data
A: It depends. ;) If you make "chunky" calls, web services can be a good performer. But if you pull a lot of data only once and then just push a little data from time to time, RDA might be better. It might be a good idea to test using your expected scenario.

AlexYakhnin_MVP (Expert):
Q: if I write a Web service, there is some difference if I call it from a mobile phone application or from the Web ?
A: You call it the same way on the device as on a desktop.

Ginny (Expert):
Q: if I write a Web service, there is some difference if I call it from a mobile phone application or from the Web ?
A: It's generally the same approach. You need to make sure the mobile device can reach the web service (domain name resolution issues, etc.), and ensure that the device can handle whatever serialization the web service provides. Some people actually use different method on the web service for mobile and desktop apps.

PeterFoot (Expert):
Q: Other CPLs exists and those do open, though I can't go to a specific page. Is there a documenter tool for CPL files or something similar? Getting info from PSC is like pulling teeth...
A: It's going to vary with different flavours of CE.NET, I don't have a similar device to compare with, PSC may be your only option

AlexFeinman (Expert):
Q: I thought SOAP are just messages (like Peer2Peer)
A: Web services model includes a client and a server. The server is built on top of an HTTP server but involves a lot more than just simply processing HTTP requests. The Compact Framework includes support for the SOAP client side. Only full framework provides the plumbing for the server side. You might have some luck with limited 3rd party implementations

Ginny (Expert):
Q: We get a lot of questions along the lines of "I have XYZ Windows CE.Net 4.2 device (i.e. not Pocket PC) - will your .NET CF application run on it?" Do you have any general guidelines about what can be expected to work on these non-PocketPC devices?
A: It really just depends on the device since CE is a modular operating system. Many CE 4.2 devices can run apps designed for PocketPCs, but many others can't.

TimWilson_MVP (Expert):
Q: Are there any or will there soon be any good profiling tools for Compact Framework 2.0?
A: Not sure if anyone is working on an actual profiling tool. You can, however, use performance counters. David Kline has some good information on his blog. https://blogs.msdn.com/davidklinems/archive/2005/12/09/502125.aspx

Ginny (Expert):
Q: What about the SQL Server Enterprise version. Are version 7 and 2000 supported ?
A: SQL Server 2000 is supported for merge replication and RDA.

AlexYakhnin_MVP (Expert):
Q: I noticed the XMLSerializer doesn't support cycles in the graph and also doesn't serialize private members. Does anyone know of any work to support these?
A: I am not aware of any workarounds and as far as I know XMlSerializer is not supposed to serialize private members. If you still want this, you can try to modify the XMLSerializer from SDF.

Ginny (Expert):
Q: Are there any major advantages to upgrading from SQL 2000 to SQL2005 for CE.NET
A: Merge replication is much easier to set up for SQL Server 2005 than for SQL Server 2000. If your question is about the mobile database (I wasn't sure) then SQL Server 2005 Mobile Edition (aka SQL Mobile) generally performs better than SQL Server CE 2.0, and there are nice development tools for SQL Mobile.

PeterFoot (Expert):
Q: When adding new contact on a phone, if given "www.mysite.com" (missing "https://") for the webpage field. Trying to access the contact.webpage (URI) property will return null. Wondering how I could access that string with managed code.
A: The managed API takes the url string and converts it with the URI class. What may work (I haven't tested the theory) is accessing it through the Properties collection of the Contact - ContactProperty.WebPage this may return the string...

PeterFoot (Expert):
Q: Can you programmatically associate and connect to a bluetooth device from CF 2.0 without going through the bluetooth manager?
A: Not directly through the .NETCF classes. But you can use this addon to DiscoverDevices and establish a Sockets connection - https://32feet.net (Only works on devices with the Microsoft Bluetooth stack, not others such as Broadcom)

AlexFeinman (Expert):
Q: Is possible that msn messenger can interact with a mobile phone application ?
A: As far as I know, mobile MSN Messenger does not expose any API. So the answer is - not likely

AlexYakhnin_MVP (Expert):
Q: Can you at least assume that a CE.Net 4.2 device has Compact Framework installed, or installable?
A: "Installable" - in most cases yes. "Installed" - not always.

Ginny (Expert):
Q: Re: Q43 - For example, the Navman PIN 570 (Pocket PC 2003 - Ce.Net 4.2) has CF 1 installed but actively refuses to allow CF 2 to be installed.
A: Have you tried resetting the device and then installing CF 2?

Mark Arteaga (Expert):
Q: So if you try to run a PPC .NET CF app on a non PPC CE.NET device does it fail when installing from the cab, or do you start getting NotImplemented exceptions thrown when you call PPC functions, or does the UI just not appear? ^o)
A: If you try to run your CF application and call PPC specific assemblies then you will cause an exception. If you don't call PPC specific you should be fine.

AlexYakhnin_MVP (Expert):
Q: Can anyone tell me, when the Compact Framework (or Windows CE) will support a Web Service Server
A: When and if CF will support runtime hosting.

AlexFeinman (Expert):
Q: I recently discovered (by accident) that an app developed with .NETCF 2.0 will also install and run on a WM2003 device. Can this generally be assumed? Or better: When developing against the 2.0 CF, how can I know what will require WM5, and what will work with WM2003?
A: CF2 officially supports WM 2003 devices. There are some classes that rely on the platform functionality present in WM5 (such as Camera, PocketOutlook etc). You could either build your CF2 application against WM 2003 and then you just will not see the classes and assemblies that are not available, or you can build against WM5 but keep in mind that there are some things you need to wrap and check for their presense first

Ginny (Expert):
Q: what are the best mobile phones to write a windows mobile application ?
A: If you target Windows Mobile 5.0 phones, you can take advantage of the Windows Mobile API functionality.

arnie_MVP (Expert):
Q: For example, the Navman PIN 570 (Pocket PC 2003 - Ce.Net 4.2) has CF 1 installed but actively refuses to allow CF 2 to be installed.
A: We've had some success with the gsoap toolkit (COM based) for CE. A version of the "Mobile Web Server Architecture" (see link from Alex) technology has been enhanced and submitted to the OpenNETCF organization. We'll see where that goes. Finally, the CF team at MS has it in their plans to support services on CE, read Indigo CF web services.

Ginny (Expert):
Q: When will i be able to write a web service that will run on Windows CE and can be contacted from other Web service clients?
A: If you're looking for functionality built into CE, there haven't been any announcements that I'm aware of.

PeterFoot (Expert):
Q: How exactly do I access the Properties collection of a contact? I'm not very familiar with this. Thank you.
A: It's defined in the PimItem base class - c.Properties[ContactProperty.WebPage]

AlexYakhnin (Expert):
Q: My first visit to one of these - Thank you to the experts for their time and effort!
A: Stephany you are welcome

mikefos_msft (Moderator):
Thank you for joining us today for our MVP-hosted chat concerning Smart Device Programming with Visual Studio .NET
A sincere thank you to our experts today!
Hopefully, we'll see you back out in the newsgroups!
We hope to see you again for a future chat!

Top of pageTop of page