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

[Q] Using the setPreferredNetworkType method through reflection

OP AndroRobo

7th May 2014, 06:25 PM   |  #1  
AndroRobo's Avatar
OP Junior Member
Flag Thrissur
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2013
More
I've been going over the android sdk for the past year to find out if there is a way to change the network type(2g/3g/4g), in phones with root access.However I couldn't find any way to do this.Asking around,someone told me that I could do this using reflection,by calling a method on a phone instance.Looking through the source code,I did find a setPrefferedNetworkType(); method in the Phone Interface,inside the internal telephony package.Is there anyway I can use this to solve my problem.I can't seem to find a way to get an instance of a class that implements the interface.Or is there any other way to do it entirely?Please help
Last edited by AndroRobo; 8th May 2014 at 06:52 PM.
7th May 2014, 08:51 PM   |  #2  
jinayhvora's Avatar
Member
Thanks Meter: 15
 
44 posts
Join Date:Joined: Apr 2014
If u are rooted why not use Xposed?

Sent from my GT-I9300
7th May 2014, 09:16 PM   |  #3  
Senior Member
Thanks Meter: 590
 
3,105 posts
Join Date:Joined: May 2010
Donate to Me
More
Not clear on exactly what you are trying to do... The settings to switch to different network types should be built-in. They are on MOST phones. This is a useful app for other situations where you can't access those settings:

https://dl.dropboxusercontent.com/u/...s/tellinfo.apk
8th May 2014, 10:11 AM   |  #4  
AndroRobo's Avatar
OP Junior Member
Flag Thrissur
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2013
More
Question
I don't think you guys got what I was talking about.I know that there are built in settings to change it.But I want to build a widget that makes it easier to switch between networks.So I need to know how to do this with the api.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes