Direct http push - Windows Mobile Software Development

This is by far my push solution. It does not need any open connection between the phone and the server. True and pure push. This solves the problem of 5-min timeout with many 3G providers such as Verizon. Such 5-min timeout kills battery, because push is like 5-min polling. Both ActiveSync and IMAP idle suffers from the timeouts.
Before, 4 hours of push running would drain 10% battery, now with my direct http push, 10% will run the phone for 24 hours, like it is no push running at all!
Here is how to do it:
1) Run Depeche, a http server for PPC. Modify the SimplTex ISAPI to tell Outlook to sync mail when it gets a http request.
2) Run Pocket DynDNS to update "mypocketIP.homeip.net". This program works, but it uses Sleep(60 seconds) to update DynDNS. You know, Sleep() does not work as soon as the phone goes into suspend mode. So I made "XinServerManager", a service similar to "XinConnManager", to keep the connection and meanwhile call PDD to update dyndns immediately after a new (re)connection. Then kill the PDD.
3) Run PPC emulator on a XP machine and run a slightly modified xImapPusher on top of it. When email arrives, it sends a http request to my phone and the phone then will do a sync to get the new mail.
The only requirement is a public IP address on the phone. At least Verizon offers this, not sure about other carriers.

:s....man can you make a sort of guide for this ? U explained it all in a hurry and to an average (me) user it makes some sense..but still i cant understand enough to implement this :S

Related

Exchange Server

Long time user of windows mobile devices and long time reader of this great forum ( well nearly 2 years anyway )
I've not contributed much as I dont posses the knowledge that some of you guys have.
For those new people that come on here the only advice I would ever give is search and read, the answers are nearly always there.
Anyway on to my point.
I have just set up an exchange server ( windows small business server 2003 ) and have things syncing across the airwaves nicely.
Laptop, desktop and mobile device all saying the same thing with no duplicates poping up. ( Always seemed to be a problem when syncing between two computers, for me anyway )
Also able to use Outlook Web Access.
Set this up for myself for a couple of reasons, firstly to make sure all computers where synced properly and secondly because it was worth a challange to learn how to do it.
If there are any people out there that would like the facility that exchange server gives PM me, as i will give it a go setting it up.
You will get exchange server syncing ( calender, contacts, tasks and emails ) with desktop/laptop outlook, outlook web access and an email address that you will can use to forward existing mail to. ( sorry only way to get emails to you )
Going to open this up for a couple or more people mainly to get it working properly. ( so far no problems for myself )
If I do open it up for more a donation would be nice to help pay for the outlay of equipment and for the increase in my electric bill to keep it going.
So if anyone is interested feel free to PM me.
What do you have it running on? Looking at doing the same myself.
Just a bog standard computer, nothing special
An old MSI K8 Neo motherboard with an Athlon 64 3000 2 Gig ram
Dual 250 gig discs in raid mirror for data
and a 120gig for operating system
Windows 2003 small buisness server with R2 technologies
it was also an excuse to upgrade by desktop as well.
well chuffed with how seamlessly it works with the syncing.
do you have microsoft direct push enabled on that exchange server? I would like to do that myself, don't know if it's possible
Yes got it set up.
They call it direct push but i think it goes more along the lines of your phone keeping a link open to the exchange server then as soon as an email is recieved it gets pushed across.
From what ive seen so far i'm sure the battery life is longer now than having the phone looking at a set time period for new mail.
Easy to set up as well, especially the phone side.
thanks, is the direct push functionality included in exchange server. Is it on the install cd's? I'd like to install it for my own domain, don't want to spend lots of money on blackberry server or services.
2.edge is enabled all the time on your phone, just as with blackberry? Does your phone send data at an interval, or is it the server that sends?
You need to make sure you have SP1 or R2 Technologies version for direct push with the server software
you have to set up a user profile that has permission to you the mobile services.
Also if your on a dynamic ip address its handy to have an external service set up to keep track of any changes there. And to get the full use of the server a domain name.
on the phone side you go to activesyn, and in the menu is configure server option. configure the server and thats it done.
The phone does seem to have a data connection all the time.
While i'm at work today i will write out the steps i had to do to get it working fully.
at work now so here we go :-
1) Get a domain name www.
2) If on broadband and on a dynamic IP use the services of someone like zoneedit for redirection.
(for remote access) vpn.yourdomainname to your broadband ip address
(for mail ) mail.yourdomainname to your broadband ip address
(for web ) www.yourdomainname to either your ip address if hosting it on your server or to the ip address of your web host.
(for ftp access ) ftp.yourdomainname to either your ip address if hosting it on your server or to the ip address of your web host.
follow the other instructions on zoneedit to forward the dns server addresses to your domain name admistrator.
3) Get Windows SBS or Server 2003 SP1 With R2 Technologies
4) Load onto a PC
5) Make sure all service patches and updates are loaded.
6) Download a program for updating any changes of dynamic IP address such as DirectUpdate and set up a couple of updates to the vpn mail and ftp.yourdomainname. ( easy enough follow the instructions )
7) Go through the todo list and set up wizards on the server.
a) make sure when setting up email and internet that in the creation of a certificate you put in vpn.yourdomainname
b) also make sure when setting up user access they have privilages for mobile access
8) go into internet explorer, content menu and find the certificate you have created and export it.
9) connect your phone via activesync to a computer connected to the server network and copy over the certificate.
10) run the certifcate on the phone to install it.
11) go to activesync on the phone ( can disconnect for this bit ) and set up exchange server using the vpn.yourdomainname
12) after that it should sync
I may have missed a couple of steps in that or have done something wrong but it is all the steps i can remember and it worked for me.

[BUG] on Rom 2.03 Push mail

With all 2.03 Roms and even the original Htc Rom Pushmail is working but activesync will be closed after 30 sec - 1 min. Then when you open activesync a new conection to server is made. So when you start active sync 3 times you get 3 http watchdogs. Active syncs works but not as it schould be and does in the older roms. It even has more battery usage and it will take much longer that your emails will arrive. Thats because actice sync is closed by tasmanager i think automaticly and then when the http watchdog goes down active sync is startet again to make a new connection and so on.
Sorry for my poor english.
Hello Sebastian,
like you, I found the disapperance of AS in the taskmanager curious. However AS seems to work just fine if I leave the device in stand-by. My AS-log shows normal heartbeats starting at 480s, going up to 1680s which is the default maximum windows suggested by Microsoft.
If AS were to miss a heartbeat, the heartbeat interval would stay at 480s and not increase in 300s-steps.
I suggest that you put your device on the table for 1-2 hours and then examine the CtrlLog0/CtrlLog1-files in \windows\activesync . The most important value in the log is heartbeat interval.
Fwiw, I use the official 2.03 GER-rom from HTC.
Have fun!
Looking further, I have just reinstalled SKTools on my device and had a look at the running processes. Although the task manager will not show Activesync running, the process repllog.exe (window: ActiveSync) is running in the background, eating up some ram, and seemingly working.
Do you sync over gprs or w-lan?
GPRS - AUTD will not work over WLAN, this is by design. AUTD relies on the network to transmit data even if the device is dormant, and WLAN simply does not receive data in dormant mode.
It does not work as in older roms. Here is my log file. See yourself.
hi!
does anyone have any new informations about this activsync problem?
PUSH mail does not work with spanish 2.03
After migrating from a Trinity to a Diamond, I write to confirm that official spanish 2.03.412.2 ROM has the related bug with Activesync.
Yes, the AS process remains in background, but it does not work as expected.
It opens various stupid simultaneous https connections against the Exchange server, and it closes them after a little of time. Therefore, the heartbeat is never higher than 480 seconds, and the effect is just like a 8-minute PULL mail service, with a lot of battery drain.
I have been testing an account in a Exchange 2003 SP2, and after in a Zarafa & Z-Push linux server (just an Exchange Direct Push emulation), because linux offers me better control to monitor network connections.
A "netstat" offers us that the device drops its https connections after a few minutes. Then the heartbeat is lost.
After this incredible thing, I have just tried an official 1.93.412.1 ROM, and the same account works like a charm, with a perfect heartbeat increment from 480 to 780, 1080 and 1380 seconds.
1.93 is much slower than 2.03, but it really works with PUSH email.
Any success with 2.03?

xImapPusher - based on ImapPusher-0.60

This program is based on the source code of Imap Pusher Service (17762) V0.60:
http://www.codeplex.com/ImapPusherService
Improvements:
1) No longer quit;
2) Auto recovery from socket errors;
3) Auto re-connect;
4) No mail sync after a re-connection, good for battery life.
Many service providers timeout the connection very shortly. For example, Verizon closes inactive sockets after 5 minutes. While xImapPusher can recovery from these 5-min timeouts, it is better not to raise a mail sync each and every 5 min.
5) Added a connection management service, XinConnManager.
If data connection is disconnected, this service will know immediately and reconnect and restart the push service. This service is truly event driven, so there is no periodical polling, idle all the time.
The multiple version can push multiple IMAP accounts, based on the 061 source code made by camro. Tested to work with Gmail and Fastmail.
Enjoy!
[For best battery life, set refresh interval to 28 and the multiple version is recommended even if you have only one account to sync.]
<deleted by user>
DLing & testing now! thanks fixup
any chance of being able to add more than 1 account to the .xml..?
Battery drain & stability
Until recently I was using Windows Live to get push email. This was working quite well, but nonetheless I've switched to GMail & IMAP for various reasons. I'm currently using EmailScheduler for IMAP IDLE support, but it looses connection quite frequently (as in 1-2 times per day). I also noticed that it drains the battery much more than the Windows Live solution. I did some tests with ImapPusher quite some time ago, but it wasn't stable enough.
Would xImapPusher solve these problems?
I noticed xImapPusher comes with a XinConnManager DLL; do you have the sources available for that component as well (I would like to know what I install on my device ;-).
Kind regards,
Ruud.
Possible improvement?
I've been having an idea that could possible improve performance and battery usage of IMAP IDLE solutions like these.
Basically, one would implement some kind of IMAP proxy. This proxy would consist of a socket listener (localhost only) and an IMAP IDLE client. Pocket Outlook is then configured to point to this proxy instead of the actual IMAP server.
The IMAP IDLE client would basically remain the same. However, whenever Pocket Outlook connects to the proxy and issues a LOGON command, IMAP IDLE service is suspended. All remaining Pocket Outlook commands are simply passed through over the same connection that was previously used for the IDLE command. Once a LOGOFF command comes in and Outlook closes the connection to the proxy, the IMAP IDLE client resumes IDLE operation (again, over the same connection). Of course, LOGON, LOGOFF and similar commands issues by Pocket Outlook will not be passed on to the actual IMAP server; the connection will be managed by the IMAP IDLE client.
This way, you prevent Pocket Outlook from setting up its own connection to, and authorizing with, the remote IMAP server for each incoming email. Instead it will re-use an existing authorized connection.
I'm not sure whether it makes that much of a difference, but it might be worth the effort.
Kind regards,
Ruud.
<deleted by user>
I've done embedded programming for 15 years, so you can trust my code.
Many programs, such as PortSip and EmailScheduler, are not event-driven, they keep polling which sucks battery, runs the phone hot and not reliable. XinConnManager is a true event-driven service, has no such problems.
When I have time, I'll re-write the entire ImapPusher from VB to native C++. Anything simply sucks when touchs .Net and VB.
Actually my current push solution is direct http push, very reliable and no any impact to battery life. Here is how to do it:
1) Run Depeche, a http server for PPC. Modify the SimplTex ISAPI to tell Outlook to sync mail when it gets a http request.
2) Run Pocket DynDNS to update "mypocketIP.homeip.net". This program works, but it uses Sleep(60 seconds) to update DynDNS. You know, Sleep() does not work as soon as the phone goes into suspend mode. So I made "XinServerManager", a service similar to "XinConnManager", to keep the connection and meanwhile call PDD to update dyndns immediately after a new (re)connection. Then kill the PDD.
3) Run PPC emulator on a XP machine and run a slightly modified xImapPusher on top of it. When email arrives, it sends a http request to my phone and the phone then will do a sync to get the new mail.
This is by far my push solution. It does not need any open connection between the phone and the server. True and pure push. This solves the porblem of 5-min timeout with many 3G providers such as Verizon. Such 5-min timeout kills battery. Before, 4 hours of push running would drain 10% battery, now with my direct http push, 10% will run the phone for 24 hours, like it is no push running at all!
Battery will always be worst using IDLE, this is one thing Microsoft did right. If you wanna know a little bit more, see here:
http://gudensoft.com/?p=140
Instead of using this, I moved to active sync as now Google supports it.
bsinclair said:
Battery will always be worst using IDLE, this is one thing Microsoft did right. If you wanna know a little bit more, see here:
http://gudensoft.com/?p=140
Instead of using this, I moved to active sync as now Google supports it.
Click to expand...
Click to collapse
That article is totally wrong, see my comments at the bottom. Both require an open connection, just inactive, no difference here between these two.
IMAP idle is actually better on this regard: it'll detect the 5-min timeout and make a reconnection, no push lost.
With ActiveSync, it won't detect the timeout and any mail arrived after 5 min until the next beatheart will not be pushed in time.
That's why AS makes you feel a little better on battery life. The default heartbeat is 8 min. So you do get slightly better battery life, but you pay for that with push delay. You may set "MinHeartBeat" to 300 (5 min) so you won't suffer from delay, but then the battery life is no any better than IMAP idle.
The only reason MS does not add IMAP support to WM is because they want to sell Exchange servers and the ActiveSync Direct Push service. Both Apple and Google went to this stupid route.
To address this 5-min timeout issue, I set xImapPusher to re-send the heartbeat without raising a mail sync.
BTW, MS Live push is based on IMAP idle, not ActiveSync. You know, years ago MS bought Hotmail which was Linux based, seems still Linux. Live is far more reliable than AS. Like rsenden, I too was using Live because it does not have all kinds of troubles with Gmail's AS push. However, Verizon applied the stupid 5-min timeout sometime this year or so, so I had to figure out my direct http push.
Fixup said:
I've done embedded programming for 15 years, so you can trust my code.
Many programs, such as PortSip and EmailScheduler, are not event-driven, they keep polling which sucks battery, runs the phone hot and not reliable. XinConnManager is a true event-driven service, has no such problems.
When I have time, I'll re-write the entire ImapPusher from VB to native C++. Anything simply sucks when touchs .Net and VB.
Actually my current push solution is direct http push, very reliable and no any impact to battery life. Here is how to do it:
1) Run Depeche, a http server for PPC. Modify the SimplTex ISAPI to tell Outlook to sync mail when it gets a http request.
2) Run Pocket DynDNS to update "mypocketIP.homeip.net". This program works, but it uses Sleep(60 seconds) to update DynDNS. You know, Sleep() does not work as soon as the phone goes into suspend mode. So I made "XinServerManager", a service similar to "XinConnManager", to keep the connection and meanwhile call PDD to update dyndns immediately after a new (re)connection. Then kill the PDD.
3) Run PPC emulator on a XP machine and run a slightly modified xImapPusher on top of it. When email arrives, it sends a http request to my phone and the phone then will do a sync to get the new mail.
This is by far my push solution. It does not need any open connection between the phone and the server. True and pure push. This solves the porblem of 5-min timeout with many 3G providers such as Verizon. Such 5-min timeout kills battery. Before, 4 hours of push running would drain 10% battery, now with my direct http push, 10% will run the phone for 24 hours, like it is no push running at all!
Click to expand...
Click to collapse
this sounds like a nearly perfect solution, now if it could only be done w/2-3 accounts.
i'll have to give this method a try someday when i get some freetime on my hands. thanks man!
<deleted by user>
The phone keeps connections and sockets in suspend mode, it is the service provider (mine is Verizon) that closes inactive sockets (not the connection) after a timeout (5 min in case of Verizon). You have no control about that.
However, the connection does get disconnected sometime, a random thing, that's why your program needs to wait for the "NOTIFICATION_EVENT_NET_DISCONNECT" event. Note that when you unplug your phone from our computer, it also generates this event, so your program needs to deal with that too.
How long you can use Sleep() is defined by the power settings. For example, if you set your phone to suspend in 60 seconds, you cannot use Sleep(61000). Anyway, you should not use Sleep() at all, because it'll either prevent your phone from suspending or hang your program till the phone wake up.
This is how I do wait when needed:
Code:
SYSTEMTIME GetTimeAfterSeconds(DWORD nTimeInSeconds)
{
SYSTEMTIME sTime;
FILETIME fTime;
GetLocalTime (&sTime);
SystemTimeToFileTime(&sTime, &fTime);
ULARGE_INTEGER uTime;
uTime.HighPart = fTime.dwHighDateTime;
uTime.LowPart = fTime.dwLowDateTime;
uTime.LowPart += nTimeInSeconds*1000*1000*10;
fTime.dwHighDateTime = uTime.HighPart;
fTime.dwLowDateTime = uTime.LowPart;
FileTimeToSystemTime(&fTime, &sTime);
return sTime;
}
void Wait(HANDLE hEventTimer, DWORD dwTime)
{
CeRunAppAtTime (_T("\\\\.\\Notifications\\NamedEvents\\EventTimer"),&GetTimeAfterSeconds(dwTime));
WaitForSingleObject(hEventTimer, INFINITE);
}
main()
{
HANDLE hEventTimer = CreateEvent (NULL, false, false, _T("EventTimer"));
......
Wait(hEventTimer,60);
......
CloseHandle(hEventTimer);
}
Note that WaitForSingleObject(hObject, 60000) won't work, like Sleep(60000).
SOHKis said:
this sounds like a nearly perfect solution, now if it could only be done w/2-3 accounts.
i'll have to give this method a try someday when i get some freetime on my hands. thanks man!
Click to expand...
Click to collapse
Multiple accounts sync should be easy, just tell which account to sync in the http request.
Fixup said:
I've done embedded programming for 15 years, so you can trust my code.
Click to expand...
Click to collapse
It's not that I don't trust your code; as a programmer (non-embedded Java and some C#) I'm just interested in what components like these exactly do. Anyway, I had some time left yesterday so I installed xImapPusher. So far it's working good, too early to compare battery usage with EmailScheduler yet though.
Fixup said:
Actually my current push solution is direct http push, very reliable and no any impact to battery life.
Click to expand...
Click to collapse
This indeed looks like a very good solution. Unfortunately it currently requires a Windows machine running 24/7 (which I don't have) and is too difficult to set up for the average user. For me, a good alternative would be to run the 'IMAP IDLE to HTTP request' component on my CH3SNAS.
Of course, the ultimate solution would be to have a hosted solution on which users can register their IMAP accounts, together with a program on their PPC that both listens for push notifications send by the hosted solution, and sends IP updates to the hosted solution.
camro said:
i'm not sure, if this save battery ..... maybe you are interested on this more in detail
Click to expand...
Click to collapse
Basically, I got the idea by reading somewhere that Pocket Outlook IMAP solutions are always less efficient than, for example, ActiveSync. This is because every time Outlook needs to retrieve mail, it needs to set up a TCP/IP connection, set up SSL if applicable and do a LOGON (and afterwards do a LOGOFF, close the connection).
With an IMAP IDLE solution like xImapPusher you already have a secured and authenticated connection set up, so why not have Pocket Outlook re-use that same connection? However, I don't know how much data and processing power is involved in setting up and closing the connection, and thus how much impact this could have on battery life and time taken to retrieve new mail.
So basically, xImapPusher would not only function as an IMAP client, but also as an IMAP server. The xImapPusher server component handles incoming connections, together with LOGON and LOGOFF requests. All commands between LOGON and LOGOFF are simply passed on to the real IMAP server via the connection that was previously set up by the IMAP IDLE client component (which has temporarily suspended IDLE operation).
Fixup said:
Multiple accounts sync should be easy, just tell which account to sync in the http request.
Click to expand...
Click to collapse
sorry, the multple accounts was in reference to the re-writing of imappusher to c++
still gonna give the http method a shot when i get some time. thanks again man
<deleted by user>
<deleted by user>
rsenden said:
Basically, I got the idea by reading somewhere that Pocket Outlook IMAP solutions are always less efficient than, for example, ActiveSync. This is because every time Outlook needs to retrieve mail, it needs to set up a TCP/IP connection, set up SSL if applicable and do a LOGON (and afterwards do a LOGOFF, close the connection).
With an IMAP IDLE solution like xImapPusher you already have a secured and authenticated connection set up, so why not have Pocket Outlook re-use that same connection? However, I don't know how much data and processing power is involved in setting up and closing the connection, and thus how much impact this could have on battery life and time taken to retrieve new mail.
So basically, xImapPusher would not only function as an IMAP client, but also as an IMAP server. The xImapPusher server component handles incoming connections, together with LOGON and LOGOFF requests. All commands between LOGON and LOGOFF are simply passed on to the real IMAP server via the connection that was previously set up by the IMAP IDLE client component (which has temporarily suspended IDLE operation).
Click to expand...
Click to collapse
Compared to the excessive battery drain from the 5-min timeouts, nothing else matters.
Don't believe too easily what you see on the net. Highschool bloggers dont know what they talk about. If IMAP idle is not good, why MS Live uses it?
I've done extensive tests between imap idle and ActiveSync. I also tested z-push (AS clone) and many other things in searching for the best push solution.
The real problem with imap idle is there is only few mobile clients support it and none of them work. That's why I spent time on this project.
Fixup said:
Compared to the excessive battery drain from the 5-min timeouts, nothing else matters.
Don't believe too easily what you see on the net. Highschool bloggers dont know what they talk about. If IMAP idle is not good, why MS Live uses it?
Click to expand...
Click to collapse
I don't believe everything I see ;-). I was just trying to find an explanation why for example EmailScheduler drained the battery so much faster than Windows Live. After trying out xImapSync for the last few days, I now know that it is just caused by the way EmailScheduler is implemented.
With xImapPusher battery drain is about the same as Windows Live I think, and it's also more stable than EmailScheduler (e.g. I don't have to force a reconnect every now and then). So thank you for your contribution to this project!

Push mail for X1

Hello all, does anyone know about an email service that pushes your email to your phone free?? thanks alot.
try Gmail. You can set the mobile check your mail more frequently, like push mail
truelied said:
try Gmail. You can set the mobile check your mail more frequently, like push mail
Click to expand...
Click to collapse
Is it free?? and where can i download it from.... it's supposed to use only gmail right?? i was actually looking for the one that can send from multiple mail accounts....
You can use any email service like gmail that allows pop3 to check mail frequently (5-15 mins) with the built in outlook email program. No extra downloads. This is quite batter friendly.
If u want true push email, there are a few services which give you a free service. Had checked long back and don't really remember. Google Apps allows push email. You could read further on their site. It would be quite a drain on the battery to be constantly use gprs to be in touch with the email server.
Interesting post/discussion on Blackberry Vs Windows Mobile (push email)
http://www.techatplay.com/?p=482
Why not using a windows live account? With Microsoft live you can set emails to be received as they come in...
dojono said:
Why not using a windows live account? With Microsoft live you can set emails to be received as they come in...
Click to expand...
Click to collapse
Is that through activesync (over the air)?
How does it affect the battery life?
Yep, I am using my Windows Live set up to sync as mail is received. It is not through AS, what would be the point??? Battery life is only minimally affected, as the mail is loaded onto your phone as it is received, rather than server being in constant sync state.
How does Windows live work?
enigma1nz said:
Yep, I am using my Windows Live set up to sync as mail is received. It is not through AS, what would be the point??? Battery life is only minimally affected, as the mail is loaded onto your phone as it is received, rather than server being in constant sync state.
Click to expand...
Click to collapse
What I am not being able to understnad (and it may purely be due to my not knowing enough) is that how does the phone get to 'know' that there is new mail. As far as I understand, besides manually checking, there are three ways for a phone to get to know about it.
1) POP/IMAP: Checking with a server every "x" minutes on POP3/IMAP (normal outlook experss set to check every "x" minutes)
[Battery life would be affected depending on the "x" minutes and may be much lesser than (2) ]
2) Push Email like Sync: Polling(?) the server to check if there are any changes frequently (probably every few seconds), which produces a push email like effect.
[This may affect battery life significantly]
3) Blackberry like service: Push email via the mobile phone service provider, which may be connected to RIM servers. Where the Server will tell the phone service provider, which in turn will tell the phone about new mail (the mail can subsequently either be delivered to the phone or the phone can check from the server).
[Minimal battery usage, as there is not constant check of email/sync]
How does the phone get to know that there is new email, with Windows live?
I'm actually very curious how Windows Live's push email works too. Anybody have any clue? Searched google till the **** crew, didn't get anything.
I guess what wm does if more like "pull", it's very power consuming. I've been using this service recently, battery life's terribly affected if I choose "push" in schedule settings.
I'm using Valkyrie v7.0 23659 rom, the phone can standby for 7 days (only a few SMS everyday); but with "push mail service", only 1 day (with 30min phone call, 20 SMS and around 10 e-mails)

better battery life tip

1) under yr email accounts, choose "as items arrive"
2) turn off data and 3g.if u are on mango. Keep the online chat connected.
3) u will notice that the email settings saying " not up to date" . thats ok and it means all push connections has been turned off .If u want to sync again. Just turn back yr data and 3g again. and yr push accounts will auto sync again
4) yr phone will rest in GSM mode most of the time consuming less power and data connections turned off.
This tip is for those who don't need timely email.
Basically what this does is turn off all connections to email server and data connection to web and act as on demand connectivity. The battery saver in mango only turns off push and msn chat.the connection to web and bytes data flow is still there.its still connected to the web
In case u didn't know when u turn on data , u are actually connected to the internet and there is a constant 2 way flow of bytes like the WiFi card in yr computer. The email app when set to push will check the server . It does not turn off this constant 2 way connection after checking . It only pushes email.
this consumes some power though it's little, over a long standby time , it can eat up a significant battery when u start using the phone phone the battery drains faster .
Magpir said:
1) under yr email accounts, choose "as items arrive"
2) turn off data and 3g.if u are on mango. Keep the online chat connected.
3) u will notice that the email settings saying " not up to date" . If u want to sync again. Just turn back yr data and 3g again. and yr push accounts will auto synnc again
4) yr phone will rest in GSM mode most of the time consuming less power
This tip is for those who don't need timely email.
Basically what this does is turn off all connections to email server and data connection to web and act as on demand connectivity. The battery saver in mango only turns off push and msn chat.the connection to web and bytes data flow is still there.its still connected to the web
In case u didn't know when u turn on data , u are actually connected to the internet and there is a constant 2 way flow of bytes like the WiFi card in yr computer. The email app when set to push will check the server . It does not turn off this constant 2 way connection after checking . It only pushes email.
this consumes some power though it's little, over a long standby time , it can eat up a significant battery when u start using the phone phone the battery drains faster .
Click to expand...
Click to collapse
While the theory behind that is correct, and thanks for the tips, there are a few points which aren't 100% correct I think. I've done extensive battery tests with smartphones that allowed it (WinMo and Android) and I think that the most gain from turning 3G off is when you have a non-optimal reception, as it eats more battery than just gsm only, when connecting/dropping/reconnecting/searching.
WiFi in comparison (always depending on signal quality though) eats more battery while transferring data, per second, but can also transfer more data in that second. On idle, WiFi looks to be less consuming.
But both won't be a huge battery drain on idle. That said, when I'm very very low on battery, I do turn off 3G too.
If you leave 3G on, but don't use it (with the battery saver or settings, and leave the phone idle), depending on your signal quality, the drain won't be major.
The push vs interval email check settings are a bit different in every platform. It all comes down on how good the 'push' implementation is and -again- your signal quality of course. This because -while interval check just opens the connection once every 15/30/60 minutes and then downloads emails if available- the push setting tries to keep the connection to the server pretty much alive, or rather it tries to keep the channel open so that the hotmail server can push the emails when they arrive.
This however is implemented differently on every platform. In google gmail in android it is pure perfection. The connection uses close to zero energy to stay alive and has a drop-retry pattern which is very optimized. You can try other email programs, even for gmail, on the same phone and it will come out using a lot more battery for push. I think that developing the server, push system and the client entitles them to optimizing it hehe.
Anyway, on WP7 there are no available battery drain monitors (you know the ones that log or tell you in real time the mA or mAh used) so one can't be sure. Being a very new operating system, I would tend to think push email drains a bit more than what android, which has been optimized for years, does with gmail.
Regardless of this, the drain of push email vs interval check (pull), occurs mostly if you receive emails very frequently. This because being contacted 20 times in 15 minutes to discharge an email from the server, possibly while not always in optimal signal strength, is more heavy than discharging all the 20 emails at once after 15 minutes.
It seems to me that when you manually or automatically lose the data connection, and then regain it, wp7 fetches automatically emails if the interval of time for the check has passed or, of course, if push email is on. This is quite better than what I experienced on android 2.1 where reobtaining the connection didn't always trigger an email check (withouth push). So I tend to leave push off and keep an interval around 30 minutes on wp7, but of course that depends on anyone's needs.
Lastly, I'm not sure if the push email energy use is affected by the entire push framework of wp7. Since pretty much a lot of the desktop relies on push (live tiles, notifications, etc), maybe the system is already busy mantaining the channel open with a single server, or mantaining multiple push channels open don't affect battery life, and thus push email doesn't really affect the battery because of this. Still, usually on smartphones, when push fails because the connection isn't reliable it falls back in a frequent-pull which can eat your battery pretty fast...
All in all, tips are good, but a second battery is best
my understanding is that the "as items arrives" is there for a reason. its the newer MS direct push technology
I believe a connection is set up. And the the phone operates on true push rather than pull ( time interval).Since its the server which 'pushes' the mail and the client (Phone) doesn't have to struggle to retrieve the mail......the only thing running is data connection ( G or 3G) which is always running anyway,
like many stated, it does not necessarily drain the battery because an open connection is set up, wheareas a time based interval when set to very small intervals like 15 minutes will drain yr battery more than an open connection.
Background:
In the past, before Direct Push Technology, devices were required to connect with the server at specified time intervals or they were triggered by SMS messages to re-sync using ActiveSync. This required a lot of system resources, notably bandwidth (needed to remotely connect the mobile device to the server) and battery life (needed to constantly run these lengthy synching processes). Direct Push Technology saves battery life and bandwidth by maintaining an open Internet connection and only downloading items as they change, instead of executing a lengthy synching process. The open Internet connection may be achieved in a number of ways: through connection to the ActiveSync cradle, through the wireless phone service itself (the device does not even have to be in active mode) or by Wi-Fi (the Wi-Fi connection must be open).
Direct Push depends on network conditions that support a long-standing HTTPS request. If the carrier network for the mobile phone or the firewall doesn't support long-standing HTTPS requests, the HTTPS request is stopped. The following steps describe how Direct Push operates when a mobile phone's carrier network has a time-out value of 13 minutes:
A mobile phone issues an HTTPS request to the server. The request tells the server to notify the device if any items change in any folder that is configured to synchronize in the next 15 minutes. Otherwise, the server should return an HTTP 200 OK message. The mobile phone then stands by.
If the server does not respond after 15 minutes, the mobile phone wakes up and concludes that the connection to the server was timed out by the network. The device reissues the HTTPS request, but this time it uses a heartbeat interval of 8 minutes.
After 8 minutes, the server sends an HTTP 200 OK message. The device then tries to gain a longer connection by issuing a new HTTPS request to the server that has a heartbeat interval of 12 minutes.
After 4 minutes, a new e-mail message is received and the server responds by sending an HTTPS request that tells the device to synchronize. The device synchronizes and reissues the HTTPS request that has a heartbeat of 12 minutes.
After 12 minutes, if there are no new or changed items, the server responds by sending an HTTP 200 OK message. The device wakes up and concludes that network conditions support a heartbeat interval of 12 minutes. The device then tries to gain a longer connection by reissuing an HTTPS request that has a heartbeat interval of 16 minutes.
After 16 minutes, no response is received from the server. The device wakes up and concludes that network conditions cannot support a heartbeat interval of 16 minutes. Because this failure occurred directly after the device tried to increase the heartbeat interval, it concludes that the heartbeat interval has reached its maximum limit. The device then issues an HTTPS request that has a heartbeat interval of 12 minutes because this was the last successful heartbeat interval.
The mobile phone tries to use the longest heartbeat interval the network supports. This extends battery life on the device and reduces how much data is transferred over the network. Mobile carriers can specify a maximum, minimum, and initial heartbeat value in the registry settings for the mobile phone.
You'll save a lot of battery power if you just set it to manual rather than "as item arrives". With this enabled, it will keep an open connection between the phone and the email server, so when you receive an email, it will go straight to your phone. While if you set it on manual it will only use 3G/GSM connection when its needed.
3G Connection No Concern with Batt Life
i have to agree, 3G connection has nothing to do with battery life, unless your area is weak in 3G network, which causes the phone to keep switching between 3G & 2G network.
it is interesting to note, if u keep ur phone in standby, you get longer standby time on 2G/Edge network compared to 3G.
BUT, you get better talk time on 3G network.
Why is this so, i have no idea. forgot where i saw this (it was on one of the brochures of a phone i used to have, either my LG Optimus 7, Blackberry Storm 9500 or Nokia 5800..)
btw, wp7 doesnt have Push Email.. nor iphone, android, symbian. the ONLY smartphone that has this, is RIM's Blackberry. This is done by having RIM's server check your emails constantly and forward to your phone as the email arrives (thus the monthly blackberry internet service / Blackberry Enterprise Service license fee to use their server)
vash_h said:
i have to agree, 3G connection has nothing to do with battery life, unless your area is weak in 3G network, which causes the phone to keep switching between 3G & 2G network.
it is interesting to note, if u keep ur phone in standby, you get longer standby time on 2G/Edge network compared to 3G.
BUT, you get better talk time on 3G network.
Why is this so, i have no idea. forgot where i saw this (it was on one of the brochures of a phone i used to have, either my LG Optimus 7, Blackberry Storm 9500 or Nokia 5800..)
)
Click to expand...
Click to collapse
Done quite a bit of testing and asked stuff to people who -I think- know this stuff. The end result was exactly like that. 3G is very efficient when used, not so much on idle, but that depends vastly on your signal strength. Anyway, yes disabling the data connection helps saving battery, disabling 3G, not so much. That mostly depends on other factors.
vash_h said:
btw, wp7 doesnt have Push Email.. nor iphone, android, symbian. the ONLY smartphone that has this, is RIM's Blackberry. This is done by having RIM's server check your emails constantly and forward to your phone as the email arrives (thus the monthly blackberry internet service / Blackberry Enterprise Service license fee to use their server)
Click to expand...
Click to collapse
I believe we're talking semantics here. Push email, to the best of my knowledge, as a concept is simply a channel (or socket connection) kept open where the mail server can send the email as soon as it has it, instead of waiting for the client to open the connection and pull it (ask for it).
While the classic implementation is BB, Google Gmail push and Hotmail push/Webdav are both push implementation. On the mobile platform push is hard to achieve compared to desktop and that's why it's flexible, it can fall back to frequent pull at times to simulate push. That's true especially when it's not convenient to keep trying having the channel open because the connection comes and goes.
I've spoken for quite a while with an android developer who made one of the most popular gmail alternative clients and he implemented push in it. He said that you have real push there, but you also need to fall back a lot on frequent pull...
Or... you could just use the built in "Battery Saver" feature that is new to Mango...
I **** you not I have gone a whole week on a single charge with my Focus with "Battery Saver" on. Way better than dinking around with toggling your crap on and off all the time. Just set it and forget it.
I have read that hotmail in wp7 uses Microsoft direct push .yes " as items arrive" is direct push. If u choose a time based schedule, its not direct push. its "pull"
For some reason I am seeing better battery life when set to as items arrive .
vash_h said:
btw, wp7 doesnt have Push Email.. nor iphone, android, symbian. the ONLY smartphone that has this, is RIM's Blackberry. This is done by having RIM's server check your emails constantly and forward to your phone as the email arrives (thus the monthly blackberry internet service / Blackberry Enterprise Service license fee to use their server)
Click to expand...
Click to collapse
as of 2010, hotmail was implemented with MS newer direct push technlogy found in exchange.
So u are wrong here.
downloaderintruder said:
You'll save a lot of battery power if you just set it to manual rather than "as item arrives". With this enabled, it will keep an open connection between the phone and the email server, so when you receive an email, it will go straight to your phone. While if you set it on manual it will only use 3G/GSM connection when its needed.
Click to expand...
Click to collapse
some clarification here.."as item arrives" is the true push. manual is pull and is no different than time interval. The difference is that u are doing it manually
obviously, fetch( pull) opens a connection to the server at specific intervals, whether you have anything to fetch or not ...and that means an internal background process /service is running all the time on the phone even though yr data is transfered at intervals. So it does not mean better battery life
push only opens a connection when the server tells it there is something available. the phone is triggered in these intervals .so how does this save battery life?
there shouldn't be a continuous connection needed. The server should simply send a small data packet to the phone ( yr phone data is "sleeping" or timed out) when it has something to deliver ..which should then trigger the phone to go 'fetch' (pull) it.
So in theory if u dont receive a any email on a day, u don't need to set it to time interval pull email as this will initiate processes thus consuming yr battery life.
email if u receive a hundred emails a day every hour , setting it to "as items arrive" will be still be better than hourly time interval .
In wp7 email account settings if u are using hotmail u will see this setting " as items arrive" . This is the true push technology . This is MS new "Direct Push technology" and it saves battery life by not initiating connections everytime the phone is set to check email in time intervals. It maintains an open connection to hotmail . Direct push only works in Hotmail in wp7 and not yahoo, google or other accounts which will use the older iphone style time interval push email.
this is how it works. What they mean by in open connection is through a unique identifier. this does not drains battery...as no data flow is taking place all the time. only yr Data connection is alive as per usual and even when its sleeping or idling, the phone receives info from Hotmail because hotmail knows where to send this info.
its like a pipe connected from A (phone) to B (hotmail) but no water flowing unless there is a need to.When u have a water to flow, B sends out a "trickle" to A to open up and establish contact and the water flows through. all this is through a unique identifier which B uses on the network . in addition the phone ( A) also periodically sends out trickles to B after studying network conditions. So direct push adjusts to any network conditions when sending out email.
As with time based intervals, the phone from A will connect to B and retrieve the water. with B having no part in it or being uncooperative not to waste A;s time even when there is no water..So if u set the wp7 time interval , u not only dont get timely emails but also wastage process as each time the phone will try to establish the connection again . There is no unique identifier involved. if for some reason the phone could not establish a connection , it try again and again in a loop and eventually returns an error, this has been seen with wp7 time based push repeatedly as an error pops out. and the email will not synchronize again at the next time interval and states " attention required". this means push email in the phone stops workig altogether because something at the other side has changed or expereicning problem
Uploaded with ImageShack.us
The problem with push, any push (email, live tile, etc) on mobile, is that your IP address, the technology (wifi or 3g), the infrastructure (firewall, router, etc) and the channel that is used to be reached, can switch quite often, as you lose signal or move from an area to another.
That can cause the phone to use battery in trying to keep the channel to the server alive. Just telling the server 'tell me when there's email' isn't enough. The phone needs to actively try to be reachable from the server, and that can be costly especially in bad reception areas. In your analogy, the problem is that the pipe can be disrupted quite often and needs to be rebuild.
The difference in battery you can see also depends on how many emails you get and how frequently you get them, of course. If you get one email every minute, push will use more battery than pull in any case as the phone will open the connection very often
andycted said:
The problem with push, any push (email, live tile, etc) on mobile, is that your IP address, the technology (wifi or 3g), the infrastructure (firewall, router, etc) and the channel that is used to be reached, can switch quite often, as you lose signal or move from an area to another.
That can cause the phone to use battery in trying to keep the channel to the server alive. Just telling the server 'tell me when there's email' isn't enough. The phone needs to actively try to be reachable from the server, and that can be costly especially in bad reception areas. In your analogy, the problem is that the pipe can be disrupted quite often and needs to be rebuild.
The difference in battery you can see also depends on how many emails you get and how frequently you get them, of course. If you get one email every minute, push will use more battery than pull in any case as the phone will open the connection very often
Click to expand...
Click to collapse
the connections ar eopened only when ther eis something to send
other than that the phone sends out heartbeats...
still no push on my wp7..
ok.. i did what you mentioned.. set my hotmail to 'as item arrives', make sure i have good connection to internet by surfing the net on the phone..
Now, i send an email from my gmail to my hotmail account.. 5 minutes passed still no mail.. (via PC)
i now go to emails (the linked email) and hit on 'sync'.. and there you go.. mail is in..
but that, i believe is pull email..
when i do the same test on blackberry, it prompts me within 30 secs ~ 1 minute after sending..
vash_h said:
ok.. i did what you mentioned.. set my hotmail to 'as item arrives', make sure i have good connection to internet by surfing the net on the phone..
Now, i send an email from my gmail to my hotmail account.. 5 minutes passed still no mail.. (via PC)
i now go to emails (the linked email) and hit on 'sync'.. and there you go.. mail is in..
but that, i believe is pull email..
when i do the same test on blackberry, it prompts me within 30 secs ~ 1 minute after sending..
Click to expand...
Click to collapse
There could be a delay at the gmail .
I just Have 3G off (in my country, it doesn't work with the TmoUS HD7 ) and the email I have synced in my phone is one I created specially for the phone, so I don't have all my friend's emails in Contacts..
Magpir said:
There could be a delay at the gmail .
Click to expand...
Click to collapse
nope, no delays at Gmail.i tried it again w Gmail opened in desktop.mail arrive bt not on phone.
Sent from my LG Optimus 7
I have a BB 9800 and my Mozart on v7712 both having the same Exchange account linked. My 9800 usually receives the email notification on average about 1 second faster than my Mozart. So there isn't really much difference.
vash_h said:
ok.. i did what you mentioned.. set my hotmail to 'as item arrives', make sure i have good connection to internet by surfing the net on the phone..
Now, i send an email from my gmail to my hotmail account.. 5 minutes passed still no mail.. (via PC)
i now go to emails (the linked email) and hit on 'sync'.. and there you go.. mail is in..
but that, i believe is pull email..
when i do the same test on blackberry, it prompts me within 30 secs ~ 1 minute after sending..
Click to expand...
Click to collapse
same for me. unreliable "push" in mango rtm
had to set it to 15min fetch as it was more reliable. although sometimes i open email and it says "last synced 19min ago" wtf?. buggy i guess

Categories

Resources