• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows 8 Development
 

Windows 8 Development

on

  • 1,464 views

Windows 8 Development PCs, Tablets & Mobile

Windows 8 Development PCs, Tablets & Mobile

Statistics

Views

Total Views
1,464
Views on SlideShare
1,464
Embed Views
0

Actions

Likes
2
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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 8 Development for PCs, Tablets & Mobile Course Description:Learn all about the new app model (Metro style apps) that allows you to create powerful new apps. All while retaining the ability to use your existing apps. Web-connected and web-powered apps built using C# and XAML have access to the power of the PC. This course walks you through creating a complete Metro style app using C# with XAML. Metro style apps are focused, fluid, and elegant. From the new Start screen to new UI layout and controls, the presentation of your app is about showing off what it's great at. Windows 8 IntroductionWindows is the next version of Microsoft Windows, a series of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops, netbooks, tablet PCs, and media center PCs. Windows 8 unified the UX for all the above devices. In this Module you will learn the Windows 8 UX principles and architecture. New desktop design Start screen Touch, Keyword and mouse activation in different platforms Roaming profiles Windows 8 architecture History VaultMetro Style Apps DevelopmentMetro style apps are full screen apps tailored to your users' needs, tailored to the device they run on, tailored for touch interaction, and tailored to the Windows user interface. Windows helps you interact with your users, and your users interact with your app. Controllers Overview Metro Infrastructure Metro style apps built-in controls Visual Studio 2011 and Bled 5 for developed Metro style Apps Developing basic Metro style apps using C# and XAML Metro style apps with OData and WCF RIA Services Debugging Metro style apps Metro Apps Packaging and DeploymentWindows Runtime (WinRT)Windows 8 features many improvements in security and privacy. In this module you will learn how to take advantages of those features and how to write more secure applications. Metro style apps secure environment principles SmartScreen filter Windows Defender Secured boot AppLockerBitLockerUpgrading your existing .NET Framework applicationsWhen converting existing .NET Framework code, you should be aware of the following changes you may need to make in your Metro style app: UI changes I/O changes Storage changes Threading changes Reflection changes Changes in general .NET Framework typesResilient File System (ReFS)ReFS is the next generation file system being introduced in Windows 8 replacing NTFS. In this module you will get an introduction of this new file system. Key goals Key design attributes and features Code reuse and compatibility On-disk structures
  • Here should be a live demo of Windows 8 operating system
  • Windows Runtime, or shortly WinRT, is Microsoft’s new programming model that makes the backbone of the new Metro-style apps (also known as Immersive) in the new Windows 8 operating system. WinRT solves many of the problems of Win32, from an apps perspective. Apps created for WinRT are safe, secure, and sandboxed, can’t wreck other apps and all install in just 2-3 seconds. They feature isolated storage, single folder installs (as per the Mac), and require user consent to access the general file system. This is part of it, a modern, truly different app platform that is far more different, and far more capable, than many people understand right now.
  • The WinRT type system relies strongly on WinRT components, which are COM objects implementing a specific set of interfaces and adhering to a certain ABI (Application Binary Interface). WinRT is essentially a COM-based API, relying on an enhanced COM that implements the IInspectable interface. The IInspectable interface enables projecting Win32 and COM features into JavaScript and other languages, such as C# and Visual Basic. *Implement the IInspectable interface when you want your class to be available in other programming environments. *The IInspectable interface is the base interface for all Windows Runtime classes. All Windows Runtime classes must implement the IInspectable interface. The IInspectable interface inherits from the IUnknown interface. so every WinRT object implements IUnknown and does refcounting (WinRT objects are reference counted like COM for memory management, with weak references to avoid circularity), and builds from there. It does add quite a lot of new concepts in comparison to COM of old, most of which come directly from .NET – for example, WinRT object model has delegates, and events are done .NET-style (with delegates and add/remove subscriber methods, one per event) rather than the old COM model of event sources and sinks. Of other notable things, WinRT also has parameterized (“generic”) interfaces.
  • WinRT collection interfaces such as IIterable and IVector become IEnumerable and IList; and so on. This goes both ways – if you have a .NET object that implements IEnumerable, and pass it back to WinRT, it’ll see it as IIterable.
  • What we call "bindings" Microsoft now calls "projections". Projections are the process of exposing APIs to three environments: Native (C and C++), HTML/JavaScript and .NET. If you author a component in C++ or a .NET language, its API will be stored in a WinMD file and you will be able to consume it from all three environments (Native, JavaScript and .NET). Even in C++ you are not exposed to COM. The use of COM is hidden behind the C++ projection tools. You use what looks and feels like a C++ object oriented API. To support the various constructs of WinRT, the underlying platform defines a basic set of types and their mappings to various environment. In particular, collection objects in WinRT are mapped to constructs that are native to each environment.
  • C++11 with WinRT: C++ Development A good news for C++ developers is that User interfaces in C++ will be written primarily in XAML for immersive applications. However, this is not available for classical, Win32 applications. This libraries for working with XAML have all been ported to C++ and are compiled to native x86. Metro applications written with XAML and C++ do not run on top of .NET, they get compiled directly to x86 just like any other Visual C++ application. Calling methods on UI controls is just like calling methods on any other object in C++.
  • Push notification – comes from serverToast notification – displayed on screen
  • Start grid application from template and explain structure
  • Add comparison tableShow demo
  • http://msdn.microsoft.com/en-us/library/windows/apps/br230302.aspx
  • WP8 course part 19
  • Examples of Chooser tasks include selecting a contact’s email address, selecting a photo from the phone, and saving a new ringtone.
  • WP8 course part 19Portable libraryMvvmShare files between projects in order to use partial classNavigation is different need common service
  • http://blogs.msdn.com/b/b8/archive/2012/01/16/building-the-next-generation-file-system-for-windows-refs.aspxData can get corrupted due to a number of reasons and therefore must be verified and, when possible, corrected automatically. Metadata must not be written in place to avoid the possibility of “torn writes,” which we will talk about in more detail below.Use scalable structures for everything. Don’t assume that disk-checking algorithms, in particular, can scale to the size of the entire file system.Assume that in the event of corruptions, it is advantageous to isolate the fault while allowing access to the rest of the volume. This is done while salvaging the maximum amount of data possible, all done live.

