Tuesday, January 27, 2004 - Posts

Develop Symbian/Palm/PPC apps using VB.NET -- a mini review of AppForge Crossfire

AppForge Crossfire is a mobile development tool that enables VB.NET developers to write portable mobile applications on different handsets (not just PPC).

Crossfire is an integral part of the AppForge Enterprise Developer Suite (EDS) and integrates seamlessly into the Microsoft .NET IDE, enabling you to immediately write applications, using the Visual Basic .NET programming language that will run on over 90% of the world's handheld, mobile, and wireless devices including Palm OS, Pocket PC 2000/2002, Windows Mobile 2003, Nokia Series 60, and Symbian UI.

Crossfire applications are created using specialized mobile controls, libraries, and modules that are plugged directly into the .NET IDE.

Key Features:
  • Seamless integration into Microsoft .NET
  • Visual Basic .NET language support
  • Debug application using .NET debugger
  • Test application within the IDE (no emulator needed)
  • Auto create Single-file Installation Package
  • Visual Basic 6 support via AppForge MobileVB (included)

Michael Yuan has tested this tools and these are his opinions:


0. When you install AppForge Crossfire, it automatically integrates itself into your existing Visual Studio.NET installation.

1. Open a new project for VB.NET and Crossfire applications.



2. Select a target device. This is important since different devices have different screen resolutions. If you choose PocketPC here but decide to build a binary package for Symbian Series 60 phone later, the oversized widgets would look bad on the screen and some widgets might not work correctly. I am disappointed that I do not have an option to choose a device indepent "library" project type. I mean, if I have to code for each target UI, I should at least be able to reuse "business logic".



3. Use the visual designer to build your UI from the controls in the "AppForge" toolbox (except for the MainMenu, which is the only control that comes out of the WinForms toolbox). AppForge controls are just normal VS.NET controls that runs on Windows. But they can also be cross-compiled to run on AppForge's supported devices. The AppForge controls not only include UI widgets but also configurable logic controls such as network connectors and the camera controls. AppForge provides a variety of libraries for accessing device features not available in desktop VB.NET, including support for the native PIM, telephony features and bar code scanners.



4. Code for the application! Crossfire compiles your application to native directly (not IL code). Although there is no runtime Garbage Collection (GC) for Crossfire applications, a Reference Counting (RC) utility is automatically used against all Crossfire applications. So, you can just do the usually Dispose() and do not have to worry about memory management as a C++ developer does.

5. After you are done with the code, it is time for testing! Using VS.NET's build-in debugger, you can run the application as a windows application and debug it line by line. Since there is no device emulator here, the windows application only emulate the screen size and the relative positions of the widgets. In the following screen shot, we can see that the "input mode" on a Symbian phone is emulated in a different panel window; the location of the main menu is not emulated properly (on Symbian devices, the menu is at the lower left corner). The windows app also uses the PIM database in Outlook to emulate device PIM databases when it runs on Windows.



6. After we make sure the application functions properly, we can build a binary for the target platform. In this case, a Symbian SIS package for Nokia Series 60 phones. If you choose a target platform different from the device you specified when creating this project, the AppForge validator might give you warnings about overlapping widgets or other problems.



7. Device applications often require additional meta data for security and identification purposes. You can enter your Symbian application ID or Palm creator ID in the build process.



8. Now you have the sis/prc/exe files to deploy to the target device. But before you do so, you have to install the AppForge Booster to the device. It is a device OS extension that provides support for AppForge widgets and the memory management utility (a native library). The Booster can be bundled into the application itself. But for devices that run several AppForge applications, it is best to install shared Booster library to save space.



9. Now, just copy the application binary over to the device and see it run!

My final thoughts? Well Appforge is certainly a very interesting and very useful tool. It allows VB.NET developers to use their familar language and familar IDE to develop first class mobile smart client applications. But due to the different screens of target devices, you still need to write a separate application for each target device. So, the "cross platform" here mainly refers to "skill transfer" rather than the actual code reuse. I also wish it would support more realstic emulators on Windows. Now, let's compare it with competing technologies:

* Compared with J2ME: AppForge provides better integration with the underlying platform and richer controls. But it is not as portable as J2ME, especially in the smartphone arena. Also, the deployment of AppForge application is more complex than J2ME.

* Compared with the .NET CF: AppForge allows us to develop on more devices. But it does not support C# nor MS smartphones ... The .NET CF is also much better integrated with VS.NET (emulator support etc.) and has a much larger developer communities.

Microsoft Word 2003 & Visio 2003 Updates


Word 2003 Update: KB830000 - Under certain circumstances Word 2003 can become unresponsive when the user saves a file or when Word automatically saves an AutoRecover file. This update corrects that potential error.

View: Microsoft Knowledge Base Article (Can take up to 24hrs for availability)
Download: Word 2003 Update: KB830000 - English | Other Languages

Visio 2003 Update: KB832362 - This update addresses an issue where an insufficient memory error message is generated when trying to print from the Italian language version of Visio 2003.

View: Microsoft Knowledge Base Article
Download: Visio 2003 Update: KB832362

Note: As always Microsoft recommends that you use the Office Update site to determine if your computer requires these updates before installing them.

New Performance & Scalability Guide from Microsoft

The Patterns & Practices team at Microsoft is ready to release a comprehensive Performance & Scalability Guide. This guide collects into one place a huge amount of information and tips covering all aspects of building and running .NET applications. Check out the pre-release at http://workspaces.gotdotnet.com/perfscal.

Multiple IIS Virtual Servers on XP Pro

A great tip that comes directly from Steven M. Cohn's Blog... how to enable multiple IIS Virtual Servers on Windows XP Pro.
The tip is above:

When Microsoft released Windows XP Pro they pushed it as the next development platform, superceding Windows 2000 Workstation. The reality, however, is that it is nothing more than a very slightly enhanced version of Windows XP Home edition. One of the major development features that didn't make it from 2000 to XP was the ability to host multiple virtual Web servers on a single machine. Essentially, Microsoft disabled (hid) the menu item in the IIS Management Console that allows you create a new virtual server.

As a developer who builds and maintains multiple Web sites for friends, collegues, other (non-competitive) companies, this is extremely annoying! Although you can theoretically create a new Web site under a new virtual root (a child path under your default Web server) this presents a big problem: the new Web site would have to be aware of this path offset when referring to itself with absolute or relative paths. The advantage of having a new and independent virtual server is that it only recognizes its own vritual roots and paths.

The Secret

However, there is an alternative, albeit slightly cumbersome. The ability to create multiple virtual servers is only hidden, not stripped out completely.

While you cannot create a new virtual servers through the MMC, you can still use the administrative scripts that come with IIS, specifically, the adsutil.vbs script.

IIS virtual servers are defined in the IIS metabase as numbered entries under the W3SVC key. For example, the default Web site is named W3SVC/1; the second site created would be named W3SVC/2; and so on.

So, to create a second virtual server, open a command window and type:

C:\Inetpub\AdminScripts> adsutil.vbs create_vserv W3SVC/2 C:\Inetpub\AdminScripts> adsutil.vbs copy W3SVC/1 W3SVC/2

The first command creates a new virtual server in the IIS metabase.

The second command copies all the necessary meta data from your default Web site to the new Web site to make it work properly.

Rename It!

When you copy the meta data from an old site to a new site, the new site will inherit all of the old attributes, including the name. So you'll want to immediately rename the new virtual server. Open MMC and find the new entry - they will be listed in the sequence in which they were created (W3SVC/1, W3SVC/2, ....).

You'll also need to change other settings, such as the home directory. I typically like to create a new folder directly under the C:\InetPub folder for each new virtual server.

The Caveat!

When you open the IIS MMC, you'll notice a red icon next to the new virtual server and and error message in the comments column. This is OK. What this means is that inetinfo.exe attempted to start up this second virtual server.

The caveat in this whole thing is that, while you can create multiple virtual Web servers on a single Windows XP Pro machine, you can only run one at a time. Unfortunately, I (and apparently no one else) can find a way to work around this. Even applying a unique port number to each virtual server doesn't seem to work.

Toggling

But it's not so bad... All you have to do is open the IIS MMC, stop the currently running virtual server and start the one you want.

Of course, this means that when you switch between vritual servers, any active sessions on the virtual server you just shutdown will be lost. But the original intention was to be able to develop multiple Web sites, without having to worry about absolute or relative URL paths throughout the source code.

Microsoft ISA Server 2004 Public Beta

Microsoft Corp. today announced that the public beta version of Microsoft® Internet Security and Acceleration (ISA) Server 2004 is available for download. ISA Server 2004 offers advanced application layer firewall, VPN and Web caching features that enable customers to maximize existing IT investments by improving network security and performance. Customers can download the beta version or order CD kits from http://www.microsoft.com/isaserver/.

Customers will find that the beta version of ISA Server 2004 delivers significant improvements in three key areas:
  • Advanced protection. ISA Server 2004 raises the bar on application layer security capabilities through enforcement of comprehensive and flexible policies, and customizable deep-content inspection of protocols and network routing relationships.
  • Ease of use. Simplified management tools and an enhanced user interface make the product easier for security administrators to learn and, ultimately, help customers avoid security breaches that can occur due to firewall misconfiguration.
  • High performance. ISA Server 2004 is designed to provide the highest levels of security and application layer protection -- without sacrificing performance.

Windows Installer ver. 3.0 Beta 2 available

Windows Installer v3.0 (MSI 3.0) is now available for testing on Microsoft's technical beta web community. To access Microsoft Beta, go to http://www.beta.microsoft.com and sign in using your passport account.

When I've some time, I'd like to test it... please share your opinion if you test the product before.

SQL Server Books Online January 2004

The updated documentation for Microsoft SQL Server 2000 is available for download. 

SQL Server Books Online January 2004 Update includes the complete documentation that shipped with SQL Server 2000 plus revisions, and includes the following changes from the original version:

  • Suggestions sent to Microsoft by customers using the feedback button available in every topic of SQL Server 2000 Books Online.
  • Corrections of documentation errors reported after the release of the last update to SQL Server 2000 Books Online.
  • New and updated error messages.
  • Additions to the SQL Server 2000 Books Online for SQL Server 2000 SP3 functionality.

Ten More Ways To Make Windows XP Run Even Better

In the original "Ten Ways To Make Windows XP Run Better", Fred Langa covered many fundamental tweaks and adjustments that can help you to move XP out of its bland and sometimes limiting default settings and into a configuration that better fits your own personal needs, preferences, and work style. Fred Langa now examines free add-ons and utilities that further refine and improve your operating system. Check it...

A new virus via email...

A new computer virus named Novarg spread quickly around the Internet Monday, infecting thousands of computers worldwide.

The virus caused so much excess e-mail traffic that it managed to degrade the Internet's performance, according to Web traffic measurement firm Keynote Systems Inc.

Novarg is effective because it arrives posing as a harmless text file. It often claims to be from a colleague or friend and offers the believable explanation that the original message had to be translated into a plain-text file for delivery. The attachment often displays the notepad icon. The message body often reads: "The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment."

Be careful and make attention!

.NET Bugs Registry

An interesting idea of Dejan Jelovic. This page represents a registry of known .NET bugs. You can use it to see if the strange thing you are seeing is a known bug, or to report a new bug that you just found.

Known .NET Bugs

ID Description Probability* Severity* Fixed
1

Form refuses to close
If a form A contains control B that contains control C that contains control D, and D is removed while it has the focus, the user won't be able to close the form. Details.

High High 1.1
2 SoapFormatter and BinaryFormatter don't serialize some object graphs properly
If three or more classes have the same name but are in different namespaces, are part of the same hierarchy, and contain variables that have the same name, they will not be serialized properly. Details.
Low High 1.1
3 Text in the Windows Forms combo box cannot be selected using the mouse
Mouse selection simply does not work in a Windows Forms combo box. Details.
High Low 1.1
4 Arrays of structures that implement ISerializable do not deserialize correctly
Details.
High High 1.1
5

Windows.Identity doesn't work under Windows 98
On Windows 98, You cannot use the Windows.Identity to retrieve the user login name, it returns a system level token and a null user name is returned when you access the .Name Property. Details.

Low Medium No
6

C# optimizer produces bad code when a try-finally block is inside if-else
If a try-finally block is the last thing inside the if block of an if-else statement, the code inside the else block is always executed when compiling in Release mode. Details.

High High 1.1
7

Structs within structs cannot be deserialized
If you have a struct A inside struct B, and If a struct A is inside struct B which is inside object C, deserializing is going to throw a SerializationException.  Details.

Medium Low 1.1
8

Problems removing an ActiveX control from its parent
If an ActiveX control is removed from its parent, any action that makes the parent invisible, such as closing the form on which it is on, throws an exception.  Details.

Medium High 1.1
9

Font.GdiCharSet hardcoded to 1
The property GdiCharSet of the font class is hard-coded to 1.  Details.

Low Low No
10

.NET Runtime leaks large chunks of memory
If you allocate a block of memory larger than some treshold, the .NET garbage collector will never reclaim it. Details.

High High 1.1
11

Instances of NumericUpDown and DomainUpDown are leaked
It seems that the NumericUpDown and DomainUpDown controls forget to remove a listener to a global event, thus always staying locked in memory. Details.

High High No
12

SoapFormatter chokes on some strings
It seems SoapFormatter cannot handle strings that contain characters in the range 0x01 - 0x1f. Details.

Update 
SOAP being XML based can't handle many characters in the 0x00 - 0x1f range because they are illegeal in the XML spec.

High High

No

Not a bug

13

FileStream becomes unusable when writing to a removable drive
When writing to a FileStream on a removable drive, and the FileStream gets out of space, it sometimes gets in a state where no other method can be called on the stream, not even Dispose. Details.

Medium Medium No
14

Mixed-mode assemblies can deadlock
C++ .NET apps can deadlock on startup. Details.

Low High No
15

ComboBox Data Binding Bug
ComboBox doesn't update the data through data binding when its style is set to DropDownList. Details.

Medium Medium No
16

Each Windows Form leaks two GDI handles
Details.

High High No
17

Alocation fails for certain sizes
If you try to allocate an array with a size range between 0x027fefbd and 0x027fffec, the framework throws exceptions. This range corresponds to memory block of little under 40MB. Details.

Medium High No
18

No way to access Environment.HasShutDownStarted
This property is not static even though it should be.

Low Low 1.1
19

Thread.Abort cannot abort suspended threads
If a thread is suspended, trying to abort will not work and the CPU will be pegged to 100 percent. Details.

Low High No
20

Control.Width and Height are silently truncated to 32,767
If you attempt to set a control's Width or Height property to a number larger than 32,767 it will be truncated. Details.

Low Low No
21

ListView.Cursor set property has no effect.
Details.

Low Low No
22

RegistryKey.SetValue does not store large integers as DWORD
Call RegistryKey.SetValue with an integer over 2,147,483,647 will result in the value being stored as string, and not as a DWORD. Details.

Low Medium No

* Probability represents the probability that you will encounter this bug. Severity measures how much the bug hurts when it happens.

Do you know other bugs?