Mobile Development Introduction to Visual Studio Development Rob Miles Department of Computer Science.

Slides:



Advertisements
Similar presentations
Privacy Settings How to complete your Privacy section.
Advertisements

JustinMind: Dynamic Panels
Information System Design Lab 5&6. User Interface Design.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Creating Web Page Forms
Creating a MagicInfo Pro Screen Template
Chapter 8: String Manipulation
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Installing the SAFARIODBC.EXE For use with Excel May 3, 2002.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Microsoft Visual Basic 2005 CHAPTER 5 Mobile Applications Using Decision Structures.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
Version How to Use Packet Tracer MarinaMD.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Chapter Two Creating a First Project in Visual Basic.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 4 Designing the Inventory Application Introducing TextBox es and Button s.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Motion Graphics & Animation.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Microsoft Visual Basic 2012 CHAPTER FIVE Decision Structures.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
21/03/ Working with Controls Text and List Boxes.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 1: An Introduction to Visual Basic 2015
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Multi-host Internet Access Portal (MIAP) Enhancement Guide
Chapter 2 – Introduction to the Visual Studio .NET IDE
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

Mobile Development Introduction to Visual Studio Development Rob Miles Department of Computer Science

Introduction  The “Secret Encoder” Program >Encodes text entered, based on a simple keyword  Will allow us to explore the issues of mobile development >User Input >Output Display >Use of the Menu Buttons >Program termination

Encoder Program  Screen contains three areas: >Encryption key entry >Secret message entry >Output display entry  When the code button is pressed the key is applied to the message to produce the result  The encryption is performed using XOR, so that it is reversible Key: mykeytext In: password Out: xwbqegg231 Code

Starting Development  Initially I am going to write the program for a Smartphone  Then we will convert the code over and build a Pocket PC version  You will see that the conversion is not difficult and centres around the user interface  Finally we can use the encoder in a workspace that targets both devices

Encoder Project  First we have to add the data entry components for the program  The Visual Studio Toolbox holds only the components which are available for the Smartphone display  We are going to use Label and TextBox components

Encoder Form  I have added four Label and two TextBox components onto the form  They have been given sensible names and aligned correctly

Test Layout  When the program runs the layout is somewhat different  This is a limitation of Visual Studio 2003  Visual Studio 2005 gives a full preview

Field Traversal  The Smartphone application begins running with the most recently added TextBox selected first  Moving “forwards” through the fields actually moves towards the “oldest” TextBox  This is not what the user will want  You should add the lowest TextBox first >Or make use of the tool to change the field order

Smartphone Tab Order  The Smartphone Tab order dialogue, selected from the View menu allows you to re-arrange the tab order of the fields on the form

Correct Tabs  The order on the right is the one required  Note that although the labels are not selected by the tab operation, they appear on the order dialogue

Data Entry  The present program will run, and the user can move between the two entry boxes and type text into either  We now need a way of triggering the encode action

Adding Menu Keys  Not all forms may have menu keys  You can edit them by selecting the MainMenu item at the bottom of the form designer

Menu Keys  Once you have added the keys to the form you can type menu selections onto them by clicking on the “Type Here” item

Adding the Encode Selection  The Encode selection can be added by typing the option name over the button  Note that I have the option to type above the selection to create multi-option menus

Smartphone Menu  The menu key is displayed as shown  We now need to bind an event to the key press to perform our encode action

Binding to Menu Actions  It is very easy to bind to a key event  In the form designer, double click on the menu item  If there is no event hander for that item, one is created and you are taken to it in the source file

Encode Action  I have created a method to perform the encode action  I could have placed this code inside the event hander itself, but it is more flexible to create a method to do the job: private void doEncode () { outputTextLabel.Text = encode ( inTextBox.Text, keyTextBox.Text ) ; }  This calls an encode method which actually performs the translation of the text itself

Testing the program  The initial version of the encode method simply returns the original text  This allows me to test the program and ensure that it works correctly

The Encode method private string encode ( string input, string key ) { char [] keyChars = key.ToCharArray(); int keypos = 0 ; System.Text.StringBuilder result = new System.Text.StringBuilder(); foreach ( char ch in input ) { int cval = ch - 32; int pval = keyChars[keypos] - 32; result.Append((char)((cval ^ pval) + 32)); keypos++; if ( keypos == key.Length ) keypos = 0 ; } return result.ToString() ; }

Secret Encoder  The encryption works, but it is a very weak method  Note that the space in the input reveals the key character at that position  I leave it to you to create a better one!

Exiting the program  At the moment there is no way to exit the program on the Smartphone device  We can stop it with Visual Studio, but the user will not be able to do that  It is very easy to add an exit menu option

Stopping an Application  We can use the standard application termination method to stop the program: private void menuItem2_Click(object sender, System.EventArgs e) { Application.Exit(); }  This frees off any resources and exits the program cleanly  Note that the Windows CE guidelines aren’t keen on you stopping your programs (but I do it anyway)

TextBox Key Entry  You may wish to not show the password when you are using the program  As with standard Windows Forms, the TextBox component can be set to allow password entry

Debugging  The program can be debugged in exactly the same manner as any other Visual Studio application  Any exceptions which are thrown are trapped and you are given the option to debug

Running on the PC  The application will run on a standard PC  Note how the behaviour of the menu has been adapted for a Windows Form  It is often useful to be able to run programs on a PC to test them >Particularly if they make use of file input/output

Labels and Bugs  There is a bug in this program; some characters are interpreted by the label display component as controls for access keys (even though these have no meaning for Samrtphone!)  The key of “cheese” gives the output as shown

TextBox Replacement  Using a TextBox set to read only allows the correct text to be displayed  The read only property of the text box is used to prevent the user changing it

Pocket PC Version  The Pocket PC version is very similar  Just about all of the Smartphone code can be transferred directly over to Pocket PC  The only issue is that of user input using buttons

Sample Project 01 Smartphone Encoder  If you run the program you will find that you can enter and encode text using a key that you supply  If the encoded text is entered it is converted back into the original

Sample Project 02 Pocket PC Encoder  The Pocket PC version is virtually identical to the Smartphone one  The only change is the use of a button to receive the encode command

Developing the Application  You may wish to further develop this application  Suggested enhancements include >Improved encoding method >Separate encode/decode methods (perhaps using public and private keys)

Sample Project 03  This project combines a Smartphone and a Pocket PC version of the encoder in a single Visual Studio workspace  They all share the same encoder behaviour  Note the references to the Encoder resource

More Mobile Fun  If you want to make use of remote resources you should take a look at Web Services  A sample web service is based at MoreThanOneCanPlay.com  Details are on the delegate CD