Change your network operator to an Android app

I am trying to develop an Android application that shows the signal strength of various network operators on a map. The problem is that the only way to change the network operator is to do it manually.

Any ideas on how I can get this information without changing it manually? I think there are Android inner / private classes for this.

+6
source share
1 answer

For this you will need to use one or more internal Google APIs. By default, they are not available for Android applications for various (usually good) reasons. For example, the API for turning on and off the binding and its configuration is not a public API and cannot be called directly by third-party applications.

You will need to do two things. First, download the Android source code and find the API (s) that you need to list and change the operator. You can find the Android source code and download instructions here .

Secondly, you will need to use reflection to call the methods of these APIs. The best approach to this, and the one that I used to play with the binding API is to write a proxy class. Give it all the same methods as the API you want to use, and inside each method use reflection to invoke the API method. Any other technique either (a) will not compile without adding part of the Android source code to your class path, and then (b) will be compiled, but will explode upon deployment.

Remember that it’s best for you to do this on a proprietary Nexus device, as it has Vanilla Android code. My (successful) attempt to write a widget on the main screen to enable and disable the binding worked on the Nexus One, but did not work on the Samsung Galaxy Tab P1000. The device supported pairing, but Samsung changed this part of the OS as part of the migration effort.

+1
source

Source: https://habr.com/ru/post/887912/


All Articles