The XDA LG QPair Developer Challenge Voting Has Begun!

It seems like it was just yesterday that weannounced that we had paired up with LGto … more

Major Update for the Sony Smartwatch 2 Brings DND and More

With the wearables landscape now dominated by Android Wear and Pebble, its … more

How to Root Android Wear 5.0.1 Lollipop Devices – XDA TV

The Lollipop update for Android Wear devices has hit the market and people are … more

Android 5.0.2 and New Factory Images For Nexus 7 (Wi-Fi) Available

Android 5.0 is has been publicly available since early November, and the … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[20.04.2010][v0.66] WMLongLife - Save your gonads (and battery) !

OP Chainfire

3rd February 2009, 02:08 AM   |  #1  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Note this is a BETA version and will have issues.

About
WMLongLife is an automatic 2G/3G band-switching solution. It will keep your device in 2G when you do not need to use 3G, and will switch to 3G automatically when you do need it. For most users, having your device in 2G uses much less battery, and thus your phone lasts longer on a single charge. 2G also usually generates less radiation than 3G, so it will likely be better for your gonads (if you have them) as well (see this thread for a discussion about that) - think of your hypothetical future children!

Main features
  • 2G/3G (auto)/3G (only) automatic band switching based on:
    - Running programs and their needs
    - Availability of Wi-Fi
    - Availability of USB
    - Roaming [note: most roaming options have been removed, use the RoamFreely (marketplace) tool instead]
  • Idle data connections disconnect based on running programs (note that unlike the registry tweak this does not break simultaneous voice/data)
  • Manual band switching
  • Automatically disable data when roaming (including AGPS)
  • Pauses applications while switching bands (so you don't get networking errors)
  • Several predefined applications supported
  • Support for HTC/MSM72xx GSM devices (GSM/EDGE vs UMTS/HSDPA)
  • Support for HTC/MSM75xx CDMA devices (1xRTT vs EV-DO)
  • Support for various Samsung GSM devices (GSM/EDGE vs UMTS/HSDPA)

How to use
The manual is in the post below this one. Give it a quick skim!

License?
You can use this yourself on your own devices, if-and-only-if you download it from this post. You are not allowed to (re)distribute this app, not to your brother, not to your friends, not to anyone. Cooking it into your ROM and then distributing that is obviously also not allowed.

I reserve the right to turn this into something commercial if I want. I'm not planning it, but lets just cut the crap and say it may eventually happen (avoid BS like the last time). Should that happen, as last time, people who helped out will get taken care of.

Is this guaranteed to save battery?
No, it is not. If it will or will not save battery is dependent on your configuration of WMLongLife, your 'average' network conditions, your radio, and usage. The default WMLongLife configuration will give you (also depending on those other factors) a nice average between least and maximum savings while trying to be not too annoying. Radio firmware is very tricky, and results vary all across the board. It is likely there is a radio thread for your specific device, if you are comfortable with flashing devices, flashing a different radio may give you better (or worse) connectivity and battery life. How your usage effects all this should be obvious: if all you do with your phone is watch YouTube until the battery goes flat, WMLongLife will not help you [at all]. If you pretty much use at as a phone with additional email and some browsing / Google Maps here and there, you may definitely see benefits. It all depends.

Now let's get to the most interesting part: network conditions. 3G [at least in theory] uses less battery than 2G under ideal conditions. However, these ideal conditions are hardly ever reached. A lot of battery is spent finding a decent/better 3G signal to use instead of 2G - and I mean a lot. If 3G is few-bars or just an unreliable signal in your area, your device will not just use a lot, it will use massive amounts of battery trying to get a [better] 3G signal. Aside from that, if the conditions are less than ideal, 2G may use less power than 3G. As an example, I am personally in an area with excellent 3G coverage (5 out of 5 bars of HSDPA) and my device still lasts nearly twice as long on a single charge with WMLongLife running. Your mileage may vary, of course. While it is completely possible that it may not make a relevant difference in your case, I would say there will be many people who this does make a difference for. This is also the reason you will see many people advising in "battery saving" threads to disable 3G and attesting to how much battery it saves for them, and others will always respond that it doesn't make a difference [for them].

Having an idle(!) data connection should theoretically not make a difference with power usage, you have the connection anyway, it's just a question about whether you have an IP or not. However, some background applications (inside services mostly) will initiate data transfers if (and only if) a data connection is already up. So if you have an idle data connection, these applications would start using data, while if you did not have a data connection (connected), they would not.

Supported devices
This is a list of device it should work on, most of them have not been reported to work since 0.2, though.
  • HTC Touch Cruise
  • HTC TyTN II
  • HTC Touch Diamond GSM + CDMA
  • HTC Touch Pro GSM + CDMA
  • HTC Touch HD
  • HTC Touch Diamond II GSM + CDMA
  • HTC Touch Pro II GSM + CDMA
  • HTC HD2
  • Samsung i780
  • Samsung Omnia GSM
  • Samsung Omnia II GSM
  • Samsung Giorgio Armani II
  • Sony Ericsson Xperia X1
  • Palm Treo Pro

Suspected to work on (never been tested, not even on 0.2):
  • HTC Titan/Mogul
  • HTC Vogue
  • HTC Touch 3G
  • HTC Touch Cruise II
  • HTC MAX 4G
  • Samsung Epix
  • Toshiba TG-01 ??

Important release notes
Currently known issues and problems and the changelogs are listed in the 4th post of this thread.

Donate

DONATE ! - Come on, almost 30 000 users and no more than a handful of donations ?

Download
downloads before 0.66: 26977
Attached Files
File Type: cab WMLongLife-0.66-0302.cab - [Click for QR Code] (682.7 KB, 25540 views)
Last edited by Chainfire; 8th May 2010 at 12:54 AM.
The Following 2 Users Say Thank You to Chainfire For This Useful Post: [ View ]
3rd February 2009, 02:08 AM   |  #2  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
WMLongLife API (new in 0.65)
I added a really small and simple API as it has been requested by several people.

The DLL file is WMLongLifeAPI.dll and is installed in your \Windows. Use LoadLibrary and GetProcAddress to get at the functions.

Here are the function definitions:

Code:
DWORD WMLL_APIVersion();

BOOL WMLL_IsRunning();

#define BAND_SWITCH_WMLL 0
#define BAND_SWITCH_2G 1
#define BAND_SWITCH_3G_AUTO 2
#define BAND_SWITCH_3G_FORCE 3
VOID WMLL_BandSwitch(DWORD band);

VOID WMLL_DataDisconnect();

VOID WMLL_ReloadSettings();
DWORD WMLL_APIVersion();

Returns the current API version. WMLongLife 0.65 returns 0x100 - or API version 1.00.

BOOL WMLL_IsRunning();

Returns whether or not WMLongLife is loaded and running. Note that WMLongLife can take up to a minute (sometimes longer) to activate itself.

VOID WMLL_BandSwitch(DWORD band);

Instructs WMLongLife to switch bands.

As band parameter use one of the BAND_SWITCH_* values listed above. BAND_SWITCH_WMLL returns control of band switching back to WMLongLife. Note that this may happen automatically when the screen goes off, this depends on WMLongLife configuration options.

VOID WMLL_DataDisconnect();

Instructs WMLongLife to disconnect all cellular data connections.

VOID WMLL_ReloadSettings();

Instructs WMLongLife to reload all settings from registry.
Last edited by Chainfire; 26th January 2010 at 11:15 PM.
3rd February 2009, 02:08 AM   |  #3  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
The Manual (0.5 and newer) - READ IT!


The Manual
NOTICE: The manual is written for version 0.5 and newer!


Usage notes
I have done my best to let WMLongLife be as least annoying as possible. The idea is (with the default settings) that a band-switch should occur only once in a phone 'session'. Where by a session I mean a screen-on / use device / screen-off cycle. This also means WMLongLife may not switch back to 2G when you expect it to - WMLongLife tries to be smart about things to reduce the number of band-switches but still keep a fairly optimal 2G/power use. Please keep in mind this is a beta release.


Things you should know
WMLongLife generally does not kick-in until you have both entered your PIN (if applicable) at boot, and the screen has been off for about half a minute. There are exceptions to this rule - if you override the current band selected by using the Band Switcher app, WMLongLife will start operating from then on.

When band-switching, the icon in the top bar may stay on 2G (G, E, 1X, etc) for a while before it switches to a 3G icon. This does not mean you are not already using 3G, there is a delay in this display.


Issues
Known issues are listed in the post below this one.


Installation
Installation is easy:
  • Copy the WMLongLife.cab file to your device and open it to install it.
  • Go into WMLongLife configuration and make sure to check/configure the following options:
    - Radio / Radio chip model (and GSM band for Samsung radios)
    - Radio / Restart push mail after band switch
    - Roaming - All options
    These are likely to be detected and set correctly, however I advise you check them anyways. Details about these options can be found in the configuration section below.
  • Optional: Go to Start -> Settings -> Personal -> Buttons, and assign a button to the Band Switcher application
  • Soft-reset

The configuration options in WMLongLife are supposed to have "sane defaults", the setup which I expect will work best for most users.

Please note some beta testers have reported they need to soft-reset twice after installation/upgrade before WMLongLife works


Upgrading
If you are using version 0.2 or older, please remove it manually. All newer versions should be a simple case of copying the new CAB file to your device and opening it to install it without the need to uninstall the old version first. A soft-reset is necessary.

Please note some beta testers have reported they need to soft-reset twice after installation/upgrade before WMLongLife works


Uninstallation
Before uninstallation, there are two things you should do:

1) Open the Band Switcher application, and switch to "3G (auto)" mode
2) If you have roaming options enabled, make sure you are NOT roaming when uninstalling