Windows 8 Development Windows 8 Development Presentation Transcript

  • Windows 8 Development PCs, Tablets & Mobile Hagit Badash
  • WINDOWS 8
  • Windows 8New desktop designStart screenTouch, Keyword and mouse activation in different platformsRoaming profilesWindows 8 architecture
  • Windows 8 Desktop
  • Roaming profiles• Local settings saving var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localSettings.Values["currentPage"] = MyBook.CurrentPage;• Roaming Settings Saving var roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; roamingSettings.Values["currentPage"] = MyBook.CurrentPage; – If there is no roaming profile, It will default to local storage
  • Architecture
  • WINRT
  • WinRT• WinRT is the Object Oriented Programming replacement for Win32. – An unmanaged native layer and its API is object oriented that can be consumed both from native or managed languages – Written in C++ and designed from the beginning to be object oriented. – A COM-based API, relying on an enhanced COM that implements the IInspectable interface
  • Relation between .NET & WinRT• .NET Client profile (C#,VB.NET applications) – Desktop Application development• .NET Metro profile (Windows 8 application) – subset of types from the .NET Framework• .NET has the ability to directly reference WinRT components as if they were .NET assemblies.
  • Advantages• App Container and Application Permissions• Overlapping Windows No Longer Exist
  • WinRT Projections• New name for ‘Bindings”• Projections are the process of exposing APIs to three environments: – Native – HTML/JavaScript – .NET• Hide the use of Com
  • DEMOC++11 WITH WINRT
  • ASYNC PROGRAMING
  • Asynchrony in a Nutshell• Synchronous  Wait for result before returning – string DownloadString(...);• Asynchronous  Return now, call back with result – void DownloadStringAsync(..., Action<string> callback);• Asynchrony benefits – UI responsiveness: Frees UI thread for interaction – Server scalability: Thread can be reused for other requests
  • Asynchronous Methods Goal: Just like synchronous programming – You can have your cake and eat it too!• Framework: Use Task<T> for all asynchrony – Add Task<T> support to existing .NET and Silverlight APIs – Easy for you to do the same• Languages: Asynchronous Methods – “async” modifier marks method or lambda as asynchronous – “await” operator yields control until awaited task completes
  • Task<T>• Represents “ongoing operation” – Could be async I/O, background worker, anything... – Single object for status, result and exceptions• Composable callback model – var task2 = task1.ContinueWith(t => … t.Result …); – The “await” operator rewrites to continuations• Combinators – WhenAll, WhenAny, Delay, etc.
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcesAsFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); } 
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); } 
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }  
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }  
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);  }  
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);  }   
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);  }    
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);   }    
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);    }    
  • Asynchronous Control Flowasync void DoWorkAsync() { var t1 =ProcessFeedAsync("www.acme.com/rss"); var t2 =ProcessFeedAsync("www.xyznews.com/rss"); async Task ProcessFeedAsync(string await Task.WhenAll(t1, t2); DisplayMessage("Done"); url) {} var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url);    }    
  • WINDOWS 8 APPLICATIONDEVELOPMENT
  • Windows 8 Application RequirementsLogo images: large & smallSplash screenPrivacy policyState persistencyAboutTest screens in 3 main resolutionsHelp
  • Windows 8 Application RequirementsNavigationDesign screens in 3 states: landscape, portrait, 1/3, 2/3SettingsBackground tasksBadge notificationTiles animations
  • Windows 8 Application RequirementsSearch contractPush notificationToast notificationApp bar application partApp bar item specific partTitle barPin items
  • Windows 8 Application RequirementsExtended splash screenShare contractTransitions between screensAnimations
  • DEMOGRID APPLICATION
  • UPGRADING EXISTING .NETAPPLICATIONS
  • UI Changes• New Features and capabilities should be considered as part of the design of the new application: – Touch first, less chrome, fast, fluid; – Live Tiles – Application bar – Charms• New namespaces Windows.UI.Xaml vs System.Windows
  • I/O changes• Asynchronous only using async – await keywords• Functions name changed: – System.IO.Stream.BeginRead to System.IO.Stream.ReadAsync
  • Storage Changes? • Instead of using the System.IO.IsolatedStorage class, use the types in the Windows.StorageReplace WithSystem.IO.IsolatedStorage. Windows.Storage.IsolatedStorageFile ApplicationData.Current.LocalFolderSystem.IO.IsolatedStorage. Windows.Storage.IsolatedStorageSettings ApplicationData.Current.LocalSettings
  • Threading ChangesReplace WithSystem.Threading.Thread.MemoryBarrier Interlocked.MemoryBarrier method in themethod System.Threading namespaceSystem.Threading.Thread.ManagedThread Environment.CurrentManagedThreadIdId property property in the System namespaceSystem.Threading.Thread.CurrentCulture CultureInfo.CurrentCulture property inproperty the System.Globalization namespaceSystem.Threading.Thread.CurrentUICultur CultureInfo.CurrentUICulture property ine property the System.Globalization namespace Windows.System.Threading.ThreadPoolTiSystem.Threading.Timer class mer class Windows.System.Threading.ThreadPoolSystem.Threading.ThreadPool class class
  • Reflection changes• Most members from the System.Type class have been moved to the System.Reflection.TypeInfo class.• Retrieve the TypeInfo object by calling the System.Reflection. IntrospectionExtensions.GetTypeInfo(System.Type)
  • Extension methods - converting types• System.IO.WindowsRuntimeStreamExtensions – Converting between managed streams and streams in the Windows Runtime.• System.IO.WindowsRuntimeStorageExtensions – Opening Windows Runtime files and folders as managed streams.• System.Runtime.InteropServices.WindowsRuntime. WindowsRuntimeBufferExtensions – Converting to and from IBuffer.
  • WINDOWS PHONE 8ADDITIONAL FEATURES
  • Features• Files and Storage – Several ways to access the same file • Isolated Storage as WP7.1 • Storage APIs using URI: ms-appdata:///local/myfile.txt • Storage APIs – Compatibility • WP8 Storage is subset of WinRT • Not Supporting: Roaming and Temporary data, Local and Roaming Settings
  • Features (Cont.)• Reserved Folders – Shared/Media – album display while playing audio – Shared/ShellContent – background images for tiles – Shared/Transfers – used by Background File Transfer service
  • Features (Cont.)• Background Agents – Renew often – Do not implement critical tasks – For more reliable tasks use push notifications• Tiles and Lock Screen Notifications• Push Notifications
  • Features (Cont.)• Resources – Contacts and Calendars in Windows Phone – Launchers and Choosers – Alarms and reminders – The Windows Phone camera – The Windows Phone sensors – Video content
  • Features (Cont.)• App to App communication – Auto-launching with File and Protocol associations – File associations – Protocol associations• Network Communication• Proximity Sensors and Bluetooth
  • Features (Cont.)• Speech Input• Maps and Location• Wallet Support• In-App Purchasing
  • Resources• Application must inform the user and request access to resources
  • Contacts and Calendar• Providers – Window Live – Exchange – Facebook – Aggregated accounts (Twitter, LinkedIn etc.)
  • Contacts and Calendar (Sample)
  • Contacts and Calendar (Sample)
  • Contacts and Calendar (Sample)
  • Launchers and Choosers• Launcher – API that launches one of the built-in applications, such as the Contacts application – When the new application appears, the user can choose to complete or cancel the task. – When the user closes the new application, the calling application is usually reactivated.
  • Launchers and Choosers• Chooser – API that launches one of the built-in applications, such as the Contacts application or the camera, through which the user completes a task. – When the new application appears, the user can choose to complete or cancel the task. – When the user closes the new application, the calling application is usually reactivated and supplied with data and status.
  • Launchers• BingMapsDirectionsTask • MarketplaceReviewTask• BingMapsTask • MarketplaceSearchTask• ConnectionSettingsTask • MediaPlayerLauncher• EmailComposeTask • PhoneCallTask• MapDownloaderTask • SaveAppointmentTask• MapsDirectionsTask • SearchTask• MapsTask • ShareLinkTask• MapUpdaterTask • ShareMediaTask• MarketplaceDetailTask • ShareStatusTask• MarketplaceHubTask • SmsComposeTask • WebBrowserTask
  • Choosers• AddressChooserTask • SaveEmailAddressTask• AddWalletItemTask • SavePhoneNumberTask• CameraCaptureTask • SaveRingtoneTask• EmailAddressChooserTask• GameInviteTask• PhoneNumberChooserTask• PhotoChooserTask
  • Camera• Ways to use Camera – CameraCaptureTask chooser • Photograph a picture – PhotoCamera class • Capture photos & video streams – PhotoCaptureDevice or AudioVideoCaptureDevice • Advance capturing• Real time video processing app can be registered as “Lens”
  • Sensors Library - WinRT• Windows.Devices.Sensors – compatible with WinRT – Accelerometer – Inclinometer – Gyrometer – Compass – OrientationSensor
  • Determine Sensor Availability
  • Start/Stop Sensor
  • Summary
  • TARGETING TO WINDOWS 8WINDOWS PHONE 8
  • Differences• Screen Size• Controls• Application Life Cycle
  • Sharing Strategy• Separate UI Logic from application logic – Use MVVM• Portable Class Library – for shared code
  • Sharing StrategyWindows 8 Windows App Phone 8 App Views Views Portable Class Library VM Model
  • Conditional Block• Enable/Disable lines of code based on compilation platform• Constants – NETFX_CORE – Windows 8 – WINDOWS_PHONE – Windows Phone 8• Use when there are small differences• Otherwise difficult to maintain the code
  • Conditional Block sample
  • Inheritance• Shared functionality in base class• Platform specific code in derived class• Great for separating features
  • Inheritance sample
  • Partial Classes & Methods• Shared functionality on one code file• Platform specific in additional code file• Classes are marked as partial• Link to shared functionality file in both projects
  • DEMOCROSS PLATFORM
  • Contact Information Hagit Badash hagb@e4d.co.il