Use Wi-Fi
In most cases a Wi-Fi radio will offer greater bandwidth at a significantly lower battery cost. As a result, you should endeavor to perform data transfers when connected over Wi-Fi whenever possible.
You can use a broadcast receiver to listen for connectivity changes that indicate when a Wi-Fi connection has been established to execute significant downloads, preempt scheduled updates, and potentially even temporarily increase the frequency of regular
updates as described in Optimizing Battery Life lesson
Determining and Monitoring the Connectivity Status.
Use Greater Bandwidth to Download More Data Less Often
When connected over a wireless radio, higher bandwidth generally comes at the price of higher battery cost. Meaning that LTE typically consumes more energy than 3G, which is in turn more expensive than 2G.
This means that while the underlying radio state machine varies based on the radio technology, generally speaking the relative battery impact of the state change tail-time is greater for higher bandwidth radios.
At the same time, the higher bandwidth means you can prefetch more aggressively, downloading more data over the same time. Perhaps less intuitively, because the tail-time battery cost is relatively higher, it's also more efficient to keep the radio active
for longer periods during each transfer session to reduce the frequency of updates.
For example, if an LTE radio is has double the bandwidth and double the energy cost of 3G, you should download 4 times as much data during each session—or potentially as much as 10mb. When downloading this much data, it's important to consider the effect
of your prefetching on the available local storage and flush your prefetch cache regularly.
You can use the connectivity manager to determine the active wireless radio, and modify your prefetching routines accordingly:
ConnectivityManager cm =
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
TelephonyManager tm =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
int PrefetchCacheSize = DEFAULT_PREFETCH_CACHE;
switch (activeNetwork.getType()) {
case (ConnectivityManager.TYPE_WIFI):
PrefetchCacheSize = MAX_PREFETCH_CACHE; break;
case (ConnectivityManager.TYPE_MOBILE): {
switch (tm.getNetworkType()) {
case (TelephonyManager.NETWORK_TYPE_LTE |
TelephonyManager.NETWORK_TYPE_HSPAP):
PrefetchCacheSize *= 4;
break;
case (TelephonyManager.NETWORK_TYPE_EDGE |
TelephonyManager.NETWORK_TYPE_GPRS):
PrefetchCacheSize /= 2;
break;
default: break;
}
break;
}
default: break;
}
分享到:
相关推荐
with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute ...
Unlike traditional video steganography, motion-vectors-based steganographic approaches embed messages by modifying the motion vectors of the cover video. The scheme may produce little quality ...
* The exact version of the Internet Explorer installed on your system. If you can provide me with a minimal application which reproduces the problem, I can almost guarantee that I will be able to ...
on detecting (the main goal of this research), tracking, extracting, and modifying secret messages transmitted through a covert channel. In this paper, a feature classification technique, based on the...
Finally, you’ll tinker with the firmware of the Photon and Electron by modifying the existing firmware and deploying them to your boards. By the end of this book, you should have a fairly good ...
If you are integrating a new display, you must configure and provide the parameters of your display based on its specifications via the OpenWF Display Configuration API (Wfdcfg Library).
"work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER ...
"work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER ...
Adding Location-Based Services to Your Application 88 Debugging Your Application on Hardware 90 Summary 92 Quiz Questions 93 Exercises 94 References and More Information 94 II: Android Application ...
Microsoft Windows Server 2012 70-410 Series Introduction
Our solutions are elegant in that they do not require modifying the C11 compiler or the semantics of C11. We also discuss another problem that arises because C11 allows base class pointers to point to...
using the Test Automation Engine, which drives WinRunner based on the input provided by the tables. This technique is used to test our highly complex PC based Billing Application for the Client and ...
Starting from the basics of theme setup and configuration, you will learn about the Drupal theming architecture and the PHPTemplate engine, and then move on to modifying existing themes and building ...
What you will learnIdentify performance bottlenecks in an applicationLocate application hotspots using performance toolsUnderstand the work done under the hood by EE containers and its impact on ...
Compiling on the Command Line The Foundation Classes MFC Source Code Header Files MFC Libraries Summary Chapter 2: The Wizards and The Gallery AppWizard Starting AppWizard Choosing Your ...
LiveCD based on Ubuntu Linux that can be used in any computer with an x86 processor, without modifying the computer’s existing OS. This CD contains all the source code in the book and provides a ...
What you will learnIdentify performance bottlenecks in an applicationLocate application hotspots using performance toolsUnderstand the work done under the hood by EE containers and its impact on ...
Some Final Comments on the MOV Instructions <br>4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 Editing Your Source Files 4.9.3 The ...
In the framework of model-based software development, applica- tion functions are checked in an iterative process. This involves repeated runs of the model in Simulink from The Mathworks. Depending ...
Packaging Your Application As an APK File and Installing It on the Device Testing and Debugging Mobile Utility Applications Installing AIR on an Android Device via a Server Other Tools Conclusion ...