Cell Phone Applications and Web Services - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

Cell Phone Applications and Web Services

Description:

With Visual Studio 2005 open, click the New Project button on the Standard ... Click the ellipsis button to the right of the Items property. ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 38
Provided by: steve1754
Category:

less

Transcript and Presenter's Notes

Title: Cell Phone Applications and Web Services


1
CHAPTER 12
  • Cell Phone Applications and Web Services

2
Objectives
  • Create a Smartphone application
  • Use a cell phone keypad for input
  • Enter input using a Smartphone
  • Enter other characters using the keypad
  • Add Smartphone Toolbox objects

3
Objectives
  • Create a softkey menu
  • Code the Smartphone application
  • Display MessageBox objects in a Smartphone
    environment
  • Find Web services

4
Objectives
  • Create a Web service connection
  • Call a Web service method
  • Create a Crystal report
  • Display a Crystal report

5
Introduction
6
Creating a Smartphone Application
  • With Visual Studio 2005 open, click the New
    Project button on the Standard toolbar, click
    Smart Device in the Project types pane on the
    left side of the New Project dialog box, and
    then, if necessary, click the plus sign next to
    Smart Device
  • Click Smartphone 2003 under Smart Device in the
    Project types list. In the Templates pane, click
    Device Application (1.0)
  • In the Name text box, change the name of the
    Smart Device application from DeviceApplication1
    to TipCalculator. Click the OK button

7
Creating a Smartphone Application
8
Entering Input Using a Smartphone
  • With the TipCalculator application open, name the
    Form object frmTip.vb. Title the Form object by
    changing the Text property to Tip Calculator. Add
    a Label object to the form named lblBillAmount.
    Change the Text property of the Label object to
    Amount of Bill. Drag a TextBox object under the
    Label object. Name the TextBox object txtBill.
    Clear the Text property. Resize the Label object
    to fit the text exactly. Center the Label and
    TextBox objects horizontally on the form
  • Run the Smartphone application by clicking the
    Start Debugging button on the Standard toolbar
  • Make sure Smartphone 2003 SE Emulator is
    selected, and then click the Deploy button
  • To enter the bill amount of 75.22, press the 7
    key on the keypad five times quickly. The letter
    p appears first, then the letter q, then the
    letter r, then the letter s, and lastly the
    number 7. Next, press the 5 key on the keypad
    four times quickly to enter the number 5

9
Entering Input Using a Smartphone
  • To enter the decimal point, hold the key in the
    lower-right corner of the keypad until the
    Symbols window opens
  • To enter the decimal point, press the navigation
    keys, such as the right ARROW KEY and DOWN ARROW
    key, to move to the decimal point (period) in the
    Symbols window. To select the decimal point,
    press the Action key in the center of the
    navigation keys. Enter the digits 22 by first
    pressing the 2 key four times quickly. Wait a few
    seconds and press the 2 key four times quickly
    again to display the second 2
  • To close the application, click the Close button
    in the upper-right corner of the program window
  • Click the No button, and then click the OK button

10
Entering Input Using a Smartphone
11
Adding Smartphone Toolbox Objects
  • If necessary, open the TipCalculator application,
    which includes the first Label and TextBox object
    on the form. Drag a second Label object named
    lblPercentage to the form below the TextBox
    object. Change the Text property to Tip
    Percentage. Drag the ComboBox object to the Form
    object below the second label. Name the ComboBox
    object cboTipPercent. Click the ellipsis button
    to the right of the Items property. Enter the
    three tip percentage amounts into the String
    Collection Editor 10 (press ENTER), 15 (press
    ENTER), and 20. Resize the objects to the exact
    size of the text. Center both the Label and
    ComboBox objects on the center of the form

12
Adding Smartphone Toolbox Objects
  • Run the Smartphone application by clicking the
    Start Debugging button on the Standard toolbar.
    In the Deploy TipCalculator window, make sure the
    Smartphone 2003 SE Emulator option is selected,
    and then click the Deploy button. When the
    Smartphone emulator opens and loads the
    application, enter 75.22 in the first TextBox
    object using the keypad. To move to the ComboBox
    object for input, click the down arrow key on the
    navigation keypad. To view the ComboBox items,
    click the right arrow on the navigation keypad
    10 is displayed in the ComboBox object. Click
    the right arrow again to view 15. Select the 15
    tip percentage by clicking the Action button in
    the center of the navigation keypad. Close the
    Smartphone emulator without saving the emulator
    state

13
Adding Smartphone Toolbox Objects
14
Creating a Softkey Menu
  • On the frmTip Form object of the TipCalculator
    application, click the left side of the Command
    control area
  • Type Compute Tip in the Command control area.
    Press ENTER. Use the (Name) property to name the
    Command control area mnuComputeTip

15
Coding the Smartphone Application
  • In the TipCalculator application, double-click
    the mnuComputeTip Command control area in the
    lower-left corner of the Smartphone Form object
  • Enter the code shown on the following slide to
    compute the tip for the restaurant bill amount

