Hello i'm Marco.
i'm new user of this forum basic4android and beginners with java , i need write one library to read all RF information of the gsm or umts Cell (SC - CID - LAC - rxlevel - ic/io(umts) rxquality(gsm) neighbor(gsm/umts) etc).
i begin with a simple code but the result is only -1.
can you explain me where are the problem?
You don't need to write a new library to get some extra information. You can use the Reflection library like this.
You get -1 in your library because the constructor of a GsmCellLocation sets the LAC and CID to -1. As you see in the link above you need to get a ready filled in GsmCellLocation from the system phone service TelephonyManager.
A lot of the TelephonyManger data is available in the Phone object in the Phone library. Apart from the additional data available in GsmCellLocation and CdmaCellLocation getting the lower level information you want seems to be quite difficult on Android as the official telephony API doesn't seem to expose it. Look in android.telephony to see what is available there.
You can access the TelephonyManager methods easily with a Reflector object including NeighboringCellInfo. What you can't do is register a PhoneStateListener, for that you will need a library. A PhoneStateListener will give you access to SignalStrength and ServiceState. If the information you want isn't there then it is not available in the public APIs of the Radio Interface Layer.
The issue of getting signal strength have been around on this forum since at least April so it seems to be basic mobile function missing from Basic4Android.
Is it possible to register a PhoneStateListener with the new Reflection library GetProxy function or does it still need a library?
The good news is that XverhelstX have made a PhoneStateListener library which helps a lot with this.
The bad news is Android is not providing all the information to user programs eg RSCP for 3G or RSRP for LTE.
Android 'has' implemented all the 3gpp AT Commands which do provide this information internally (in RIL) but has not provided an API for user programs to access this.
You can see this if you use a dos window:
adb -s emulator-5554 shell
logcat -b radio
The RIL used in the emulator is a reference implementation by google and has logging enabled. Unfortunately, most phone manufacturers seem to have removed this logging in real devices.
At also seems that the lack of an API is an explicit Android design decision because the AT commands do not support multiple requestors ie would get confused if several programs issued AT commands. So only the one system program is allowed to issue AT commands. In Android most system programs run as user programs which can be replaced at anytime and hence no public API is given for AT commands. At least that is my interpretation.