• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows phone 7 series
 

Windows phone 7 series

on

  • 1,758 views

 

Statistics

Views

Total Views
1,758
Views on SlideShare
1,754
Embed Views
4

Actions

Likes
0
Downloads
18
Comments
0

1 Embed 4

http://www.verious.com 4

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Windows phone 7 series Windows phone 7 series Presentation Transcript

    • Windows Phone 7 Series Balaji Damodaran -ThoughtWorks
    • Before we start, a confession…
    • Microsoftdid not pay us.
    • The Players
    • And Cross Platform APIs (mostly)
    • New kidon the block
    • Old(ish) wine ina new(ish) bottle
    • Demo
    • Source:https://github.com/openbala/xconf-pune
    • Metro
    • Metro Design and TypefaceThe Windows Phone OS 7 User Interface (UI) is based on a design that isinternally named Metro, and echoes the visual language of airport and metrosystem signage in its design and typeface.
    • TilesTiles are links to applications, features, functionsand individual items (such as contacts, webpages, applications or media items). Users canadd, rearrange, or remove Tiles. Tiles aredynamic and update in real timeTiles that use the Tile Notification feature canupdate the Tile graphic or title text, orincrement a counter.
    • ThemesA Theme is a user-selected combination of background and accent colors thatpersonalizes the visual elements on a Windows Phone for that user.
    • SilverlightComponents
    • Silverlight EssentialsXaml – Extensible Application Markup Language (ala HTML types)Xaml.cs – Backend Program that controls the UI state and data (ala JavaScript)
    • UI Controls• ListBox• Grid• Canvas• StackPanel• Border• Map• Slider• ProgressBar• TextBlock• more…
    • Panorama & Pivot
    • Panorama ApplicationUnlike standard applications that are designed to fit within the confines ofthe phone screen, these applications offer a unique way to view controls,data, and services by using a long horizontal canvas that extends beyondthe confines of the screen
    • Pivot ApplicationA pivot control provides a quick way to manage views or pages within theapplication. The control places individual views horizontally next to each other,and manages the left and right navigation. Flicking or panning horizontally onthe page cycles the pivot functionality.
    • Isolated Storage
    • Isolated Storage - DefinedIsolated storage enables managed applications to create and maintain localstorage. Application developers have the ability to store data locally on thephone, leveraging all the benefits of isolated storage including protecting datafrom other applications.
    • Isolated Storing System.IO.IsolatedStorageusing (IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication()){ using (IsolatedStorageFileStream stream = isoStorage.OpenFile("xconfpune.dat",FileMode.OpenOrCreate)) { DataContractSerializer serializer = new DataContractSerializer(typeof(XConfSession)); XConfSession info = serializer.ReadObject(stream) as XConfSession; }}
    • WP7 ↔ Web Services
    • featuresNot Supported:• Duplex communication over HTTP• WCF Data Services.• Custom bindings, sockets, RSS and Atom feeds• WS proxy cannot be generated dynamically using ‘CreateChannel’.Supported:• Asynchronous communication over HTTP• Silverlight 3 SDK feature support for WCF.• Compile time proxy through ‘Add Service Reference’ in VS2010
    • Data Binding
    • Data Binding - DefinedData binding is a way of linking user input to program data automatically.a. User input will fire property changed events.b. Changing a property in the program will update the display.
    • Data Binding - Setting Defining the data source: a. DataContext property of any containing Element b. ItemSource of a List control – (ObservableCollection type) <phone:PhoneApplicationPage.Resources> <local:DamageClass x:Key="DamageClass" /> </phone:PhoneApplicationPage.Resources> <!--LayoutRoot contains the root grid where all other page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{StaticResource DamageClass}"> Binding the Data:<TextBlock Grid.Column="0" Text="{Binding TimeSlot}" Style="{StaticResource PhoneTextSubtleStyle}"/>
    • Data Binding - ModesMode determines how changes are synchronized:a. OneTimeb. OneWayc. TwoWay
    • Application Bar
    • Application Bar - DefinedThe Application Bar provides a place for developers to display up to four of themost common application tasks and views as icon buttons.
    • Application Bar<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/> <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem Text="MenuItem 1"/> <shell:ApplicationBarMenuItem Text="MenuItem 2"/> </shell:ApplicationBar.MenuItems></shell:ApplicationBar>Icons need to be developed only in white, Windows Phone API will take care ofconverting it into respective dark color when the theme changes from dark tolight.Text hint is mandatory. A maximum of 4 icons are allowed in the application bar.A maximum of 5 menu items are allowed under the application bar.
    • Application Life Cycle
    • Application Life Cycle
    • TombstoningThe procedure in which the operating system terminates an application’s processwhen the user navigates away from the application. The operating system maintainsstate information about the application. If the user navigates back to the application,the operating system restarts the application process and passes the state data backto the application.
    • App.xamlApplication_Launching- Triggered on starting the app, not on activation after being tomstoned.Application_Activated- Triggered on reactivating the app after being tomstoned.Application_Deactivated- Triggered when an app is being tomstoned.Application_Closing- Triggered on closing the application.
    • Launchers and Choosers
    • Launchers and Choosers - Defined The Launcher and Chooser APIs invoke distinct built-in applications that replacethe currently running application.Launcher:A Launcher is an API that launches one of the built-in applications throughwhich a user completes a task, and in which no data is returned to the callingapplication. E.g. Phone CallChooser:A Chooser is an API that launches one of the built-in applications through whicha user completes a task, and which returns some kind of data to the callingapplication E.g. Choosing a Photo
    • LaunchersEmailComposeTaskMarketplaceDetailTaskMarketplaceHubTask EmailComposeTask emailComposeTask = new EmailComposeTask();MarketplaceReviewTask emailComposeTask.To = "user@example.com";MarketplaceSearchTask emailComposeTask.Body = "Email message body"; emailComposeTask.Cc = "user2@example.com";MediaPlayerLauncher emailComposeTask.Subject = "Email subject";PhoneCallTask emailComposeTask.Show();SearchTaskSMSComposeTaskWebBrowserTask
    • ChoosersCameraCaptureTask // Initialize the CameraCaptureTask and assign the Completed handler in the page constructor.EmailAddressChooserTask cameraCaptureTask = new CameraCaptureTask();PhoneNumberChooserTask cameraCaptureTask.Completed += new EventHandler<PhotoResult>(cameraCaptureTask_Completed);PhotoChooserTask cameraCaptureTask.Show();SaveEmailAddressTask void cameraCaptureTask_Completed(object sender, PhotoResult e)SavePhoneNumberTask { if (e.TaskResult == TaskResult.OK) { BitmapImage bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); myImage.Source = bmp; } }
    • Location Services
    • Location Services The Location Service allows you to create location-aware applications. The service obtains location data from multiple sources such as GPS, Wi-Fi, and cellular. System.Device.Location GeoCoordinateWatcher// The watcher variable was declared as type GeoCoordinateWatcher.if (watcher == null){ watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // using high accuracy watcher.MovementThreshold = 20; // to ignore noise in the signal in metres. watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(w_StatusChanged); watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(w_PositionChanged);}watcher.Start();
    • GeoPosition Statusesswitch (e.Status) {case GeoPositionStatus.Disabled:// The Location Service is disabled or unsupported. Check to see if the user has disabled theLocation Service.if (watcher.Permission == GeoPositionPermission.Denied) {// The user has disabled the Location Service on their device.} else {//location is not functioning on this device}break;case GeoPositionStatus.Initializing:// The Location Service is initializing.break;case GeoPositionStatus.NoData:// The Location Service is working, but it cannot get location data.break;case GeoPositionStatus.Ready:// The Location Service is working and is receiving location data.break;}
    • Push Notifications
    • Push NotificationsPush Notification Service in Windows Phone offers a dedicated, and persistentchannel to send information and updates to a mobile application from a web service.
    • Types of Push Notifications 1. Tile Notification 1. Image, Count, Title can be notified 2. Toast Notification 1. Displayed on top of the screen for 10 seconds. 3. Raw Notification 1. To send raw information to application if running.
    • Send a push notification to service// The URI that the Push Notification Service returns to the Push Client when creating anotification channel.string subscriptionUri = “http://hostedlive.com/hello"HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri);// HTTP POST is the only allowed method to send the notification.sendNotificationRequest.Method = "POST";// The custom header X-MessageID uniquely identifies a message. If it is present, the same value isreturned in the notification response.sendNotificationRequest.Headers.Add("X-MessageID", "<UUID>");// Sets the web request content length.sendNotificationRequest.ContentLength = notificationMessage.Length;// Sets the notification payload to send.byte[] notificationMessage = new byte[] {<payload>};using (Stream requestStream = sendNotificationRequest.GetRequestStream()){ requestStream.Write(notificationMessage, 0, notificationMessage.Length);}// Sends the notification and gets the response. HttpWebResponse response =(HttpWebResponse)sendNotificationRequest.GetResponse();
    • Send a push notification to service – Pay LoadsRaw notification new byte[] {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};Tile notification <?xml version=1.0 encoding=utf-8?> <wp:Notification xmlns:wp=WPNotification> <wp:Tile> <wp:BackgroundImage><background image path></wp:BackgroundImage> <wp:Count>5</wp:Count> <wp:Title>xconf_pune</wp:Title> </wp:Tile> </wp:Notification>Toast notification <?xml version=1.0 encoding=utf-8?> <wp:Notification xmlns:wp=WPNotification> <wp:Toast> <wp:Text1><string></wp:Text1> <wp:Text2><string></wp:Text2> </wp:Toast> </wp:Notification>sendNotificationRequest.ContentType = "text/xml";sendNotificationRequest.Headers.Add("X-WindowsPhone-Target", "token");sendNotificationRequest.Headers.Add("X-NotificationClass", "<batching interval>");
    • Receive a Push Notification Microsoft.Phone.Notification HttpNotificationChannel// Only one notification channel name is supported per application.channel = new HttpNotificationChannel("channel","www.contoso.com");channel.Open();//receiving a raw notificationchannel.HttpNotificationReceived += newEventHandler<HttpNotificationEventArgs>(channel_HttpNotificationReceived);// If the application is running in the foreground, the toast notification is instead routed to theapplication.channel.ShellToastNotificationReceived += newEventHandler<NotificationEventArgs>(channel_ShellToastNotificationReceived);// Binding a notification channel to a tile notification.if (!channel.IsShellTileBound) {channel.BindToShellTile();}// Binding a notification channel to a toast notification.if (!channel.IsShellToastBound) {channel.BindToShellToast();}
    • Touch & Gestures
    • Available Gestures• Tap• DoubleTap• Hold• FreeDrag• VerticalDrag Touch Gestures is available only in XNA framework, though the library can be used in• HorizontalDrag a Silverlight application.• DragComplete• Flick• Pinch• PinchComplete
    • Gesture Sample Microsoft.Xna.Framework.Input.Touch//enable the gestures we care about.you must set EnabledGestures before you can use any ofthe other gesture APIs.TouchPanel.EnabledGestures=GestureType.Hold|GestureType.Tap|GestureType.FreeDrag;//since we may have multiple gestures available, we use a loop to read in all of thegestureswhile(TouchPanel.IsGestureAvailable) { //read the next gesture from the queue GestureSample gesture=TouchPanel.ReadGesture(); //we can use the type of gesture to determine our behavior switch(gesture.GestureType) { case GestureType.Tap: case GestureType.DoubleTap: case GestureType.Hold: case GestureType.FreeDrag: case GestureType.Flick: case GestureType.Pinch: }}
    • Animations –Expression Blend
    • Expression Blend 4 - DefinedThe Microsoft Expression Blend Software Development Kit (SDK) forWindows Phone provides conceptual topics and programming referencefor behaviors, which are reusable pieces of packaged code that can bedragged onto any object and then fine-tuned by changing theirproperties.
    • There are more..
    • APIs forAccelerometerVibration ControllerBing MapsWeb BrowserChartingAdvertisingXNA GameTrial Version…
    • LG Quantum HTC 7 HTC HD7 Dell Venue Pro Surround Samsung Samsung HTC 7 Focus Omnia 7 Trophy
    • Resourceshttp://borntolearn.mslearn.net/wp7/m/default.aspxhttp://wp7dev.wikispaces.comhttp://channel9.msdn.com/learn/courses/WP7TrainingKithttp://www.charlespetzold.com/phone/http://images.google.comhttp://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7.aspxhttp://go.microsoft.com/fwlink/?LinkID=183218