introduction to mobile programming
DESCRIPTION
Introduction to Mobile Programming. Overview. Fundamentally, it all works the same way You get the SDK for the device (Droid, Windows, Apple) You get a development account to test the application You deploy the application The APIs are different from one platform to the next. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/1.jpg)
Introduction to Mobile Programming
![Page 2: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/2.jpg)
Slide 2
Overview Fundamentally, it all works the same
way You get the SDK for the device (Droid,
Windows, Apple) You get a development account to test the
application You deploy the application
The APIs are different from one platform to the next
![Page 3: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/3.jpg)
Slide 3
Getting Started (Android) Download the Android SDK
Use Eclipse as the development environment (others are possible)
You are really writing Java code here against another API
![Page 4: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/4.jpg)
Slide 4
Getting Started (Android)
![Page 5: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/5.jpg)
Slide 5
Getting Started. Android The markup is XML The code is Java with a ‘different’ set of
libraries I have not worked this much
![Page 6: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/6.jpg)
Slide 6
Getting Started (Windows) You need to get the Windows Phone 7.1
or 8.0 Emulator Note Windows 8 phone apps can only be
developed on Windows 8 systems Uses Silverlight 5.x
Note windows 7.x phone apps can only be developed on Windows 7 systems
Uses Silverlight 4.x Don’t try to use any of the server OSs
![Page 7: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/7.jpg)
Slide 7
Getting Started (Windows) I’ll be working with 7.1 here Have not played with Windows 8
![Page 8: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/8.jpg)
Slide 8
Creating a First App When you installed the SDK you should
see the Silverlight for Windows Phone templates
Note that you also need the basic Silverlight tools too And the right version
![Page 9: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/9.jpg)
Slide 9
Creating a First Windows App
![Page 10: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/10.jpg)
Slide 10
Creating a First Windows App Select the Target Phone Version
![Page 11: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/11.jpg)
Slide 11
Creating a First Windows App And the emulator appears
![Page 12: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/12.jpg)
Slide 12
What you Already Know It’s all Silverlight (from last time) The IDE is similar to what you know
Toolbox, visual designer, Code Editor, Properties Window, Solution Explorer
The debugging tools are about the same
Some of the user interface elements differ
![Page 13: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/13.jpg)
Slide 13
UI Differences The TextBlock is the equivalent
to a multi-line text box The TextBox and Button and
other controls work as you would expect
Note the WPF property namesare much different
![Page 14: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/14.jpg)
Slide 14
A First Program Create the XAML
using the designer
![Page 15: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/15.jpg)
Slide 15
A First Program The XAML produced
![Page 16: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/16.jpg)
Slide 16
A First Program Create the code behind
![Page 17: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/17.jpg)
Slide 17
A First Program And just run as usual The app appears
in an emulator
![Page 18: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/18.jpg)
Slide 18
Creating Additional Pages Add an item to the to the project as
usual (more about page types in a moment)
![Page 19: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/19.jpg)
Slide 19
Navigation Between Pages A Windows phone application is made
up of pages Your first is MainPage.xaml and
MainPage.cs The hardware “back” button returns to the
previous page You use the NavigationService to
navigate to the next page
![Page 20: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/20.jpg)
Slide 20
Navigation Between Pages Navigate to another page:
![Page 21: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/21.jpg)
Slide 21
Page Types (1) Portrait and Landscape pages should be
clear Panorama mode uses a container
object and you create panorama items on the page You swipe between pages (
Pivot pages work similarly but the title does not move
![Page 22: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/22.jpg)
Slide 22
Panorama Page (Example)
![Page 23: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/23.jpg)
Slide 23
Pivot Page (Example)
![Page 24: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/24.jpg)
Slide 24
Microsoft Expression Blend It’s a UI design tool for XAML
It supports the WPF text engine
![Page 25: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/25.jpg)
Slide 25
Microsoft Expression Blend Just right click a .XAML file to bring up
Expression Blend It’s a big coloring tool and I don’t know
it!
![Page 26: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/26.jpg)
Slide 26
Phone Event Differences You should be used to mouse events
(click and motion) Now we have touch events (we call these
gestures Tap Multi-tap Pinch
Note that multi-touch events don’t work right in the emulator
![Page 27: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/27.jpg)
Slide 27
Phone Events Tap / Double tap – These are basically
equivalent mouse events PinchStarted, PinchCompleted,
PinchDelta These are multi-touch events
Flick – The quick mouse swipe (usually for page turning
Hold – Touch and hold for context menus or popups
![Page 28: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/28.jpg)
Slide 28
Deployment (1) For testing and any deployment to an
actual phone, you need a Windows Phone developers account Free thru Dreamspark but otherwise $99/year
For production, you need to play the Apple way (almost) Microsoft need not approve your application
though It’s possible to unlock (hack) your phone for
testing
![Page 29: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/29.jpg)
Slide 29
Deployment (2) http://msdn.microsoft.com/library/windo
wsphone/develop/ff769508(v=vs.105).aspx
![Page 30: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/30.jpg)
Slide 30
Deployment 3 Start the Application
Deployment tooland select theXAP file
![Page 31: Introduction to Mobile Programming](https://reader033.vdocuments.mx/reader033/viewer/2022061318/568167f7550346895ddd7211/html5/thumbnails/31.jpg)
Slide 31
Deployment (4) In Visual Studio select the Windows
Phone Device Phone must be on and connected