Smart Device Programming with Visual Studio .NET 2003

Posted September 24, 2004

Chat Date: September 9, 2004

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

Introduction

Moderator: mikefos (Microsoft)
Welcome to today's Smart Device Programming with Visual Studio .NET 2003 chat! Questions, comments, and suggestions are welcome.

Moderator: mikefos (Microsoft)
Let’s introduce our hosts for today.

Host: markih (Microsoft)
My name is Mark Ihimoyan and I am a Software Design Engineer/Test in the .NET Compact Framework Team

Host: Maarten (MVP)
Hi there, my name is Maarten Struys. I work for PTS Software in the Netherlands as Windows Embedded Product Manager. I am also an OpenNETCF board member.

Host: Ori_Amiga (Microsoft)
hola, I’m Ori Amiga and I’m the Group Program Manager of Visual Studio for Devices. Besides smart devices, I’m in love with fast moving automobiles.

Host: MarioCh (Microsoft)
Hi, my name's Mario Chenier and I'm a developer lead for VS2005 Visual Studio for Devices.

Host: clorton (Microsoft)
My name is Chris Lorton, I'm a dev lead for the .Net Compact Framework, concentrating on System.WindowsForms and System.Drawing for V1.

Host: jabraham (Microsoft)
I'm Jeff Abraham, I currently work on the Visual Studio for Devices Team as a developer on the native IDE, and I worked on Visual Studio .NET 2003 as a tester.

Host: CPiccini (Microsoft)
Hi there! my name is Christian Piccini, I am a tester on the .Net Compact Framework team.

Host: AlexFeinman (MVP)
Hello, I'm Alex Feinman. I'm a Software Engineer at Corrigo Inc. in Redwood City, California and a Microsoft MVP

Host: sergeyk (Microsoft)
My name is Serg Kuryata. I’m a SDE/T working on System.Windows.Forms and System.Drawing.

Host: achopra (Microsoft)
Hello Everyone, This is Amit Chopra, Program Manager with the Visual Studio for Devices Team.

Moderator: mikefos (Microsoft)
Welcome everyone, let’s get started!

Start of Chat

Host: Ori_Amiga (Microsoft)
Q: I've written a Smartphone alarm application and want to be able to keep the program from being closed, any ideas on how I can achieve this? I've written the program in C#...
A: I believe if the system is running low on memory, it will automatically send your app a request to shutdown (and if you ignore it, it will eventually force close you). However, you could potentially write a native wrapper which will register for notifications or wake you up on a schedule to ensure your app is always running.

Actually, I believe there is a native API to register for notifications based on time/date, which would be useful for an alarm. You can write a small native app to wake up and launch your C# app.

