[Guide] Tasker automation of network mode - One (M7) General

This is something I've wanted to be able to do for a long time and now thanks to X posed and GravityBox it's now possible.
Massive thank you to @C3C076 for GravityBox and for guidance on how to do this.
Requirements:
Root
Tasker
Xposed
GravityBox (check your ROM's compatibility)
Setup:
Open tasker
Create a new task - misc - send intent
Paste the following into the action box: "gravitybox.intent.action.CHANGE_NETWORK_TYPE"
Paste the following into the extra box:
"networkType:2"
The above will switch to 3g. Change the 2 as per below as required.
0 - 2G/3G auto (3G preferred)
1 - 2G
2 - 3G
9 (or 10) - LTE
Screenshot:
https://www.dropbox.com/s/a6il63lw5e4m7vi/2013-12-11 07.51.52.png
Sent from my HTC O'ne-xus

i dont understand whats the aim of this. can explain ?

Magpir said:
i dont understand whats the aim of this. can explain ?
Click to expand...
Click to collapse
Setting network mode automatically. For example....
Switch to 2g when on WiFi or screen off.
Then switch to 3g when off WiFi and screen on.
Sent from my HTC O'ne-xus

Doesn't the HTC power saver do the same thing
Sent from my HTC One using Tapatalk

You are referring to Sense. Not everyone stays stock plus I'm not sure battery saving mode switches network? If it does does it switch back to 3g when you need it?
Sent from my HTC O'ne-xus

Since I got this running using llama, and you seem to be more skilled with tasker, let me ask you this question.
Many use tasker to implement this function where it scans cell towers and activate/deactivate wifi based on location. However, I have found that tasker will deactivate wifi when the phone latches on to a new cell tower while the wifi is still connected (which makes the automation redundant), whereas llama has this option where it will not switch off wifi (regardless of detected cell towers) unless the wifi connection is gone.
Any way to replicate this same behaviour in tasker?

I don't activate WiFi based on location. I use tasker to switch WiFi as follows:
WiFi disconnected - WiFi off Bluetooth on
Bluetooth disconnected - WiFi on Bluetooth off.
WiFi & Bluetooth disconnected - 5 min delay then both off.
This covers most situations for me as I'm usually in my car between home, work or family.
Sent from my HTC O'ne-xus

kenkiller said:
Since I got this running using llama,
Click to expand...
Click to collapse
Worth adding your llama setup here too?
Sent from my HTC O'ne-xus

mitchst2 said:
Worth adding your llama setup here too?
Sent from my HTC O'ne-xus
Click to expand...
Click to collapse
As in this post.
http://forum.xda-developers.com/showpost.php?p=48365305&postcount=649
Don't have the pictures anymore hehe.
---------- Post added at 12:51 AM ---------- Previous post was at 12:50 AM ----------
mitchst2 said:
I don't activate WiFi based on location. I use tasker to switch WiFi as follows:
WiFi disconnected - WiFi off Bluetooth on
Bluetooth disconnected - WiFi on Bluetooth off.
WiFi & Bluetooth disconnected - 5 min delay then both off.
This covers most situations for me as I'm usually in my car between home, work or family.
Sent from my HTC O'ne-xus
Click to expand...
Click to collapse
Ah....so the search continues.

Just a question, why would we want to change to 2G when WIFI is connected?
If I am on wifi, I dont use data so I dont care If it is in 3g or 2g. Only for calls. So 3g is not used so I dont care If it is 3g or 2g. Perhaps it save battery? I am not sure, thank you

Javi22 said:
Just a question, why would we want to change to 2G when WIFI is connected?
If I am on wifi, I dont use data so I dont care If it is in 3g or 2g. Only for calls. So 3g is not used so I dont care If it is 3g or 2g. Perhaps it save battery? I am not sure, thank you
Click to expand...
Click to collapse
I get a really crap signal on 3g at home so switch to 2g. Only use 3g for browsing off WiFi. Additional benefit is battery saving. This is all now automated
Sent from my HTC O'ne-xus

Javi22 said:
Just a question, why would we want to change to 2G when WIFI is connected?
If I am on wifi, I dont use data so I dont care If it is in 3g or 2g. Only for calls. So 3g is not used so I dont care If it is 3g or 2g. Perhaps it save battery? I am not sure, thank you
Click to expand...
Click to collapse
Just as an example, LTE reception in my area is dreadful, 3G is decent, 2G is excellent. If I'm already connected to wifi, but my phone is also on LTE for calls/reception, battery is still dreadful due to the poor reception as phone tries to stay on LTE network (it won't switch to 3G/2G because it can still see LTE), at least on my Nexus 5 (mobile network signal in battery stats is yellow/grey mostly).
Being able to automate the switch to 3G or 2G when connected to wifi solves this part of the battery drain. But if you have excellent mobile reception then this shouldn't be a concern.

