Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 19 Microsoft’s Approach 1 –.NET Mobile Framework part 2 Rob.

Slides:



Advertisements
Similar presentations
How to Build Multi- threaded Applications in.NET Mazen S. Alzogbi Technology Specialist Microsoft Corporation.
Advertisements

Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Chapter 14 Multithreading Yingcai Xiao. Multithreading is a mechanism for performing two or more tasks concurrently.  In the managed world of the common.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
J2ME Prepared by: - Gaery- Ronny - Alan- Andy. Why Technology for Mobile Devices? The nature of wireless devices is changing Old devices: All the software.
Cosc 4755 Phone programming: GUI Concepts & Threads.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
C# Programming: From Problem Analysis to Program Design1 Introduction to Windows Programming C# Programming: From Problem Analysis to Program Design 3.
Event Notification Pattern Dr. Neal CIS 480. Event Notification Pattern When a class abc has something happening that class xyz needs to know about you.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 20 Microsoft’s Approach 3 – C# Rob Pooley
Chapter 2 –Visual Basic, Controls, and Events
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 18 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
Access Tutorial 10 Automating Tasks with Macros
Getting Started Example ICS2O curriculum
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Neal Stublen Practice Solution  Create a new solution  Add a WinForms project  Add a Class Library project  Reference the library.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
A Bridge to Your First Computer Science Course Prof. H.E. Dunsmore Concurrent Programming Threads Synchronization.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Lecture 2 Event driven programming Mobile and Handheld Applications1 Programming of Handheld and Mobile Devices Lecture 2: Event driven programming concepts.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Overview of Threading with the.NET Framework  Wallace B. McClure  Scalable Development, Inc. Scalable Development, Inc. Building systems today that perform.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 17 Microsoft’s Approach 1 –.NET Mobile Framework Rob Pooley.
1 Chapter Eleven Handling Events. 2 Objectives Learn about delegates How to create composed delegates How to handle events How to use the built-in EventHandler.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Concurrent Programming and Threads Threads Blocking a User Interface.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Programming of Handheld and Mobile Devices Lecture 2 What is a MID? Rob Pooley
Using Threads SWE 344 Internet Protocols & Client Server Programming.
Introduction to Threads Session 01 Java Simplified / Session 14 / 2 of 28 Objectives Define a thread Define multithreading List benefits of multithreading.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 18 Microsoft’s Approach 1 –.NET Mobile Framework part 2 Rob.
© Paradigm Publishing, Inc. 4-1 Chapter 4 System Software Chapter 4 System Software.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Module 4: Creating a Web Application with Web Forms
.NET Mobile Application Development XML Web Services.
CIS NET Applications1 Chapter 8 – Multithreading and Concurrency Management.
Exploring Mobile Device Networking Lesson 4. Exam Objective Matrix Skills/ConceptsMTA Exam Objectives Understanding Networking for Mobile Devices Network.
 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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Lecture 6 Threads Erick Pranata
Visual Basic .NET BASICS
Computing with C# and the .NET Framework
Chapter 1: An Introduction to Visual Basic 2015
Looking at our “Getting Started” application
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter Eleven Handling Events.
Reference: COS240 Syllabus
9. Threads SE2811 Software Component Design
Visual C# - GUI and controls - 1
Visual Programming COMP-315
9. Threads SE2811 Software Component Design
Visual Programming COMP-315
.Net Framework: A Survey of Important Libraries
Presentation transcript:

Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 19 Microsoft’s Approach 1 –.NET Mobile Framework part 2 Rob Pooley

Programming Handheld and Mobile devices 2 Simple C# examples for.NET Class Form1 { static void Main() { Application.Run(new Form1()); } private void menuItem2_Click(object sender, System.EventArgs e) { Application.Exit(); }

Programming Handheld and Mobile devices 3 A second form MyNewForm mynewformForm = new MyNewForm (); mynewformForm.ShowDialog();