Host: AlexFeinman (MVP)
Q: I'm using SQLCE and the compact framework, and I'm finding that the performance of SQLCE is not good (as an example, the same Select Statement processed by Access in no time in a PC, takes 7 seconds in the Pocket PC emulator and 10 in a real Windows CE
A: The performance of SQL CE depends on many factors, including, but not limited to DB fragmentation, using or not using prepared statements and the location of database. Basically, do not store SQL DB in the flash memory or on memory cards, use parameterized commands with parameters created once and then reused with different values, and defragment the database. Also make sure that you use indices correctly. The index can speed up "select" statements but at the same time slow down inserts and updates

Host: AlexFeinman (MVP)
Q: (to Alex Feinman) Thanks for your feedback. I'm afraid that the database is almost empty. No more enhancements can be done to the SQL. Still, 7 seconds is a lot for an empty query and an empty DB in SQLCE. I'm a complete newbie to smart device programming. I've got visual studio .net 2003 and working in C++. What other programs do I need to get started (hope this is not too basic of a question for this forum).
A: Do you mean a single select statement takes 7 sec?

Host: Maarten (MVP)
A: No question is really too basic, Randall. If you have VS.NET 2003 you are basically ready to go start developing for devices. However, you need to use either C# or Visual Basic.NET. You simply start a "Smart Device Project" in the project wizard select the device type and off you go. If you want to read a little more about this you could take a look at: https://msdn2.microsoft.com/netframework/aa497273.aspx, where you also find links to some quickstart tutorials.

Host: Ori_Amiga (Microsoft)
Q: Will CF 2.0 support the My namespace for VB. In particular MyEvents (which is based on the new startup sequence)? This works great on the desktop with VS2005 Beta…
A: At this point we do not plan on implementing support for MyEvents as part of our MyVB subset. that said, the next generation of Windows Mobile will support a very rich "Notification Broker" that will allow you to register for rich system events from m

Host: markih (Microsoft)
Q: Datagrid in edit mode, as any enhancement?
A: What do you mean? Unfortunately, no, there is no support for edit mode in the DataGrid in V2.

Host: Ori_Amiga (Microsoft)
Q: Brody|MSMobileNews: thx for the pointers Ori! Much appreciated
A: I'll take a quick look and see if I can find it.

Host: Ori_Amiga (Microsoft)
Q: Brody|MSMobileNews: Ori... CERunAppAtTime
A: Yup. CERunAppAtTime and CERunAppAtEvent.

Host: Ori_Amiga (Microsoft)
Q: Brody|MSMobileNews: cool, thx for the input Ori, as I say, I'm gonna have to try and learn how to implement that!
A: Go ahead and send me a quick piece of email, I may have some sample code you can use.

Host: Ori_Amiga (Microsoft)
Q: I have not looked at the CE 5 Evaluation yet ... but does it contain an emulator that we can start developing CF apps for?
A: Yes. The CE 5.0 SDK does support managed code development (including emulation support).

Host: clorton (Microsoft)
Q: Does the VS 2005 Beta 1 REFRESH, fix the broken ThreadPool in CF 2.0? In fact, does the Refresh include any update to the CF components?
A: No, the ThreadPool fix didn't make it to the refresh. I don't believe there's any update to the CF in the refresh.

Host: AlexFeinman (MVP)
Q: When can we expect to see a QFE for CF 1.0 SP3?
A: I think not before SP3 is released

Host: clorton (Microsoft)
Q: Inherits in forms with design mode, works?
A: Yes, this is included in the Visual Studio designer for device projects.

Host: mikeli (Microsoft)
A: Daniel, regarding the treeViewNode.MouseClick, this didn't make the bar for v2

Host: clorton (Microsoft)
Q: How can update a form from a thread run in other part of application (A: see control.Invoke)
A: Control.Invoke is the correct answer for V1. V2 will have enhanced support for Control.Invoke (parameters are supported) and will help locate cross-thread GUI calls (will throw an exception)

Host: Ori_Amiga (Microsoft)
Q: Is it possible to detect when a device is placed in a cradle if this device is turned off (stand by)?
A: I believe there is a way to detect the current device "power state", (e.g., "charging") if that's what you're looking for.

Host: AlexFeinman (MVP)
A: You can't catch the power-off because then your app will not be running. You can detect a wakeup

Host: AlexFeinman (MVP)
A: Also see several answers to "Capture Resume from Sleep" thread from this morning in the .compactframework newsgroup.

Host: Ori_Amiga (Microsoft)
Q: To ori-amiga:But if the device is off I suppose my application can not check power state?
A: Correct. You can check the next time the device "wakes up", unless of course you register to be notified when the device is "going to sleep".

Host: mikeli (Microsoft)
Q: What is the best way to perform code reuse on forms?
A: In VS 2005, the designer supports inherited forms. In the previous version of VS, you could work around this by using #Ifdef statements to make your form inherit from your base class during runtime, then change the #ifdef to inherit from just the regular Form class during design time.

Host: Anthony (Microsoft)
Q: Anybody have any issues seeing web services on the host or sync'ing with sql using sql ce from the emulator when the computer you are developing on is not connected to the Network?
A: You should first verify that the os running on the emulator is configured to connect to the internet. Without this your device application will not be able to connect to web services.

Host: Ori_Amiga (Microsoft)
Q: For an application that does not have the foreground, how can it determine if there has been user activity on the device within the last 30 seconds?
A: Please see this thread, looks like there is no easy way to do this currently: https://groups.google.com/groups?q=detecting+idle+time+on+pocket+pc&hl=en&lr=&ie=UTF-8&selm=%23linl0M6CHA.1868%40TK2MSFTNGP12.phx.gbl&rnum=1

Host: AlexFeinman (MVP)
Q: Who knows how to make a CSD call without using hundreds of params and API calls (i.e. AT commands the old way?)
A: Yes, for as long as it is not a smartphone or Pocket PC Phone Edition device. On PPCPE you can do it using direct RIL access but it is not supported in 5.0 and discouraged in 4.2. On the smartphone it is a privileged operation

Host: CPiccini (Microsoft)
Q: How can you detect if the backlight is on? (ipaq)
A: You should be able to determine if the backlight is presently on by manipulating the DeviceIOControl function. I cannot find a managed way to do this so please see MSDN article: ms-help://MS.MSDNQTR.2004JUL.1033/power/base/ioctl_video_query_display_ brightness.htm

Host: clorton (Microsoft)
Q: Will CF 2.0 finally support timeouts in the Wait object calls?
A: CF 2.0 doesn't support any WaitHandle methods with timeout parameters.

Host: Ori_Amiga (Microsoft)
Q: tgensel_mvp : again it may have been because of the 2003/2005 mix.
A: yup, it is a goal for VS 2003 and 2005 to work well side-by-side, but there are known issues with the Beta builds.

Host: AlexFeinman (MVP)
Q: Is data transfer off topic here? If not, in supporting a legacy system, how would one best transfer flat files to and from a host system?
A: The HTTP transfer offers a good balance between ease of implementation and throughput. A UDP socket connection will be probably the fastest solution, but a complicated one as well

Host: AlexFeinman (MVP)
Q: Will CF 2.0 finally support timeouts in the Wait object calls
A: In CF 2.0 the native handle is exposed via a property, so you can simply PInvoke WaitForSIngleObject to get a timed wait operation

Moderator: mikefos (Microsoft)
Thanks for joining us today and thanks for the questions. It's time for us to officially end now

Moderator: mikefos (Microsoft)
If you have further questions regarding the Compact Framework or device development, please check out the newsgroup!

Moderator: mikefos (Microsoft)
Please see the chats schedule for upcoming topics.

Moderator: mikefos (Microsoft)
Please take a few moments to report your experiences with the Mobile and Embedded technical community: https://www.windowsembeddedeval.com/community/default.aspx

Moderator: mikefos (Microsoft)
Thanks folks!

Top of pageTop of page