16
Coding the Smartphone Application
17
Program Design
18
Program Design
19
Designing the Program Processing Objects
20
Finding Web Services
  • With a new Windows Form object open with the
    project name CurrencyConverter, right-click the
    project name CurrencyConverter in the Solution
    Explorer
  • Select Add Web Reference on the shortcut menu
  • Enter the following Web service URL in the URL
    text box http//www.webservicex.net/CurrencyConve
    rtor.asmx?wsdl. Then click the Go button to
    connect to the Web service. You must be connected
    to the Internet to find the Web service. If the
    Web service is available online, a message
    appears stating the name of the method that will
    be used in the code window to call the existing
    Web service
  • Click the Add Reference button in the Ad Web
    Reference window

21
Finding Web Services
22
Creating a Web Services Connection
  • After creating the Web reference, open the code
    window to create an instance of the Web service
    class. To create an instance named wsMoney (where
    ws stands for Web service), type Dim wsMoney as
    New net. You include the word net because the Web
    reference listed in the Solution Explorer begins
    with the name net
  • To complete the name of the Web service, type a
    period and webservicex appears in the
    IntelliSense window. Select webservicex, type a
    period, and www appears in the IntelliSense
    window. Select www and type another period
  • Select the Web service named CurrencyConvertor in
    the IntelliSense window. Press the ENTER key

23
Creating a Web Services Connection
24
Calling a Web Service Method
  • In the code window, assign a Double data type
    variable named dblConversionAmount. The data type
    is assigned as a Double because the Web reference
    stated that the return type is a Double data type
  • The variable dblConversionAmount is assigned to
    the returned value from the calling method
    ConversionRate. ConversionRate is method of the
    instance of wsMoney. Type dblC and press
    CTRLSPACEBAR to complete the variable
    dblConversionRate. Type wsMoney. An
    IntelliSense list opens. Select ConversionRate,
    and then type a left parenthesis (
  • To convert U.S. dollars to euros, scroll down the
    list of first arguments and select
    net.webservicex.www.Currency.USD. Type a comma
    and the second list of arguments appears. Scroll
    down the list of second arguments and select
    net.webservicex.www.Currency.EUR for euros. Type
    a closing parenthesis

25
Calling a Web Service Method
26
Program Design
27
Program Design
28
Designing the Program Processing Objects
29
Crystal ReportsCreating a Report
  • Open Visual Studio using the Start button on the
    Windows taskbar and the All Programs submenu.
    Click the New Web Site button on the Standard
    toolbar. In the list of Visual Studio installed
    templates, click ASP.NET Web Site. Name the
    sample report PhysicianReferral. Click the OK
    button
  • Right-click the project name PhysicianReferral in
    the Solution Explorer, and then click Add New
    Item on the shortcut menu. When the Add New Item
    window opens, click Crystal Report in the list of
    installed templates
  • Click the Add button

30
Crystal ReportsCreating a Report
  • Click the OK button. Download the database named
    physicians.mdb from the scsite.com/vb2005/ch12 to
    a removable disk, such as a USB drive. Click the
    plus sign in front of Create New Connection to
    expand the options. Click the plus sign in front
    of Database Files. Browse to the physicians.mdb
    database and select the file. Click the Open
    button. Select the PhysicianList table and then
    click the Add (gt) button in the center of the
    window
  • Click the Next button. In the Fields dialog box
    of the Standard Report Creation Wizard, hold down
    the CTRL key and select the Physician Name, City,
    State, and Specialty fields. Click the Add (gt)
    button in the center of the form
  • Click the Next button. Click the Next button
    again to create a report without any groupings.
    Click the Next button again to create a report
    without a summary. If necessary, click the Next
    button again to create a report without any
    subsets. In the Report Style window, select the
    Red/Blue Border style
  • Click the Finish button

31
Crystal ReportsCreating a Report
32
Displaying the Report
  • Click the Default.aspx tab to open the Web form.
    Open the Crystal Reports category on the Toolbox
    by clicking the plus sign to expand the Crystal
    Reports category. Drag the CrystalReportViewer
    object onto the Default.aspx Web form
  • If necessary, click the action button on the
    CrystalReportViewer object, and then click the
    Choose Report Source list arrow. Select ltNew
    Report Source...gt. The Create Report Source
    window opens. Click the Specify Crystal Report
    for the CrystalReportSource control list arrow,
    and then select CrystalReport.rpt
  • Click the OK button. Click the Start Debugging
    button on the Standard toolbar to execute the Web
    page. On the Debugging Not Enabled window, click
    the OK button

33
Displaying the Report
34
Summary
  • Create a Smartphone application
  • Use a cell phone keypad for input
  • Enter input using a Smartphone
  • Enter other characters using the keypad
  • Add Smartphone Toolbox objects

35
Summary
  • Create a softkey menu
  • Code the Smartphone application
  • Display MessageBox objects in a Smartphone
    environment
  • Find Web services

36
Summary
  • Create a Web service connection
  • Call a Web service method
  • Create a Crystal report
  • Display a Crystal report

37
CHAPTER 12 COMPLETE
  • Cell Phone Applicationsand Web Services
Write a Comment
User Comments (0)
About PowerShow.com