Mobile Software Engineering Crash Course - C06 WindowsPhone

591 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
591
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
22
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Mobile Software Engineering Crash Course - C06 WindowsPhone

  1. 1. Mobile Software EngineeringL06 – Windows Phone Mohammad Shaker FIT of Damascus - AI dept. MohammadShakerGtr@gmail.com Mobile SE – August 2012
  2. 2. Take a lookhttp://bit.ly/e-76phone
  3. 3. Free Developer Account
  4. 4. Code Samples for Windows Phone
  5. 5. Downloading the SDK bit.ly/wp7sdktools
  6. 6. Downloading the SDK
  7. 7. Silverlight and Mango
  8. 8. Emulator
  9. 9. .NET Support
  10. 10. Tutorialhttp://jesseliberty.com/tutorials/
  11. 11. Design PatternsMVC and MVVC Models
  12. 12. MVVMModel-View View-Model
  13. 13. MVVMtargeted at modern UI development platforms which support Event-driven programming
  14. 14. MVVMHTML5, WPF, Silverlight, … etc.
  15. 15. MVVMmore @ https://en.wikipedia.org/wiki/MVVM
  16. 16. MVVM – Microsoft Prismhttp://msdn.microsoft.com/en-us/library/cc707819.aspx
  17. 17. http://msdn.microsoft.com/en-us/practices/default.aspx
  18. 18. Straight into the Action! “Live test”
  19. 19. MVVMBinding Awesomeness
  20. 20. Binding Awesomeness<TextBlock Text="{Binding Message}" Margin="10“TextWrapping="Wrap" FontSize="18" Width="350" />
  21. 21. Project attached
  22. 22. Deleting with ItemSource set http://stackoverflow.com/questions/6422378/listbox-operation-not-supported-on-read-only-collectionthis.UserListBox.Items.RemoveAt(this.UserListBox.SelectedIndex);
  23. 23. Expression Blend Designer Tool
  24. 24. Binding Techniques - Templates<ListBox Name="lstTwitter" Margin="12,78,8,78"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Height="110" Margin="-10,-10,-10,-10"> <TextBlock Text="{Binding Message}" Margin="10" TextWrapping="Wrap" FontSize="18" Width="350" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
  25. 25. XML Revisited - Twitter Binding!http://www.netmagazine.com/tutorials/build-your-first-windows-phone-7-app
  26. 26. WebClientWhat a line of code can do!
  27. 27. WebClient private void button2_Click(object sender, RoutedEventArgs e) { WebClient twitter = new WebClient(); // Handle downloaded data when finished twitter.DownloadStringCompleted += newDownloadStringCompletedEventHandler(twitter_DownloadStringCompleted); // Set the site twitter.DownloadStringAsync(newUri("http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=" + textBox1.Text)); }
  28. 28. WebClient private void button2_Click(object sender, RoutedEventArgs e) { WebClient twitter = new WebClient(); // Handle downloaded data when finished twitter.DownloadStringCompleted += newDownloadStringCompletedEventHandler(twitter_DownloadStringCompleted); // Set the site twitter.DownloadStringAsync(newUri("http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=" + textBox1.Text)); }
  29. 29. WebClient void twitter_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) return; XElement xmlTweets = XElement.Parse(e.Result); lstTwitter.ItemsSource = from tweet in xmlTweets.Descendants("status") select new TwitterItem { ImageSource = tweet.Element("user").Element("profile_image_url").Value, Message = tweet.Element("text").Value }; }
  30. 30. Project attached
  31. 31. Navigation >>
  32. 32. Navigationvoid GoToPage2_Click(object sender, RoutedEventArgs e){ NavigationService.Navigate( new Uri("/Page2.xaml", UriKind.Relative) );}
  33. 33. Windows Azure Toolkit for Windows Phone http://watwp.codeplex.com
  34. 34. into the Cloud..
  35. 35. XNAGames
  36. 36. Creators Clubhttp://create.msdn.com/en-US/
  37. 37. http://create.msdn.com/en-US/
  38. 38. XNA Development
  39. 39. Game LoopOnUpdate(), OnDraw()
  40. 40. PracticeParticle Engine with Touch Events!
  41. 41. What’s a Particle Engine Implementation
  42. 42. Touch
  43. 43. Touching EventsMouseState ms = Mouse.GetState();if(ms.LeftButton == ButtonState.Pressed){ DoSomething();}ORTouchCollection touches = TouchPanel.GetState();foreach(TouchLocation touch in touches){ if(touch.State == TouchLocationState.Pressed || touch.State == TouchLocationState.Moved) { DoSomething(); break; }}
  44. 44. Particle engine with touch events!
  45. 45. Project attached – play around!

×