I found that inside Javaphone.jar there are A LOT of undocumented classes and methods; I attach the com.symbian.epoc.etel package.
How can I access public methods of this package?
For example, how to get PhoneID ( public EtelGsmPhoneId getPhoneId() ), hone lines ( public EtelGsmLine[] getVoiceLines() ), SubscriptionID ( public String getSubscriptionId() ) , available networks ( public EtelGsmNetworkInfo[] getDetectedNetworks() ),... ?
I can easily access the constants, so I know the library IS working. But I am not skilled in Java and I don't know how to access the functions... I don't see any "getInstance" method.Code:// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 29/01/2007 18.12.37 // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: EtelGsmPhone.java package com.symbian.epoc.etel; import com.symbian.config.JavaPhoneConfig; import com.symbian.epoc.events.EventServer; import java.io.PrintStream; // Referenced classes of package com.symbian.epoc.etel: // EtelObject, EtelException, EtelGsmLine, EtelGsmNetworkInfo, // EtelGsmNetworkListener, EtelGsmPhoneId, EtelGsmPhoneListener, EtelGsmRadioListener, // EtelGsmTimeZone public final class EtelGsmPhone extends EtelObject { private int getServer() { if(iServer == null) iServer = new EventServer(JavaPhoneConfig.getEventServerName("etel")); return iServer.getHandle(); } private void handleError(int i) throws EtelException { EtelException.handleError(i); } EtelGsmPhone(EtelGsmPhoneListener etelgsmphonelistener) throws EtelException { iInitialized = false; iListID = -1; JavaPhoneConfig.checkSecurity(); iPhoneListener = etelgsmphonelistener; int i = _create(getServer()); if(i < 0) System.err.println("_create failed"); setPeer(i); } private native int _create(int i); private void initialized(int i) { if(i == 0) iInitialized = true; else close(); if(iPhoneListener != null) { iPhoneListener.phoneInitialized(i); iPhoneListener = null; } } public boolean isInitialized() { return iInitialized; } public EtelGsmLine[] getVoiceLines() throws EtelException { int i = getPeer(); int j = _getLineCount(i); if(j < 0) handleError(j); String as[] = new String[j]; int k = 0; for(int l = 0; l < j; l++) { String s = _getVoiceLineName(i, l); if(s != null) as[k++] = s; } if(k == 0) return null; EtelGsmLine aetelgsmline[] = new EtelGsmLine[k]; for(int i1 = 0; i1 < k; i1++) aetelgsmline[i1] = new EtelGsmLine(i, as[i1]); return aetelgsmline; } private native int _getLineCount(int i); private native String _getVoiceLineName(int i, int j) throws EtelException; public EtelGsmPhoneId getPhoneId() throws EtelException { return EtelGsmPhoneId._new(getPeer()); } public String getSubscriptionId() throws EtelException { return _getSubscriptionId(getPeer()); } private native String _getSubscriptionId(int i) throws EtelException; public String[] getOwnNumbers() throws EtelException { int i = getPeer(); int j = _getOwnNumberCount(i); if(j < 0) handleError(j); if(j == 0) return null; String as[] = new String[j]; int k = 0; for(int l = 0; l < j; l++) { String s = _getOwnNumber(i, l); if(s != null) as[k++] = s; } if(k == 0) return null; String as1[] = new String[k]; for(int i1 = 0; i1 < k; i1++) as1[i1] = as[i1]; return as1; } private native int _getOwnNumberCount(int i); private native String _getOwnNumber(int i, int j) throws EtelException; public void addRadioListener(EtelGsmRadioListener etelgsmradiolistener) { EtelException.checkAddListener(iRadioListener, etelgsmradiolistener); iRadioListener = etelgsmradiolistener; etelgsmradiolistener.signalStrengthChanged(_getSignalStrength(getPeer())); etelgsmradiolistener.radioStateChanged(_getRadioState(getPeer())); } private native int _getSignalStrength(int i); private native boolean _getRadioState(int i); public void removeRadioListener(EtelGsmRadioListener etelgsmradiolistener) { EtelException.checkRemoveListener(iRadioListener, etelgsmradiolistener); iRadioListener = null; } private void signalStrengthChanged(int i) { if(iRadioListener != null) iRadioListener.signalStrengthChanged(i); } private void radioStateChanged(boolean flag) { if(iRadioListener != null) iRadioListener.radioStateChanged(flag); } public EtelGsmNetworkInfo[] getDetectedNetworks() throws EtelException { int i = getPeer(); int j = _getDetectedNetworkCount(i); if(j < 0) handleError(j); waitForRetrieval(0); j = iNetworkCount; if(j < 0) handleError(j); if(j == 0) return null; EtelGsmNetworkInfo aetelgsmnetworkinfo[] = new EtelGsmNetworkInfo[j]; for(int k = 0; k < j; k++) aetelgsmnetworkinfo[k] = _getDetectedNetwork(i, k); return aetelgsmnetworkinfo; } private native int _getDetectedNetworkCount(int i); private native EtelGsmNetworkInfo _getDetectedNetwork(int i, int j) throws EtelException; public void cancelGetDetectedNetworks() { if(iListID == 0) { _cancelGetDetectedNetworks(getPeer()); return; } else { iDetectedNetworkListRetrievalCancel++; return; } } private native void _cancelGetDetectedNetworks(int i); public void setCurrentNetwork(EtelGsmNetworkInfo etelgsmnetworkinfo) throws EtelException { if(etelgsmnetworkinfo.code == null) throw new NullPointerException(); int i = _setCurrentNetwork(getPeer(), etelgsmnetworkinfo.code); if(i != 0) handleError(i); } private native int _setCurrentNetwork(int i, String s); [... cut due to message length limitation...] private boolean iInitialized; private EtelGsmPhoneListener iPhoneListener; public static final int MAX_GSM_SIGNAL = 31; public static final int UNKNOWN_SIGNAL = 99; private EtelGsmRadioListener iRadioListener; public static final int NOT_REGISTERED_NOT_SEARCHING = 0; public static final int REGISTERED_ON_HOME_NETWORK = 1; public static final int NOT_REGISTERED_SEARCHING = 2; public static final int REGISTRATION_DENIED = 3; public static final int REGISTRATION_UNKNOWN = 4; public static final int REGISTERED_ROAMING = 5; private EtelGsmNetworkListener iNetworkListener; public static final int CW_MODE_ACTIVE = 0; public static final int CW_MODE_NOT_ACTIVE = 1; public static final int CW_MODE_NOT_PROVISIONED = 2; public static final int CW_MODE_UNAVAILABLE = 3; public static final int CW_MODE_UNKNOWN = 4; public static final int CW_LOCATION_CACHE = 0; public static final int CW_LOCATION_CACHE_PREFERRED = 1; public static final int CW_LOCATION_NETWORK = 2; private int iNetworkCount; private int iCallWaitingMode; private int iDetectedNetworkListRetrievalCancel; private static final int NO_REQUEST = -1; private static final int DETECTED_NETWORKS = 0; private static final int CALL_WAITING = 1; private static final int KERRCANCEL = -3; private int iListID; private final Object iLock = new Object(); }

Reply With Quote

