Sunday, May 20, 2007

My first smart phone application in visual studio 2005

What Is a Smartphone?

The worldwide mobile wireless industry is quickly moving from traditional, voice-based cellular phone services to combined voice and data services, as a result of increasing demand for mobile data access and the deployment of high-speed wireless data services utilizing a variety of wireless technologies.

Microsoft Smartphone refers to Microsoft’s platform for next-generation cell phones—basically a software architecture with Windows CE as the operating system, plus a rich set of applications such as Pocket Internet Explorer and Pocket Outlook and powerful software development tools such as .NET Compact Framework and Visual Studio 2005.




Visual Studio 2005 is the major multi-language IDE (Integrated Development Environment) for Windows applications. Both managed and unmanaged code of Windows desktop applications can be developed using Visual Studio 2005. It allows managed and unmanaged Pocket PC and Smartphone application programming targeting Windows Mobile devices. With the .NET Framework on their target systems or devices, developers can use a single set of .NET Framework classes in different languages,
with the same naming and calling convention, and similar syntax. In particular, mobile application developers can leverage their experience and programming techniques obtained from smart client application development with Visual Studio 2005, and the only difference is the class libraries: They will work with a subset of the desktop .NET Framework class libraries. Visual Studio 2005 (and the previous version,Visual Studio .NET) is the key element for rapid and high-performance .NET application development,testing, and deployment over various systems and devices.

.NET Compact Framework Type System
.NET languages such as Visual C# and Visual Basic are based on the same type system as the .NET Compact Framework and use the same class library. Thus, developers familiar with one .NET language (and therefore the .NET Compact Framework type system) can easily move to another .NET language.Every class in the .NET Compact Framework, including those with built-in value types, is directly or indirectly inherited from the System.Object class. Only single inheritance is allowed in the .NET Framework and .NET Compact Framework; a class cannot have more than one base classes. Any userdefined classes are inherited from the System.Object class if no base class is explicitly specified.

Windows Mobile 5.0 SDK for Smartphone
The Windows Mobile 5.0 SDK for Smartphone includes the Smartphone emulators (which are also in Visual Studio 2005), some command-lines tools, help files, header files, and libraries for native code development.
You can download the SDK from www.microsoft.com/downloads/
details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&displaylang=en.

ActiveSync
You need to have Microsoft ActiveSync to connect your Smartphone device to your Windows PC.ActiveSync acts as the gateway between your PC and your Windows Mobile device so that you can easily transfer files or synchronize application data such as e-mail, a calendar, and so on. For Smartphone development, ActiveSync is needed by Visual Studio to transfer data between the development PC and the device or the emulator. You can download ActiveSync from www.microsoft.com/windows
mobile/activesync/default.mspx.

Types
There are two kinds of objects in the .NET Compact Framework: built-in value types and reference types. A value type is a primitive data type that holds only values. They are actually structures allocated on the stack. Reference types are instances of classes and must be created using the new keyword.

Generics
The .NET Compact Framework 2.0 and later support parametric polymorphism using generics.

To create an instance of a generic Stack object that holds a MyObj type in C#, you can do the following:
System.Collections.Generic.Stack myObj = new
System.Collections.Generic.Stack ();

Exception Handling
Exceptions are runtime errors that need to be handled to avoid program crashes. The .NET Framework and the .NET Compact Framework provide a built-in mechanism to handle exceptions using the wellknown



try.
{

}
catch
{
}

finally
{
}


Visual Studio 2005 will put your project into a solution, which is simply a collection of projects, one of which is designated as the “Startup” project. The Form Designer shows an image of a conceptual Smartphone with Form1
loaded into its screen. The form appears to be empty; no controls have been placed onto it. However, there is already a control named “mainMenu1” at the bottom of the form. Usually, all forms in Smartphone applications should have a Main Menu control for soft keys immediately under the screen of a Smartphone.The automatically generated project now has only two files: Form1.cs and Program.cs. Form1.cs is the
GUI interface with which a Smartphone user will interact, whereas Program.cs is the place where the.NET Compact Framework will find the main entry point and load the application.


here are my screen shots of my fist application written for smart phone





No comments: