请问一下,以下原生代码如何在hbuilder中用js调用sdk实现,急急!!
private TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int currentSignalStrength = 0;
int asu = 0;
telManager.listen(new SignalStrengthListener(), PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);
主要是以下监听在hbuilder中用js如何调用?
private class SignalStrengthListener extends PhoneStateListener{
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength)
{
super.onSignalStrengthsChanged(signalStrength);
if (telManager.getPhoneType()== TelephonyManager.PHONE_TYPE_CDMA)
currentSignalStrength = signalStrength.getCdmaDbm();
else
asu = signalStrength.getGsmSignalStrength();
}
}