Wednesday, April 2, 2008

starting and editing a smart phone application

This session will enable to start a smart phone application on Visual basic platform.
shortcut for getting visual basic environment:
Windows> Run> devenv
This is applicable only for the systems that are at the company and might differ for depending upon the VS package available in the systems.
Once the start page is displayed, go to:
File> New>Project. (short cut for the same Ctrl+Shift+N)
A subwindow appears on the screen which has "Project types" on the left and "Templates" on the right.
Project types:
click on the visual c++ button. This drags down ATL, CLR, General,MFC, Smart Devices.
Click on Smart Devices.
Choose the Win32 smart device project template on the right side.
Enter the location at which the project needs to be stored in the 2nd bottom line of the menu.
Give a name to the project prior to its editing and press OK. Lets put the name "First"
A creation Wizard will guide you for the rest of the process.
Choose the application in which the programme is to be executed. The present ones in the system are Smarphone and Pocket Pc both belonging to 2003 version.
Then the wizard asks for the application type. Be it a library,DLL,Windows application.
For our example we will take Windows application. Click Finish once it is selected.

The environment will be loaded with the source that has been created by us.

In order to run this dummy programme in an emulator, first the programme needs to be built.
Right click on " First" displayed at the left top side of the solution explorer. Click on Build.
Once there are no errors and the system shows success on the bottom running line, click on
Debug> start without debugging>
The emulator which exactly resembles the smart device appears on the screen. Since we have not entered or altered anything in the application, a blank screen appears on the phone with two options OK and HELP.
Clicking on OK will take the menu out of the blank screen. Click on the File shown on the emulator window.
Golden Rule: ALWAYS EXIT THE EMULATOR WITHOUT SAVING ANY CHANGES.
Any changes saved onto the emulator will remain on it the next time it is used which means any bugs on the code will be entered into the emulator.
The emulator needs to be closed inorder to again re run the code on it.
The files for the project will be given as source files, header files, resource files. Exploring into these files lets u change/ delete/edit anything that comes on the blank screen.

Exercise: try to change the About me that comes on the Help screen of emulator into your name or anything that suits u.

No comments: