Sunday, January 11, 2009

Running Windows 7 Beta in Virtual PC 2007

After taking more than 12 hours (yes, I subscribed a low cost package from ISP) to download the Windows 7 Beta ISO (see my previous post), finally i can play around with it. Installing it on my existing OS will be too risky, thus Virtual PC comes to my mind.

As rumour says, I tried it using a guest OS as Windows Vista and it works. Say not more and let's see some steps and screenshots.

1) After creating a new vmc & vhc files, capture the ISO downloaded. You can follow tutorial here. The setup will be started. When it asks for guest OS, choose Windows Vista.

2) You might need to adjust the RAM for installation to run smoothly.

3) Now, you see it is loading files and starting Windows.


4) Choose the language to install, ..., etc.




5) And Windows 7 Beta is installed successfully.

6) ScreenSaver cannot be loaded for Virtual PC with standard VGA virtualized.

7) Some basic themes for customization. I see it as a competition with wincustomize.

8) MS Paint get a Ribbon-look.

9) Our "Show Desktop" now resides on bottom-right.

10) And we can try the Internet Explorer 8 Beta as well.

Saturday, January 10, 2009

Mixed fortune for Mobile OSes

This week is a week with full emotion, for OS developers. For UIQ lover, they saw UIQ finally filed bankruptcy. While Palm OS lovers, Palm makes a comeback at CES.


UIQ:
Quoted from theregister:

"Motorola had 11 UIQ phones (or variants) planned for release next year, and now all have been cancelled in the most recent company reorganisation."

Sure Nokia purchase of Symbian was not a simple business move.
I wonder what will happen to MotoDev Studio for UIQ, an integrated development environment based on the Eclipse IDE, and Sony Ecrisson's Symbian OS Docs & Tools. They could be phased out soon and extinct anytime. Will Sony Ericsson & Motorola embrace Windows Mobile OS fully since the only Symbian OS is now totally owns by another competitor (a.k.a. Nokia), like Samsung?


Palm:
With new OS("WebOS"), new handset ("Palm pre") introduction at CES, it revives the hope of Palm Inc. to gain the market once they dominant, and it tries to woo more developer to it:

"It was built with developers in mind,"

and:

"The entire UI is based on a "desktop + cards" paradigm, where "cards" replace "windows" or even "apps." You start with a display area that contains a blank desktop and an iPhone-style dock at the bottom."

And more news of Palm at CES is covered by engadget:

Windows 7 Beta is out

So fast, Microsoft released Windows Vista 2 years ago, now we have another new Windows OS release, a.k.a Windows 7, in beta form to public. You can get it here:
a) Windows 7 Beta 32-bit (downloading)
b) Windows 7 Beta 64-bit (not yet tested)
For more information, you can visit this site.

This site have offered various tips to let you play around with it.

#p/s: For Windows developer, the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1: BETA, or the so called Platform SDK v7.0, is released as well.

Thursday, December 18, 2008

Carbide C++ IDE is free, even for Professional Edition

Yes, you are not wrong. Under the stiff competition from Apple's iPhone & Microsoft Windows Mobile 6.1, Nokia decides to release their native app builder, Carbide C++ IDE for free, for OEM, Professional & Developer Edition (seems there's no need for Expression Edition anymore).

New features added on this versions are:
  • Sensor APIs allow applications to connect to and receive data from various sensors on an S60 device.
  • Tactile Feedback Client API is used for producing tactile feedback for different touch events.
  • Touch UI Utilities API provides a mechanism to detect long-tap events on the touch screen.
  • Title Pane Touch Observer API allows an application to observe the user tapping on the title pane.
Here's some simple steps for settings up the development environment:
1) Get the Carbide C++ IDE version 2.0 & Nokia S60 5th SDK.

2) Install the S60 5th SDK first by extracting the zip & running the setup.exe.

3) Here's the content of the installation package if customized installation. Choose the one that meet you needs.

4) Point the Eclipse installation path for plug in if you want integration with it.

5) After S60 5th SDK installed, you can start installing Carbide C++ IDE version 2.0, and this is the Welcome screen.

6) And yes, this screen telling you it's free for all editions!

7) You can either choose OEM, Professional or Developer Edition here. I wonder who will need Developer Ed. when you have at least Professional Ed. Save disk space?


8) After Carbide C++ IDE installed, you can start it from "Start" menu and you will be welcomed with splash screen.

9) Carbide IDE is based on Eclipse, so those Eclipse user should familiar with it. You can either choose "Workbench", "Tutorials", .... Here're tutorials available.



10) Go back "Workbench", and you can start coding. Choose "New" from "File" menu. Here're the available templates. Take note on "S60 GUI Application with UI Designer". This feature is not available when i played around with Expression Edition 2~3 years ago. How envy i was last time for this feature of Rapid Application Development (RAD).

11) "UI Design Selection" for type of app.

12) Screenshot of Form Designer & Toolbox (in Visual Studio term)

13) After you build the project (yes, even without adding any feature, it's runnable with basic skeleton), a desktop emulator version of exe will be built.

14) Epoc will be trigger if you run or debug, and here's the simple application from S60 GUI application.

Online library get be reached here.

#p/s: Microsoft has launched a new project, for running apps in Apple's iPhone, named SeaDragon. The future of computing is on mobile!

Sunday, December 14, 2008

Application.StartupPath != Environment.CurrentDirectory

When developing the .NET app, you are not only creating an .exe. Most of the time, you will need some other files like .bmp, App.Config, and .xml. For those resource files(data or images), you could simply embed into the main exe and access it class "ResourceManager", though it might increase the size tremendously. But what if for those XML file that need user customization? You might put them along with your main executable file during deployment, for initialization. Thus you will need to find where your .exe starts, and to read XML file that relative to it. So now you might think you got at least two choices, "Environment.CurrentDirectory" & "Application.StartupPath".

From the MSDN, the definition of:
a) Environment.CurrentDirectory
Gets or sets the fully qualified path of the current working directory.
b) Application.StartupPath
Gets the path for the executable file that started the application, not including the executable name.

They look similar & match your purpose. "Environment.CurrentDirectory" looks good, especially it is located inside "System" namespace, so you no need to add any reference; while "Application.StartupPath" needs to add reference to assembly "System.Windows.Forms". You might think the former one is better for console application, and even windows service! Windows service does not need any GUI and would suppress any messagebox from pop-up. So using "Environment.CurrentDirectory" seems a good choice to prevent the developers simply calling messagebox in windows service if without adding reference to assembly "System.Windows.Forms", from design perspective.

So I decided to use "Environment.CurrentDirectory" for my dll, which is eventually called by the windows service, and the code to load the XML file would be similar to this:

Dim strXMLFile As String = Environment.CurrentDirectory & "\" & INITIALIZATION_XML
If Not File.Exists(strXMLFile) Then
Throw New FileNotFoundException("The initialization file " & INITIALIZATION_XML & " does not exist.")
End If
I created a WinForm for test harness of the dll, and everything was fine. Then this dll consumed by the windows services. Bang! I get an "FileNotFoundException" exception. I use Debug.Print to find that my XML look-up path was at: "C:\WINDOWS\system32"???

Why? It's because Windows service applications run in their own security context.
and more definition for "Environment.CurrentDirectory":

Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts.

Using the Reflector:
a) Environment.CurrentDirectory

b) Application.StartupPath


So, the "Environment.CurrentDirectory" is equivalent to "Application.StartupPath" when running as WinForm/console app and will become variable "%SystemDirectory%" eventually if run under windows service! A lesson learned.

p/s: You could use reflection from class Assembly as well, to find the start-up path.