1

I am creating an app to search for all avaialable mobile networks. The code i use is to direct to mobile networks screen:

intent=new Intent(android.provider.Settings.ACTION_SETTINGS);
intent.setClassName("com.android.phone", "com.android.phone.NetworkSetting");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

I have to select "Search Networks" Manually to search for all available networks. Is there a way to do that programatically. I cant find a solution to INetworkQueryService so if you have a code ready to this please tell!

1 Answers1

1

Since Android is open source you can use INetworkQueryService to achieve this task:

Please refer this class NetworkSettings

  1. onCreate starts the NetworkQueryService and binds it
  2. loadNetworksList() tells the service to query for network operators
  3. NetworkQueryServiceCallback is evalutated and if the event "EVENT_NETWORK_SCAN_COMPLETED" was raised, networksListLoaded will be called to iterate over the available Networks

Please check this answer. Hope this will help you..If you need any help let me know

Lokesh Desai
  • 2,607
  • 16
  • 28