1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft ›...
Transcript of 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft ›...
![Page 1: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/1.jpg)
![Page 2: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/2.jpg)
1. Power/sleep2. Volume up and volume
down3. Camera4. Back5. Start6. Search
![Page 3: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/3.jpg)
4.5" PureMotion HD+ IPS LCD768x1280 resolution332 ppi
• 32 GB storage
• 1024 MB RAM
• 8.7 MP
• 1080p HD video
• Front-facing camera
• LED flash
• Autofocus
• Carl Zeiss lens
• Optical Image Stabilization
• 1.5 GHz MSM8960
• Dual core
![Page 4: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/4.jpg)
Windows Phone 8
supports
Managed app dev using the WP7.1,
WP8.0 .NET and Windows Phone
Runtime APIs
Native app dev using Windows
Runtime and Win32
Games dev using the WP7.1 XNA
framework
Games dev using Direct3D or
DirectX
.NET API for
Windows
Phone
Windows
Runtime
Win32 &
COM
Managed Managed &
Native
Native
WP7.1 XAML & C#/VB
WP8.0 XAML & C#/VB
WP8.0 Games DirectX/Direct 3D & C++
WP7.1 XNA & C#/VB
WP8.0 XAML & C#/VB with Direct3D Graphics
+ C++
+ C++
![Page 5: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/5.jpg)
ViewThe UI controls
ViewModelAdapter between View and
Model
ModelThe data. Database / XML / etc.
![Page 6: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/6.jpg)
ViewThe UI controls
ViewModelAdapter between View and
Model
ModelThe data. Database / XML / etc.
XAML
Properties,
Commands,
View Logic
Data,
Service
Proxies
![Page 7: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/7.jpg)
ViewThe UI controls
ViewModelAdapter between View and
Model
ModelThe data. Database / XML / etc.
XAML
Properties,
Commands,
View Logic
Data,
Service
Proxies
![Page 8: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/8.jpg)
ViewThe UI controls
ViewModelAdapter between View and
Model
ModelThe data. Database / XML / etc.
XAML
Properties,
Commands,
View Logic
Data,
Service
Proxies
![Page 9: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/9.jpg)
![Page 10: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/10.jpg)
![Page 11: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/11.jpg)
ViewThe UI controls
ViewModelAdapter between View and Model
ModelThe data. Database / XML / etc.
XAML
Propertie,
Commands,
View Logic
Data,
Service
Proxies
![Page 12: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/12.jpg)
![Page 13: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/13.jpg)
![Page 14: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/14.jpg)
![Page 15: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/15.jpg)
ViewThe UI controls
ViewModelAdapter between View and Model
ModelThe data. Database / XML / etc.
XAML
Propertie,
Commands,
View Logic
Data,
Service
Proxies
![Page 16: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/16.jpg)
![Page 17: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/17.jpg)
Grid layout: including RowDefinitionsand ColumnDefinitions
StackPanel layout • Margins: to move elements away from the left-side, top-side, right-side or bottom-side
• HorizontalAlignmentand VerticalAlignmentattributes
![Page 18: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/18.jpg)
<RowDefinition Height="40”>
<RowDefinition Height="*">
<RowDefinition Height="2*">
<RowDefinition Height="20">
Example:
400 – 40 – 20 = 340
340/3 = 113
340*2/3 = 226
![Page 19: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/19.jpg)
<Grid x:Name="ContentPanel" Grid.Row="1"
Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<Rectangle Fill="Red" Grid.Row="0" />
<Rectangle Fill="Blue" Grid.Row="1" />
<Rectangle Fill="Green" Grid.Row="2" />
</Grid>
![Page 20: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/20.jpg)
![Page 21: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/21.jpg)
![Page 22: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/22.jpg)
![Page 23: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/23.jpg)
![Page 24: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/24.jpg)
![Page 25: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/25.jpg)
![Page 26: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/26.jpg)
![Page 27: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/27.jpg)
![Page 28: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/28.jpg)
![Page 29: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/29.jpg)
![Page 30: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/30.jpg)
![Page 31: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/31.jpg)
Sensor Description
Accelerometer Detects acceleration along three axes (x, y, and z).
Inclinometer Detects angle of incline along three axes (pitch, roll, and yaw).
Gyrometer Detects angular velocity along three axes.
CompassDetects heading in degrees relative to magnetic north (and due
north when integrated with onboard GPS).
Light Detects ambient lighting level in lumens.
Orientation
Combines the data from the accelerometer, compass, and
gyrometer sensors to provide smoother and more sensitive
rotation data than can be obtained from any of the sensors
alone.
Simple OrientationUses the accelerometer to obtain device orientation as a
rotation into one of four quadrants, or face-up, or face-down.
Namespace Windows.Devices.Sensors
![Page 32: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/32.jpg)
![Page 33: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/33.jpg)
![Page 34: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/34.jpg)
![Page 35: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/35.jpg)
![Page 36: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/36.jpg)
![Page 37: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/37.jpg)
![Page 38: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/38.jpg)
Setup the Push Notification Channel
// Try to find an existing channelHttpNotificationChannel httpChannel = HttpNotificationChannel.Find("MyChannel");if (null == httpChannel){
httpChannel = new HttpNotificationChannel("MyChannel");// handle Uri notification eventshttpChannel.ChannelUriUpdated +=
new EventHandler<NotificationChannelUriEventArgs>(httpChannel_ChannelUriUpdated);httpChannel.Open();
}else{
// the channel already exists. httpChannel.ChannelUri contains the device’s// unique locator
}// handle error eventshttpChannel.ErrorOccurred +=
new EventHandler<NotificationChannelErrorEventArgs>(httpChannel_ErrorOccurred);
![Page 39: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/39.jpg)
Send a Push Notification to a Client Phone// create a payload for a toast notification
string msg ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +"<wp:Text1><string></ltwp:Text1>" +"<wp:Text2><string></wp:Text2>" +
"</ltwp:Toast>" +"</wp:Notification>";
byte[] msgBytes = new UTF8Encoding().GetBytes(msg);// create a web request that identifies the payload as a toast notificationHttpWebRequest request = (HttpWebRequest)WebRequest.Create(deviceUri);request.Method = WebRequestMethods.Http.Post;request.ContentType = "text/xml";request.ContentLength = msg.Length;request.Headers["X-MessageID"] = Guid.NewGuid().ToString();request.Headers["X-WindowsPhone-Target"] = "toast";request.Headers["X-NotificationClass"] = "2";// post the payloadStream requestStream = request.GetRequestStream();requestStream.Write(msgBytes, 0, msgBytes.Length);requestStream.Close();
![Page 40: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/40.jpg)
![Page 41: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/41.jpg)
![Page 42: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/42.jpg)
![Page 43: 1. Power/sleep 2. Volume up and volume down 3. Camera 4 ... › ~shirl11 › Microsoft › Lecture2TAU.pdf · 1. Power/sleep 2. Volume up and volume down 3. Camera 4. Back 5. Start](https://reader035.fdocuments.in/reader035/viewer/2022063001/5f1abeea8ae44f3a347963b2/html5/thumbnails/43.jpg)
www.dreamspark.com/Student/Default.aspx
http://e5.onthehub.com/WebStore/ProductsByMajorVersionList.aspx?ws=23e93290-629b-e011-969d-0030487d8897&vsro=8&JSEnabled=1
http://www.microsoft.com/israel/4steps/
http://channel9.msdn.com/Series/Windows-Phone-8-Development-for-Absolute-Beginners
http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners