Deze presentatie heeft Fons Sonnemans tijdens de Lowlands Windows Phone Developer Day verzorgt. Hij heeft aan de hand van 12 uiteenlopende onderwerpen geleert apps beter te maken. Hierin komen technische onderwerpen, design en marketing aan bod. Een presentatie vol met do’s en dont’s voor je eigen apps
5. Topics
1.Create Universal Apps
2.Start with a Design not Code
3.Design proper Visual Assets
4.Create custom themes
5.Be mobile
6.Reviews are important
7.Use Vectors and Fonts
8.Performance is key!
9.Localize your app
10.Use Data Binding and MVVM
11.Learn Blend
12.Cache your first page
5
6. 1. Create Universal Apps
•Be prepared for Windows 10
•Connect your Windows Phone app with the Windows 8 app
•Share Roaming data across platforms
•Share code
•Portable Class Libraries (PCL)
•Shared projects
•File linking
6
8. 2. Start with a Design not Code
http://design.windows.com
•Modern Design
•RTFM (Principles, Guidelines, UX Patterns)
•Vision and process
•Discover your best idea
•Identity
•Create a beautiful visual identity
•Gallery
•Learn (“steal”) from the best/competition
9
12. 4. Create Custom Themes
•Windows
•C:Program Files (x86)Windows Kits8.1IncludeWinRTXamlDesignGeneric.xaml
•Windows Phone
•C:Program Files (x86)Windows Phone Kits8.1IncludeabiXamlDesignGeneric.xaml
•Use the ThemeManager of Dave Smits
•http://www.familie-smits.com/theming-in-a-universal- app
•Use HAMMER.Pants for Windows
•https://github.com/Code52/HAMMER
13
13. 5. Be Mobile
•HttpClient
•Resolve the correct type
•System.Net.Http.HttpClient is slightly different in the most basic use, and quite different when you get into advanced work.
•Always make sure you’re using Windows.Web.Http
•System.Net.Http shows up first
14
14. 5. Be Mobile
•Mobile devices are often connected to poor quality network connections
•Best chance of success in network data transfers achieved by:
•Keep data volumes as small as possible
•Use the most compact data serialization available (use JSON instead of XML)
•Avoid large data transfers
•Avoid transferring redundant data
•Design your protocol to only transfer precisely the data you need and no more
15. Network Awareness in your apps
•Making Decisions based on Data Connections
•Mobile apps shouldn’t diminish the user experience by trying to send or receive data in the absence of network connectivity
•Mobile apps should be intelligent about performing heavy data transfers only when the appropriate connectivity is available
•Use the NetworkInterfaceType object to detect network type and speed
•Subscribe to the NetworkChange event to detect when network state changes
Make your app aware of its networking environment and state!
16. 17
Network Information in Windows Runtime private bool IsOnWiFi() { ConnectionProfile InternetConnectionProfile = NetworkInformation.GetInternetConnectionProfile(); if (internetConnectionProfile == null) return false; return InternetConnectionProfile.IsWlanConnectionProfile; } private bool IsConnectedtoDataRoaming() { bool isRoaming = false; ConnectionProfile internetConnectionProfile = NetworkInformation.GetInternetConnectionProfile(); if (internetConnectionProfile != null && internetConnectionProfile.IsWwanConnectionProfile) { ConnectionCost cc = internetConnectionProfile.GetConnectionCost(); isRoaming = cc.Roaming; // See if user is currently roaming } return isRoaming; } private void AddEventHandlers() { // NetworkStatusChanged fires when the network status changes for a connection NetworkInformation.NetworkStatusChanged += OnNetworkStatusChanged; }
17. What is Data Sense?
•Data Sense is a set of components designed to help:
•End users: understand and manage data consumption
•Mobile Operators: reduce cellular consumption & optimize connectivity
•3rd party developers and ISVs: Build smart data consuming applications
18
18. What Makes Up “Data Sense”?
The Data Sense platform
Data Sense (UI)
Browser Optimization Service
WiFi hotspot Mapping
19. Content Streaming Scenario - 1 of 2 ConnectionProfile internetConnectionProfile = NetworkInformation.GetInternetConnectionProfile(); if (internetConnectionProfile != null) { if (internetConnectionProfile.IsWlanConnectionProfile) { // connected on WiFi interface; double check it is not a metered WiFi hotspot ConnectionCost cc = internetConnectionProfile.GetConnectionCost(); if ((NetworkCostType.Unknown == cc.NetworkCostType) || (NetworkCostType.Unrestricted == cc.NetworkCostType)) { // assume free network; connect and start streaming content } } else if (internetConnectionProfile.IsWwanConnectionProfile) { ...
20. 22
Content Streaming Scenario – 2 of 2 else if (InternetConnectionProfile.IsWwanConnectionProfile) { ConnectionCost cc = InternetConnectionProfile.GetConnectionCost(); // check the type of data plan - make sure user is not currently roaming if (!cc.Roaming) { if ((NetworkCostType.Unknown == cc.NetworkCostType) || (NetworkCostType.Unrestricted == cc.NetworkCostType)) { // assume free network; connect and start streaming content } else if (NetworkCostType.Fixed == cc.NetworkCostType) { // make sure user not currently over limit or near limit if ((!cc.OverDataLimit) && (!cc.ApproachingDataLimit)) { // connect and start streaming content } } } }
Source: http://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B326
25. 7. Use Vectors and Fonts
•Use Bitmaps for Images
•JPG for large photos
•PNG for perfect quality
•Scale 100, 140, 180
•Use Vectors and Fonts for “Icons”
•Use <Path data=“” /> for Vector
•Use FontIcon or TextBlock for Fonts
•AppBarButton supports FontIcon & PathIcon
27
31. 9. Localize your app
•Offering your app in English only will only cover about 25% of Windows Phone customers, though it covers a larger percentage of tablets and PCs users. Adding Spanish, French, Mandarin, Russian and German increases coverage to more than 75% of the base.
http://blogs.windows.com/buildingapps/2014/09/29/windows-and-windows- phone-store-trends-september-2014-update/
33
32. 10. Use Data Binding and MVVM
•Motivations:
•Reduces complexity with Model to UI integration
•Separation of concerns
•Clear Designer-Developer separation
•Makes code more Unit testable
•Approach:
•Split the UI architecture into Model, View and View- Model
•Model: Represents the data
•View : UI defined declaratively in XAML
•View Model: Specialization of the Model that View uses for data binding