views:

82

answers:

3

Yesterday i tried to create an object for this class to be able to use its methods getGsmBitErrorRate() and getGsmSignalStrength(), but Eclipse IDE throws me error that constructor is not visible. The line:

SignalStrength x = new SignalStrength();

Target SDK set in manifest file is 7. Any ideas what can be done to solve this problem?

Sorry, i forgot to mention that the programming language is Java and I am trying to make an app for Android.

A: 

Assuming you're talking about the Android SignalStrength class there aren't any public constructors as far as I can see. You need to get a reference to an instance from somewhere else - such as by overriding onSignalStrenthsChanged in PhoneStateListener.

Jon Skeet
Very interesting... May be you know where i can find an example to look through?
StalkerRus
I am new in Java and Android so i do not clearly understand how can i reach those methods mentioned above.
StalkerRus
@StalkerRus: I don't have the time to investigate at the moment, but basically you would subclass PhoneStateListener, override that method, and then subscribe using TelephoneManager.listen().
Jon Skeet
A: 

The following are the ways u might use to get the instance reference. Since u have a private constructor for signal strength

  1. Check if the class has static method that returns signalstrength
Suresh S
A: 

The following are the ways u might use to get the instance reference. Since u have a private constructor for signal strength

  1. Check if the class has static method that returns signalstrength
Suresh S