Beruflich Dokumente
Kultur Dokumente
Questions
Tags
Users
sign up
Badges
Unanswered
log in
Ask
android
listener
telephonymanager
rssi
signal-strength
I'm trying to get the get the signal strength of the current cell that I'm connected to. So far, I've
found this example:
http://www.android10.org/index.php/forums/44-maplocation/868-tutorialget-gsm-signal
But that is only to get a Toast when the signal is changed. Is there any way to save the value of
the signal strength in a variable?
I tried this with the following code, by saving the value on a variable and getting it, but I keep
getting the "initial value". Here's the code:
package org.mode.gsm;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.widget.TextView;
import android.widget.Toast;
public class GetGsmSignalStrength extends Activity {
TelephonyManager Tel;
MyPhoneStateListener MyListener;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView abcd = new TextView(this);
abcd.setText(getRSSI());
I would really appreciate it if anyone could help me save the value of the Signal Strength, or
suggest any other way to do it...
Thanks
share
Mr_and_Mrs_D
8,189 9 60
Asked
Mar 3 '12 at 18:41
3 13
141
Edited
Jul 8 '13 at 22:47
Where do you want to save the signal strength to? File on an SD card, network, local database? qdot Mar 3
'12 at 18:43
first, I just want to save it in a variable, that I'll put on a database later, but that's not a problem... I just want to
be able to get it from my GetGsmSignalStrength class modellero Mar 3 '12 at 18:58
add a comment
1 Answer
order by votes
Rssi was declared in interger; So after you can create a function (String) which return
""+Rssi like that
public String getRssi(){
return ""+Rssi;
}
You have to convert the value in dBm. Hope that will help!!!
share
2 8 31
Your Answer
log in
or
Name
Answered
Apr 20 '12 at 14:33
By posting your answer, you agree to the privacy policy and terms of service.
meta chat tour help blog privacy policy legal contact us full site
Download the Stack Exchange Android app
2016 Stack Exchange, Inc