Understood. So, although I am wifi connected, the phone still searching for 3g signal, right? yep, In my house there is poor 3g signal too. So I have to try this tutorial, maybe will reduce battery eating I already use tasker for other purposes and it is awesome
Thank you!

There's an app on Google play that shows you the cell towers you connect to. On 3g at home my phone was continually hunting all over the place just to maintain a 3g signal.
This one
https://play.google.com/store/apps/details?id=com.technolatry.antennas
Sent from my HTC O'ne-xus

mitchst2 said:
There's an app on Google play that shows you the cell towers you connect to. On 3g at home my phone was continually hunting all over the place just to maintain a 3g signal.
This one
https://play.google.com/store/apps/details?id=com.technolatry.antennas
Sent from my HTC O'ne-xus
Click to expand...
Click to collapse
Thanks, I will take a look
Btw I searched for "GravityBox" so I can do this trick, but I have found this
http://forum.xda-developers.com/showthread.php?t=2316070
Where it says it is not compatible with htc sense.
On the other hand, have you tried tasker + secure settings? I remember it used to has some 2g/3g toggle, but I cant find it now. I suppose it is no longer avaible, but dont know

mitchst2 appears to be on some kind of AOSP/CM custom rom, so if you're on stock Sense it might not work. Might need to make it clear.
Secure settings' 2G/3G/LTE toggle only works for specific custom roms (CM or AOKP iirc).

I'm on a Google edition. Secure settings network toggle not available on GPE.
GravityBox is being revised so it doesn't apply quick settings toggles by default. Not sure if this will help it's compatibility with sense or not.
Sent from my HTC O'ne-xus

kenkiller said:
mitchst2 appears to be on some kind of AOSP/CM custom rom, so if you're on stock Sense it might not work. Might need to make it clear.
Secure settings' 2G/3G/LTE toggle only works for specific custom roms (CM or AOKP iirc).
Click to expand...
Click to collapse
Okey, thanks
mitchst2 said:
I'm on a Google edition. Secure settings network toggle not available on GPE.
GravityBox is being revised so it doesn't apply quick settings toggles by default. Not sure if this will help it's compatibility with sense or not.
Sent from my HTC O'ne-xus
Click to expand...
Click to collapse
Understood. So not sure if it works on sense. Let's see if someone can confirm this, I will not take a risk for the time being
I hope it works.. This seems to be a very useful task

There are sense toolbox's on xposed. May be worth asking their developers if network mode intents are or can be made available.
Sent from my HTC O'ne-xus

So, who is the people I have to contact? You mean, xposed developers? Sorry mate, It seems that I am a bit lost here...

Related

Idea: 3G/EDGE Auto Switcher

Hey guys, I'm by no means an Android developer, so I could never make my idea a reality. But do you guys think this would be possible?
THE IDEA:
A small program that runs in the background, switching the network between HSDPA and EDGE. It would default to EDGE while idling, but activate HSDPA when a user-defined program is run (such as Opera, google maps, marketplace, etc). This way, you can idle on EDGE (and save power), but still have the speed of HSDPA when you need it!
I have no idea if this is even remotely possible so please don't flame the noob
I don't know if you searched the forums...but this was 4 threads down from yours. Don't know if it answers your application or what not...also try out Juice Defender
EDIT: oh hi from OCN
bloke226 said:
I don't know if you searched the forums...but this was 4 threads down from yours. Don't know if it answers your application or what not...also try out Juice Defender
EDIT: oh hi from OCN
Click to expand...
Click to collapse
Yea already tried it But I still have the OCN mentality of "the pursuit of performance".. in this case, the pursuit of battery performance
Juice Defender does not switch between EDGE/3G based on the applications you're running AFAIK
I kinda had the same idea as you so last week I created a topic on the Nexus One Themes and Apps: http://forum.xda-developers.com/showthread.php?t=678227
Feel free to join the discussion
I believe 3g uses less power while idling than edge
-------------------------------------
Sent via the XDA Tapatalk App
r34p3rex said:
Yea already tried it But I still have the OCN mentality of "the pursuit of performance".. in this case, the pursuit of battery performance
Juice Defender does not switch between EDGE/3G based on the applications you're running AFAIK
Click to expand...
Click to collapse
I hear ya about the performance. I guess I read your post too quick and missed the part where it would be application based. I can't think of anything on the top of my head that can do that, it would be difficult I would imagine...
I think there are a couple problems here
1) the "context switch" (if you will) from Edge to 3G and back devours battery
2) its slow, so you grab your idling phone to figure out the nearest Starbucks and you miss your exit while it jumps from Edge to 3G
I know on the google api it isn't possible to do this, but I don't think that isn't the problem.
At the moment you have 3 options. GSM only, WCDMA only and GSM/WCDMA. Whenever you switch between the 3 of them, the phone will lose signal for 10 seconds before it can find the best network. So the switcher here is not the best as you will lose connection, and what if you are downloading something at the same time...
What you need is when the phone is on GSM/WCDMA that it knows the best network to pick from depending on the phones lifecycle. GSM/WCDMA loses battery power because it always tries to find the best network to connect to, so for example if you are on GSM it will constantly try to find a 3G network etc (as far as I understand it).
What we need is the ability for the phone to stay on GSM when the phone is idle and then when the phone is woken up to automatically start to search for a WCDMA network and then gracefully switch over like it does now. For this I have no idea if it is possible as I don't know how the scanning of the network works. If it is possible then that would be wicked. But this is what we need.
crachel said:
I think there are a couple problems here
1) the "context switch" (if you will) from Edge to 3G and back devours battery
2) its slow, so you grab your idling phone to figure out the nearest Starbucks and you miss your exit while it jumps from Edge to 3G
Click to expand...
Click to collapse
THIS.
It's the switch between the two that really eats battery. That said, I'm pretty sure you can do that with Tasker already.
Check out Chainfire's app http://forum.xda-developers.com/showthread.php?t=807989

mode of operation setting?

I did a forum search but couldn't find anything, although it looks like a lot of Hero users are having the same issue since installing Android 2.1.
Does anybody know of a way to change the mode of operation on the phone to 1x only? I've got an Airave at home because I get wildly inconsistent EVDO coverage, so my phone is often switching between the two. I'd like to be able to just set it to 1x only while at home to help the battery life, but the setting doesn't appear to be in the Mobile Network menu anywhere.
Is there any other way of doing this?
I don't see anything for that setting either, weird
This is my first Android phone, but as near as I can tell from searching on the issue, it just looks like Android 2.1 removed access to that setting across the board. I suppose it could be worse... it looks like Hero users who were set to 1x only before upgrading to 2.1 are now locked into it, with no apparent way to change it back.
I imagine there's probably some "backdoor" way of getting to the setting, but I'm way too new to Android to have any idea how to accomplish that.
If you have WiFi at home you're better off using that since it uses less battery than 3g or 1x. That's what I do at home.
I forgot to add I'm using WiFi in conjunction with the airrave.
Sent from my EVO using Tapatalk
donatom3 said:
If you have WiFi at home you're better off using that since it uses less battery than 3g or 1x. That's what I do at home.
I forgot to add I'm using WiFi in conjunction with the airrave.
Sent from my EVO using Tapatalk
Click to expand...
Click to collapse
But using wifi won't stop the phone from constantly switching between EVDO and 1x, will it? It's the radio constantly trying to hold onto that weak EVDO signal that I want to stop.
Well, I can confirm that using wifi does not prevent the phone from trying to grab a 3G signal, so all that's really doing is adding to the battery drain rather than helping it.
I tried changing the EVDO Preferred Mode in the ##DATA# menu after getting my MSL code from Sprint, but it still keeps trying to hop onto 3G even after commiting the changes and rebooting. Sigh. Here's hoping one of the devs figure something out.

Just figured something out!

When you hold down the search sensor button you get in-app-wifi toggle, It's really hot, because if your online and you decide to turn on your wifi, no more going to home screen to use your power widget, you just hold down that button and it automatically toggles your wifi. Every day I'm learning something new about this beautiful phone. Also, they have fixed the issue with the 3D gallery, all the pictures load lighting quick and at the same time, wifi seems to be enhanced, and phone reception to, I was on the train earlier and I went into a tunnel and I was able to talk until I reached the station, which is a bit of a way underground. I'm using the prioritizer app, and I used to get reception like that on my G1 when I used it, people didn't believe me until I got a phone call in the subway one day, I heard a kid say who gets phone calls in the subway, lol, and whenever I pass one of those grates that lead to outside, text messages come through sometimes. Share your experiences with this incredible device. Screenshot taken with Android Commander 0.7.9.6
Rooted N1 w/locked bootloader
FRF91 eViL n-One-sh0t Noir 7
Setcpu= underclocked 883200 Max / 768000 Min
8GB sdcard class 6 / 512 ext3 partition/no swap
Mine is set to always use voice search. Anyone know who to change this?
I use QuickDesk Beta with a Power Control Widget as well as some other nifty shortcuts. If you download it from the market, the next time long press search there will be and option for the QuickDesk.
If you want to change yours going to search you have to go to settings>application>search(or the program being opened) and undo the defaults for that program.
Is that a stock option, on-app wifi? Or is it a piece of a wifi toggle app, why don't i have it.
You actually need an app to do that, try search in the market 'In App Wifi Toogle'
it's by Oliver Pearmain
A few ROMs have this in as standard (it's pretty useful) but it's not a FroYo thing. It's not in the CM ROMs and possibly won't be.
Just downloaded the in-app wifi toggle from the market. What an extremely handy app!!!
(need to toggle 3g - Wifi a lot since the froyo radio...3g reception in house has worsened quite a bit)
Thanks for the info!
My vote goes to QuickDesk Pro + Power widget as well... much more useful IMHO
http://www.xda-developers.com/android/in-app-wifi-toggle-for-android/
Best thing to use on the search long press is Quick Settings.
http://www.appbrain.com/app/com.bwx.bequick
You can customize which settings appear on that list, it's awesome. I use it to toggle wifi, sound, brightness (including an auto-brightness toggle), auto-rotate, and a few more.
Play with the settings and configure it to exactly what you want and then every setting is one click away wherever you are.
A little help
olavjunior said:
Mine is set to always use voice search. Anyone know who to change this?
Click to expand...
Click to collapse
Go into application setting, then manage applications, scroll until you find voice search, click on it and there should be a option to clear defaults, clear it. next time you use this function you'll be prompted to choose default action, just don't check the box and the prompt will always come up.
Clarkster said:
Best thing to use on the search long press is Quick Settings.
You can customize which settings appear on that list, it's awesome. I use it to toggle wifi, sound, brightness (including an auto-brightness toggle), auto-rotate, and a few more.
Play with the settings and configure it to exactly what you want and then every setting is one click away wherever you are.
Click to expand...
Click to collapse
Sweet thanks for sharing this, awesome app
aureliusmaximus said:
Just downloaded the in-app wifi toggle from the market. What an extremely handy app!!!
(need to toggle 3g - Wifi a lot since the froyo radio...3g reception in house has worsened quite a bit)
Thanks for the info!
Click to expand...
Click to collapse
You can change your network type for improved reception, go to phone press *#*#4636#*#* and wait for the hidden testing area. Click on phone information, scroll down until you see your set network. Try them all to see which one gives you the best reception. Once you choose one it will reset your network so let it do its thing, your bars and 3G icon should reappear.
blas4me said:
You can change your network type for improved reception, go to phone press *#*#4636#*#* and wait for the hidden testing area. Click on phone information, scroll down until you see your set network. Try them all to see which one gives you the best reception. Once you choose one it will reset your network so let it do its thing, your bars and 3G icon should reappear.
Click to expand...
Click to collapse
Er, not really...it may improve network selection, but it won't improve signal.
WCDMA preferred - Use 3G but when signal is weak prefer 3G over GSM.
GSM only - obvious.
WCDMA only - Use only 3G, has no signal then when only GSM present.
GSM auto PRL - Use 3G but when signal is weak, prefer GSM over 3G
All the CDMA/EvDO stuff does apply to our phones...its the same stuff for, but for those networks and GSM/CDMA auto is for combination phones... (ie - "world" phones from Verizon, etc)
Easiest way to improve Nexus One reception - hold it in your left hand.
aureliusmaximus said:
Just downloaded the in-app wifi toggle from the market. What an extremely handy app!!!
(need to toggle 3g - Wifi a lot since the froyo radio...3g reception in house has worsened quite a bit)
Thanks for the info!
Click to expand...
Click to collapse
You can change your network type for improved reception, go to phone press *#*#4636#*#* and wait for the hidden testing area. Click on phone information, scroll down until you see your set network. Try them all to see which one gives you the best reception. Once you choose one it will reset your network so let it do its thing, your bars and 3G icon should reappear.
blas4me said:
When you hold down the search sensor button you get in-app-wifi toggle, It's really hot, because if your online and you decide to turn on your wifi, no more going to home screen to use your power widget, you just hold down that button and it automatically toggles your wifi. Every day I'm learning something new about this beautiful phone. Also, they have fixed the issue with the 3D gallery, all the pictures load lighting quick and at the same time, wifi seems to be enhanced, and phone reception to, I was on the train earlier and I went into a tunnel and I was able to talk until I reached the station, which is a bit of a way underground. I'm using the prioritizer app, and I used to get reception like that on my G1 when I used it, people didn't believe me until I got a phone call in the subway one day, I heard a kid say who gets phone calls in the subway, lol, and whenever I pass one of those grates that lead to outside, text messages come through sometimes. Share your experiences with this incredible device. Screenshot taken with Android Commander 0.7.9.6
Rooted N1 w/locked bootloader
FRF91 eViL n-One-sh0t Noir 7
Setcpu= underclocked 883200 Max / 768000 Min
8GB sdcard class 6 / 512 ext3 partition/no swap
Click to expand...
Click to collapse
Is there a way to configure this, because i only get voice search, which is sort of useless. I would rather have in app wifi.
-bb
Dude between which stations can you make and hold a call underground thru a tunnel?
Clarkster said:
Best thing to use on the search long press is Quick Settings.
http://www.appbrain.com/app/com.bwx.bequick
You can customize which settings appear on that list, it's awesome. I use it to toggle wifi, sound, brightness (including an auto-brightness toggle), auto-rotate, and a few more.
Play with the settings and configure it to exactly what you want and then every setting is one click away wherever you are.
Click to expand...
Click to collapse
That is actually a really neat app! Thanks for the tip, I like it.
thepawn said:
Er, not really...it may improve network selection, but it won't improve signal.
WCDMA preferred - Use 3G but when signal is weak prefer 3G over GSM.
GSM only - obvious.
WCDMA only - Use only 3G, has no signal then when only GSM present.
GSM auto PRL - Use 3G but when signal is weak, prefer GSM over 3G
All the CDMA/EvDO stuff does apply to our phones...its the same stuff for, but for those networks and GSM/CDMA auto is for combination phones... (ie - "world" phones from Verizon, etc)
Easiest way to improve Nexus One reception - hold it in your left hand.
Click to expand...
Click to collapse
Thanks for the "auto PRL" info, and I LOVE the iPhone 4 dig
blas4me;7090838Also said:
they[/B] have fixed the issue with the 3D gallery, all the pictures load lighting quick and at the same time...
Click to expand...
Click to collapse
Uhhh... they WHO???
Billy
Google with the FRF91 update. Why do you think updates kept coming out so quickly. Google has a ear to the ground, they put the Nexus out there as a test of Android OS, and they want feedback to improve it. It's all about feedback and improvement.

[Q] Issue with radio

Hi,
I apologize if it's the wrong forum or if I missed something in my search over the forums (and internet).
Current setup :
HTC Legend rooted, flashed with Azure 1.0.1 (cyanogen 6.0)
Kernel 2.6.29
Baseband 47.26.35.04u_7.05.35.26L
Issue :
For some reason I can't get my 3G connection stable. eg. When I enable Wifi - 3G drops (which is set up that way), but when I disable Wifi 3G doesn't come back up. Even though the settings are correct.
I'm having a hard time getting any mobile data correctly going, it generally requires me to enable/disable wifi and reboot the phone several times.
Basically I've tried factory resets, checking the settings (config of mobile networks too), it doesn't stay in 2G mode, ... I've test with other Cyanogen based roms and it's the exact same issue. Is it possible this is due to a radio being wrong or is it possible it's actually the phone?
So:
- 2G only is DISabled
- Mobile data is enabled
- wifi off
- settings (mobile connection parameters) are correct
- tried different roms
- checked in places I know I should get a good connection (My provider is Telenet, they use the Mobistar network, my previous provider was mobistar. So the coverage should remain the same.)
I am at my wits end and do apologize if this is a stupid question, but I can't think of anything else that could interfere with this.
Have you tried to leave the 2G/3G settings by default? That is, not to disable 2G. It is anyway switching to the best it can aquire, so if you have strong signal you should get allways 3G. I never had these problems with any ROM I've tried...nightly, Azure, RC1/RC2
Sent from my Legend using XDA App
Check this link, and join the others with the same problem...
http://code.google.com/p/android/issues/detail?id=2207
Quick solution : put one of HTCs widgets for mobile network on your homescreen and as soon as you turn WiFi off toggle the mobile network widget and 3G should start working again . It's a hit or miss though.
Sent from my HTC Legend using XDA App
mcuppens said:
Check this link, and join the others with the same problem...
http://code.google.com/p/android/issues/detail?id=2207
Click to expand...
Click to collapse
Must have used the wrong keywords >.< Sorry. Though thank you for the link, it is EXACTLY the prob I am encountering. At least now I know it's not the rooting that caused it.
About the HTC widget : I've used it, but it's indeed a hit or miss. Best solution seems to switch to 2G and switch back to 3G that way.
Leaving all the settings at standard (and the most recent flash to the CM RC1) helped with the overall connectivity though.

Auto disable mobile networks when wifi connected?

I was wondering if there was an option on the phone or an app to auto disable the network if wifi was enabled??? This would GREATLY safe on battery life as the HSPA uses wayyyy more battery power than wifi!
One of the biggest drainers for me is having it go between EDGE and HSPA and NONE due to my house and where I live. Just walking around the house kills it.
And when I leave home it stays on, when i get to work, same issue.
So would be nice to have such an app!
edit:
Well kinda answered my own question, i posted this as installing my first ROM MC7.... looks like the power control widget has this ability
Or someone, you can disable the UTMS and HSPA and only use EDGE/GMS, which is good enough for me!
Looks like i will be keeping this ROM, only ONE dislike, the USB teather option is not in the normal pull down spot :{ Have to go to settings...
I'm sure you can create a shortcut to it in ADW settings.

Categories

Resources