Download presentation
Presentation is loading. Please wait.
Published byTobias Garley Modified over 9 years ago
10
private void GetFixedFeatures() { Version v = Environment.OSVersion.Version; bool g = Gyroscope.IsSupported; bool a = Accelerometer.IsSupported; bool c = Compass.IsSupported; bool p = Camera.IsCameraTypeSupported(CameraType.Primary); bool f = Camera.IsCameraTypeSupported(CameraType.FrontFacing); int i = App.Current.Host.Content.ScaleFactor; } private void GetDynamicFeatures() { bool d = DeviceNetworkInformation.IsCellularDataEnabled; bool r = DeviceNetworkInformation.IsCellularDataRoamingEnabled; bool x = (DeviceStatus.PowerSource == PowerSource.External); ConnectionProfile profile = NetworkInformation.GetInternetConnectionProfile(); ConnectionCost cost = profile.GetConnectionCost(); } private void AddEventHandlers() { DeviceNetworkInformation.NetworkAvailabilityChanged += OnNetworkAvailabilityChanged; NetworkInformation.NetworkStatusChanged += OnNetworkStatusChanged; DeviceStatus.PowerSourceChanged += OnPowerSourceChanged; PowerManager.PowerSavingModeChanged += OnPowerSavingModeChanged; }
12
App/Agent Type512MB device1GB device2GB device VOIP516080 Background Audio Playback20*25* Generic Background Agents11*20 Continuous Background Execution 150 Foreground App**150/150/180150/300/380150/450/570 Foreground App**150/150/180150/300/380150/450/570
13
App/Agent Type512MB device1GB device2GB device VOIP516080 Background Audio2025 Bluetooth16 VPN1015 Calendar Child/FileProvider Target100 CachedFileUpdater/ShareDataPackage10 Background Transfer555 WP8 Generic Background Agents162030 WP8.1 Background Tasks163040 Continuous Background Execution150 300 Foreground App (WP8.0 context)180380780 Foreground App (modern context)185390825 WP8 Generic Background Agents162030 WP8.1 Background Tasks163040 Foreground App (WP8.0 context)180380780 Foreground App (modern context)185390825
14
1GB -->
15
Component usage (ballpark)512MB Total physical512 Paging level200 712 BSP133 OS, drivers, services300 OEM/MO service agents22 VOIP or Background audio51 Bluetooth16 VPN10 532 Foreground App, Back-stack, CBE, GBAs180 94% of apps peak at <150MB. 96% of apps average at <100MB.
16
App/Agent TypePriority Foreground App2 VOIP2 Background Audio2 Bluetooth2 VPN2 Background Transfer2 or 6* Calendar Child/FileProvider Target3 CachedFileUpdater/ShareDataPackage Task3 or 6* Continuous Background Execution4 Geofence-triggered Task5 WP8.0 Generic Background Agents6 WP8.1 Background Tasks6
17
// WP7. long totalBytes = Microsoft.Phone.Info.DeviceStatus.DeviceTotalMemory; long memUsageLimit = Microsoft.Phone.Info.DeviceStatus.ApplicationMemoryUsageLimit; long currentMemUsage = Microsoft.Phone.Info.DeviceStatus.ApplicationCurrentMemoryUsage; // WP8.0. ulong committedLimit = Windows.Phone.System.Memory.MemoryManager.ProcessCommittedLimit; ulong committedBytes = Windows.Phone.System.Memory.MemoryManager.ProcessCommittedBytes; // WP8.1. ulong usageLimit = Windows.System.MemoryManager.AppMemoryUsageLimit; ulong currentUsage = Windows.System.MemoryManager.AppMemoryUsage; MemoryManager.AppMemoryUsageIncreased += OnAppMemoryUsageIncreased; MemoryManager.AppMemoryUsageDecreased += OnAppMemoryUsageDecreased; private void OnAppMemoryUsageIncreased(object sender, object e) { switch (MemoryManager.AppMemoryUsageLevel) { case AppMemoryUsageLevel.High: break; case AppMemoryUsageLevel.Medium: break; case AppMemoryUsageLevel.Low: break; }
19
private void Init() { MemoryManager.AppMemoryUsageLimitChanging += OnAppMemoryUsageLimitChanging; } private void OnAppMemoryUsageLimitChanging( object sender, AppMemoryUsageLimitChangingEventArgs e) { Debug.WriteLine(String.Format( "AppMemoryUsageLimitChanging: old={0} MB, new={1} MB", (double)e.OldLimit / 1024 / 1024, (double)e.NewLimit / 1024 / 1024)); }
21
ResourceAllowed? Microphone Camera Proximity Gyro Compass Accelerometer Vibrator Push SpeechSynthesis SpeechRecognition Audio InterruptiveUI
23
DeviceParticipating tasksCountCapMax BGMax FG 512MBBackground transfer11855180 1GBBackground transfer539025365
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.