Programming Handheld and Mobile devices 4 Passing Values to Controls in Other Forms Let's demonstrate setting a control's value by altering a text label. The sequence of events is: 1.Create a new instance of the Form that contains the control (but don't display it). 2.Change the property corresponding to the text label of the control. 3.Display the Form. Assume we have added a text label called label1 to the new Form, and we can do all that with some code like this: MyNewForm mynewformForm = new MyNewForm(); mynewformForm.label1.Text = "Hello World"; mynewformForm.ShowDialog(); The only thing to remember is that the label1 property, by default, will be private so the code for the main Form won't be able to see it. You get around this by setting it to Public

Programming Handheld and Mobile devices 5 What you see Note The size of the Form is not important as the Pocket PC will always expand it to fill the screen.

Programming Handheld and Mobile devices 6 Adding a button If you are creating a new Form that acts as a dialog box, you should also add some way for the user to close it, such as a new button with code like the following attached: private void button1_Click(object sender, System.EventArgs e) { this.Close(); } The new Form will have a close button in the top right for the user to click

Programming Handheld and Mobile devices 7

8 Adding tabs tabs provide access to multiple pages all stored on one dialog. These can be very useful if your application has a lot of settings for the user to work through. Use the TabPage Collection to add and rename new tab pages. Each page is a like a blank form to which you add controls. Treat each tab page as a Form, and place the controls on it as you see fit. The Pocket PC will look after displaying the pages and controls

Programming Handheld and Mobile devices 9 Namespaces supported in.NET Framework and.NET Compact Framework

Programming Handheld and Mobile devices 10 Windows Forms All the common features Windows Forms in the.NET Framework are present in.NET Compact Framework. These features are differently implemented in a separate manner to make them more efficient for size and performance. Supported are: Common controls such as: –Buttons –Listboxes –Tree-views –Listviews –Combo boxes –Textboxes –Picture boxes –Scroll bars –Labels Bitmaps Pens Brushes Colors Drawing Fonts Support for Forms

Programming Handheld and Mobile devices 11 Networking with TCP etc. The System.Net.Sockets namespace is used to provide an interface to access the transport layer of protocol stacks. Multiple protocols can be exposed through this class. In addition,.NET Compact Framework provides additional classes that simplify common developer tasks encapsulating much of the necessary code that is common across all TCP client/server applications. Some of these are: –TCPListener –TCPClient –UDPClient

Programming Handheld and Mobile devices 12 HTTP HttpWebRequest and HttpWebResponse classes provide a rich HTTP client. These classes also support many of the standard mechanisms for encryption and authentication such as SSL/TLS and basic HTTP authentication. Other Web requests can be implemented using other protocols such as: –WebRequest interface –WebResponse interface –IwebRequestCreate interface

Programming Handheld and Mobile devices 13 System.Threading Namespace The System.Threading namespace provides classes and interfaces that enable multithreaded programming. In addition to classes for synchronizing thread activities and access to data (Mutex, Monitor, Interlocked, AutoResetEvent, and so on), this namespace includes aMutexMonitorInterlocked AutoResetEvent –ThreadPool class that allows you to use a pool of system-supplied threads, and aThreadPool –Timer class that executes callback methods on thread pool threads.Timer

Programming Handheld and Mobile devices 14 Threading using System; using System.Threading; // Simple threading scenario: Start a static method running // on a second thread. public class ThreadExample { // The ThreadProc method is called when the thread starts. // It loops ten times, writing to the console and yielding // the rest of its time slice each time, and then ends. public static void ThreadProc() { for (int i = 0; i < 10; i++) { Console.WriteLine("ThreadProc: {0}", i); // Yield the rest of the time slice. Thread.Sleep(0); } public static void Main() { Console.WriteLine("Main thread: Start a second thread."); // The constructor for the Thread class requires a ThreadStart // delegate that represents the method to be executed on the // thread. C# simplifies the creation of this delegate. Thread t = new Thread(new ThreadStart(ThreadProc)); // Start ThreadProc. On uniprocessor, thread does not get // any processor time until the main thread yields. //Uncomment // Thread.Sleep that follows t.Start() to see the difference. t.Start(); //Thread.Sleep(0); for (int i = 0; i < 4; i++) { Console.WriteLine("Main thread: Do some work."); Thread.Sleep(0); } Console.WriteLine("Main thread: Call Join(), to wait until ThreadProc ends."); t.Join(); Console.WriteLine("Main thread: ThreadProc.Join has returned. Press Enter to end program."); Console.ReadLine(); }

Programming Handheld and Mobile devices 15.NET vs J2ME vs Palm OS Problems –Palm OS is the most cumbersome to program –Palm OS uses C/C++ –Palm OS and.NET Compact are both specific to certain kinds of device –J2ME requires a JVM (KVM or CVM) –J2ME is not really compatible with J2SE Benefits –Palm OS is available for many PDAs –J2ME is the most portable –J2ME has wireless features as standard –J2ME uses Java –.NET is higher level –.NET supports XML –.NET supports several languages