180 likes | 197 Views
Best Practice to optimize iPhone app which will explain to you how you can reduce the battery consumption while using the iOS based app.
E N D
iOS Application Battery Optimization Techniques Minimise the Burden on Battery
How to Increase an iPhone Battery Usage People find battery a serious concern but few iOS app designing tips and can easily extend the battery usage of an iPhone without compromising the . Perhaps the most ignored tip is keeping your iPhone beyond the reach of hot sun or avoid leaving it in a hot car. Heat shortens the battery’s performance significantly
Turn Down the Volume In order to minimize the impact of audio on your iphone it is recommended to turn down your volume as well as prefer headphones when Possible. Go to Setting>Music to set a volume limit as well as to turn off the EQ in order to save even more battery
Stop the Location Services It is evident that when your iphone is used to track location then it drains huge amount of battery. You can stop this by going into Setting>Privacy>Location Services and turn off any app that you don’t want should track you. Going a step further you can also turn off the Frequent Location, Diagnostic and Usage and Location-Based iAds by going into Setting>Privacy>Location Services>SystemServices
Turn Off Unnecessary Animations Parallax effect and Dynamic Wallpapers are for sure two very attractive thing on your iPhone but impact your iPhone Battery very negatively. Once you put a pause on these it will surely save you substantial amount of battery. To do this go to Settings>General>Accessibility and turn on the Reduce motion. Now go to Settings>Wallpapers & Brightness> Choose Wallpaperand select some static wallpaper
Turn Off Unnecessary Animations Parallax effect and Dynamic Wallpapers are animated using information via iPhone’s sensors about the way in which you are holding and moving the phone hence these effect drain a substantial amount of battery
Do the Download Beforehand There are multiple movie and music streaming services where option to download the data for offline listening and viewing is available. Streaming data using the iPhone data pack will put extra burden on the device battery. Now downloading ahead of time you want it will enable your battery to go further.
Smart Prioritization for Remote Notification Delivery There are multiple elements contained within the remote notifications delivered by the server to Apple Notification Service like payload data, an expiration date and a priority. Notifications can be delivered immediately or can be scheduled for an energy-efficient time. Here using two levels of push priority you can you can decide which notification to be delivered instantaneously or need to be sent later.
Discover those Services and Characteristics that You Actually Need A peripheral usually has more than enough services to perform specific use case in an app. It is therefore, recommended to figure out the particular services and characteristics required by your app. This can be done using particular UUIDs to discover services: and discoverCharacteristics:forService: methods of the CBPeripheral class
Discover those Services and Characteristics that You Actually Need Discovering particular services OBJECTIVE-C // Look for services matching a specific set of UUIDs [peripheral discoverServices:@[firstServiceUUID, secondServiceUUID]]; SWIFT // Look for services matching a specific set of UUIDs peripheral.discoverServices([firstServiceUUID, secondServiceUUID])
Discover those Services and Characteristics that You Actually Need Discovering particular service characteristics OBJECTIVE-C // Look for characterstics matching a specific set of UUIDs for a given service [[peripheral discoverCharacteristics:@[firstCharacteristicUUID, secondCharacteristicUUID] forService:interestingService]]; SWIFT // Look for characterstics matching a specific set of UUIDs for a given service peripheral.discoverCharacteristics([firstCharacteristicUUID, secondCharacteristicUUID], forService: interestingService)
Disconnect from the Device When You Don't Need It To avoid your app from meaninglessly using the device’s radio simply disconnect it from a peripheral device if some characteristic is no longer providing notifications or even if the extra data is not required anymore. Cancel every notification subscriptions by passing a value of NO to the setNotifyValue:forCharacteristic: method of the CBPeripheral class. Now disconnect from the device by calling the cancelPeripheralConnection: method of the CBCentralManager class
Disconnect from the Device When You Don't Need OBJECTIVE - C // Unsubscribe from a characteristic value [self.peripheral setNotifyValue:NO forCharacteristic:interestingCharacteristic]; // Disconnect from the device [self.myCentralManager cancelPeripheralConnection:peripheral]; SWIFT // Unsubscribe from a characteristic value self.peripheral.notifyValue(false, forCharacteristic: interestingCharacteristic) // Disconnect from the device self.myCentralManager.cancelPeripheralConnection(peripheral)
Multiple factors affect the amount of energy required to do the network operations on a device. Cellular network activity requires much more energy than performing an activity over Wi-Fi. • Poor or fluctuation in signal conditions may result in slow or problematic transactions, which must be avoided. • Low network throughput (bandwidth) means radios need to stay more than usual for performing the transactions. • The geographic location and preferred cellular provider can affect the amount of energy consumption because signal conditions and throughput vary very often.
Guideline for content refresh optimization Try to limit the number of views your app uses. • Avoid using opacity especially for the content that changes frequently. • Prefer only recommended frameworks while developing games. These frameworks are optimized to provide good performance.