After these two points, simply uninstall WMLongLife using Windows Mobile's Remove Programs function.


Popup when an unknown application tries to connect to the internet
Please see the application-specific configuration section below - it uses the same screen.


Band Switcher application
Currently this application is not skinned / nice-looking because it still contains some debug functionality.

This application can be used to manually instruct WMLongLife to switch to 2G, 3G (auto) and 3G (only) bands. While WMLongLife should do all this for you at the right time, there will be times when you want to override. It also offers the feature to disconnect cellular data connections, and jump to the configuration application.

There is also a "WMLongLife controlled" button. This will return band-switching control to WMLongLife if you have previously selected a band manually. If the Screen / Return control to WMLongLife when the screen turns off option is enabled, this will also automatically happen when the screen goes off - and stays off for a while.


Configuration
The configuration application offers access to the myriad of features that are present in WMLongLife. It is divided into three main screens: home (about), settings, and application-specific settings.

Configuration - Settings

Radio / Radio chip model
Select the radio model you are using here. This should be auto-detected on first installation. If this option is not set correctly, WMLongLife will not switch bands.

Radio / 3G mode
By default when WMLongLife switches to 3G, it uses the 3G (auto) mode. This lets your radio decide whether to use 2G or 3G, based on signal. The other mode is 3G (only). This mode will force the radio to use only 3G, and you will have no signal if only 2G is available.

Radio / GSM band for Samsung radio
If you are using the Samsung radio option, you will need to configure your GSM band here. Unfortunately there is currently no way to detect this.

Radio / After switching to 3G, connect to
This option allows you to set a connection to automatically connect to after WMLongLife has switched the device to 3G.

Radio / Restart push mail after band switch
Enable this option if you are using Microsoft push mail (Exchange Sync). It should be auto-detected, but this detection is not always perfect. If you are not using Microsoft push mail, I strongly advise you to turn this option off!

Screen / Switch to 3G when the screen turns on
Enabling this option will switch to 3G every time your screen turns on.

Screen / Switch to 2G when the screen turns off
Enabling this option will switch to 2G every time your screen turns off.

Screen / Screen off 2G switch delay
This configures how long to wait after the screen has turned off before switching to 2G. WMLongLife does not switch immediately after the screen goes off, as often you will turn on your screen again - if for example you were doing something but the screen went off automatically.

Screen / Return control to WMLongLife when the screen turns off
This option is relevant to the Band Switcher application. If you manually select a band to switch to in Band Switcher, WMLongLife will temporarily not switch bands itself. In Band Switcher there is also a button to return band-switching control to WMLongLife. If this option is enabled, band-switching control will be returned to WMLongLife automatically after the screen turns off (the Screen off 2G switch delay is also taken into account here).

Screen / Show band switch notification
This option configures whether or not you will see an On-Screen Display when WMLongLife switches bands.

Screen / Vibrate notifications
Very handy for debugging! When this option is enabled, WMLongLife will vibrate when loaded, when ready, and when switching. It may take WMLongLife over a minute to be actually loaded after the device is booted. When it is, it will vibrate very shortly three times (it may feel like a single long vibration). When WMLongLife is ready to allow automatic switching, it will vibrate shortly twice. When WMLongLife actually switches bands, it will vibrate once.

Applications / Switch to 3G on whitelisted application launch
This option configures whether or not to switch to 3G when you launch an application you have configured to use 3G. This is the heart of WMLongLife, disabling this option would usually not make any sense.

Applications / Switch to 2G on whitelisted application close
This option configures whether or not to switch to 2G when you close an application you have configured to use 3G. This option is disabled by default, and WMLongLife will switch back to 2G when the screen goes off instead. Enabling this option would make for a lot of band-switching to occur, while disabling this option ensures a band-switch should only occur once per 'phone-usage-session'.

Applications / Internal cache timeout
WMLongLife maintains an internal cache of all application windows. Because of technical reasons, the cache of these windows needs to be purged every once in a while. I recommend (for now) to keep this option set to 30 seconds.

Wi-Fi / Switch to 2G when Wi-Fi is connected
Enabling this option (default) will make WMLongLife switch to 2G when you connect to a Wi-Fi network.

USB / Switch to 2G when USB is connected
Enabling this option will make WMLongLife switch to 2G when you connect your phone to your computer using USB. This option is disabled by default, as it may cause excessive bandswitching if you are one of those people who cradle / uncradle their device often. USB also usually means charging, so the extra power needed for 3G is usually not an issue in this case.

Data / Disconnect idle connections
Enabling this option will disconnect idle data connections. If you have push mail enabled (and this is detected correctly) this option is turned off by default, else it should be turned on.

Data / Idle connection timeout
This option configures how long a data connection needs to be idle before WMLongLife disconnects it.

Data / Disconnect idle connections when the screen is on
If this option is not enabled, WMLongLife will only disconnect data connections when the screen is off.

Data / Disconnect idle connections when the applications are running
If this option is not enabled, WMLongLife will not disconnect data connections when a whitelisted application is running.
Last edited by Chainfire; 29th July 2009 at 06:08 PM.
3rd February 2009, 02:08 AM   |  #4  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
The Manual #2 (0.5 and newer) - READ IT! + Some screenshots from 0.55 (resized)
Data / Disallow background connections
When this option is enabled, WMLongLife will deny access to applications creating so called "background" connections, and only allow "interactive" connections. When an application connects to the internet, it tells Connection Manager some specifics. Only interactive applications like browsers / YouTube / etc should create "interactive" connections, while other application that need something from the internet but which you did not manually initiate should create "background" connections. Obviously this setting only has an effect on applications that set this information correctly. If you have connection notifications turned on, "interactive" connections are the ones that pop-up a "Connecting to ..." bubble - "background" connections do not do this.

Roaming / Disable cellular data connections when roaming [no longer available in 0.65, use RoamFreely instead]
This option allows you to configure which data connections you want to disable when you are roaming.

Roaming / Switch to 2G when roaming
When this option is enabled, WMLongLife will switch to 2G when you are roaming.

Roaming / Treat 2G as roaming [no longer available in 0.65, use RoamFreely instead]
When this option is enabled, WMLongLife will treat a 2G signal as if you are roaming. Obviously, when using this option, you should disable all other options that may make the device switch to 2G - if you don't, this will result in WMLongLife always thinking you are roaming.

Roaming / Turn off AGPS when roaming [no longer available in 0.65, use RoamFreely instead]
This option should only be enabled if you actually use AGPS. This should be auto detected upon first installation, however this detection does not always work correctly. If you do not use AGPS, make sure this option is turned off. If you do not use AGPS but this option is enabled, WMLongLife will also enable AGPS when you are not roaming. If your AGPS is not properly configured, this may slow down normal GPS operation.

Configuration - Application specific
WMLongLife comes preconfigured with optimal settings for various common applications. However, should you use an application that is not listed here, WMLongLife will automatically pop-up a configuration box when that application tries to use the internet. It is not possible to manually add or remove applications from the application list - and this is completely unnecessary!

The application specific configuration screen shows the list of configured applications, and icons to show their currently configured options. When you click an application in the list, the application configuration screen will popup.

There are five options in this popup: 3G, Screen/Off, Wi-Fi and USB.

3G
This option decides whether or not WMLongLife should give 3G to this application. If the 3G option is not enabled, all the other options are not relevant.

Screen/Off
This option decides whether or not WMLongLife should give 3G to this application, even if the screen is turned off. Most applications do not need this - pretty much the only exceptions are tethering applications.

Wi-Fi
This option lets WMLongLife know if this application can use Wi-Fi instead of 3G for its internet connection. Most applications can, however obvious exceptions are (again) tethering applications.

USB
This option lets WMLongLife know if this application can use USB instead of 3G for its internet connection. Most applications can, however obvious exceptions are (again) tethering applications.

Background time-out
This option configures how long WMLongLife will treat an application as "running" if it has not been actually visible on your screen. This only applies to applications that do not actually close when you press the "X" button. If an application is truly closed, WMLongLife will immediately treat it as "not running". However, applications like for example the Opera browser will always remain running in the background, whether you are using them or not, these will be treated as "not running" when they have not been "seen" for the length of time the background time-out is configured.

Most applications should be fine with a setting of 5 minutes or less. Applications that continue to use the data connection (like tethering applications) should have the time-out disabled.

----


Last edited by Chainfire; 26th January 2010 at 10:41 PM.
3rd February 2009, 02:08 AM   |  #5  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
To-do & Issues & Changelogs
To-do & Issues
  • [bug] Sometimes WMLL will not switch when device is booted in 2G *not reproducable so far*
  • [bug] Allow ConnMgr connections not directed at cellular networks while switching
  • [bug] Some device/rom combo's drain battery with WMLL... unattended mode issue? *not reproducable so far*
  • [improvement] Rethink "screen on --> 3G" strategies to be less annoying... perhaps detect user opening the dialer?
  • [improvement] Improve switching on Samsung devices and auto mode 2g/3g priority
  • [feature] Auto switch to 3G (auto) if no signal can be found in 2G or 3G (only) modes
  • [feature/maybe] Make smaller 'switching bands' notification
  • [feature/maybe] Add option to let the user select band on specific application launch (maybe also Wi-Fi ?)
  • [feature/maybe] Add option to let the user deny internet access completely to specific applications
  • [skin] Finish/update missing gfx target: 0.70
  • [skin] Skin BandSwitcher app target: 0.70

Changelog - 0.66.302 (PUBLIC)
  • [feature/maybe] Add option to allow background connections only on 3G etc [fixed bug, added option] PLEASE RECONFIGURE THE "DISALLOW BACKGROUND CONNECTIONS" OPTION !
  • [feature] Timebomb removed

Changelog - 0.65.287 (PUBLIC)
  • [bug] Find/fix unattended mode sometimes not working [fixed ?]
  • [bug] Something is broken with the idle data disconnect [fixed ?]
  • [improvement] Minor algorithm changes
  • [improvement] Minor settings handling changes
  • [improvement] Made vibrations a bit longer, as on some devices they were not noticable
  • [improvement] Improve push mail restart (now sometimes pops up ActiveSync) [implemented]
  • [removal] Most roaming functions have moved to my RoamFreely app. Details about how and why can be found in the 0.65 release notes
  • [addition] A simple API has been added

Changelog - 0.62.211 (PUBLIC)
  • Experimental HD2 changes

Changelog - 0.60.200 (PUBLIC)
  • [feature] Added option to immediately start an internet connection after switching to 3G
  • [feature] Added vibrating notifications
  • [feature] Added option to disallow "background connections"

Changelog - 0.60.191
  • Config and AppConfig now much faster (usable now )
  • Added several preconfigured applications, including some who are not configurable through the Config app to prevent issues
  • Improved IPC
  • Added friendly descriptions for the preconfigured apps
  • Modified loading pattern
  • Fixed screen-on/3g-switch/call-drop issue
  • Improved skin compression (+- 50%)
  • [bug] After user band override, treat as screen has been off (no more waiting)
  • [bug] Find/fix issue with sometimes not loading
  • [bug] Improve connected-to-network detection
  • [bug] Find/fix configuration lost issue (hopefully)
  • [bug] Wi-Fi on -> Opera (stays in 2G) -> close Opera -> Wi-Fi off -> 3G - should stay in 2G (hopefully)
  • [feature] Implement Omnia II compatibility
  • [feature] Add option to not show OSD notifications
  • [feature] Implement roaming options
  • [feature] Added support for disabling AGPS while roaming
  • [feature] Added support for Samsung's "uber-fast" band switching (can still be improved)
  • [feature] Add current status to config app
  • [skin] Select-popup-box skinned
  • [skin] Program-state-icons skinned
  • [skin] Added (temporary) program icons
  • [skin] Implement (W)QVGA skin

Changelog - 0.50 (beta - private)
  • Added support for Samsung Omnia
  • Addes support for MSM75xx (HTC CDMA) devices
  • Added several preconfigured applications
  • Turned WMLongLife into a service
  • Created separate configuration app
  • Created separate application-specific configuration app
  • Application-specific configuration app pops up on new unknown connection
  • Applications are now 'paused' when the band switch is made
  • Added various configuration options
  • Added BandSwitcher application
  • Added code to cope with Wi-Fi and USB connections
  • Many adjustments to application detection and handling
  • Usable full-time

(0.5 = changes since 0.2, written after the fact, is not complete)
Last edited by Chainfire; 20th April 2010 at 07:01 PM.
3rd February 2009, 02:14 AM   |  #6  
Cal-El's Avatar
Senior Member
Flag Golden Valley, MN
Thanks Meter: 78
 
1,690 posts
Join Date:Joined: Jul 2008
More
You are a genius and you are super witty to boot! Thanks, I will report bugs if I find any!
3rd February 2009, 02:45 AM   |  #7  
DaVince's Avatar
Senior Member
Flag Manila
Thanks Meter: 31
 
783 posts
Join Date:Joined: Aug 2006
More
This is brilliant.. if only I had a MSM device..
3rd February 2009, 03:04 AM   |  #8  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
i780 is also on the to-do list.. I just happen to have one lying here next to me
3rd February 2009, 03:58 AM   |  #9  
Soul_Est's Avatar
Senior Member
Flag Mississauga
Thanks Meter: 13
 
165 posts
Join Date:Joined: Dec 2007
More
Sounds like something these MSM based 3G smartphones need (especially those for CDMA networks). I'll definitely test it and give you my feed back.
3rd February 2009, 04:07 AM   |  #10  
Chainfire's Avatar
OP Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 55,549
 
9,469 posts
Join Date:Joined: Oct 2007
Donate to Me
More
Quote:
Originally Posted by Soul_Est

Sounds like something these MSM based 3G smartphones need (especially those for CDMA networks). I'll definitely test it and give you my feed back.

Well as stated everywhere, this is only for GSM... there's no CDMA equivalent. (perhaps one day?)

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes