×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    How to use public EtelGsmPhoneId getPhoneId() ?

    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() ),... ?
    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();
    }
    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.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: How to use public EtelGsmPhoneId getPhoneId() ?

    These methods and classes are not part of the normal MIDP + optional API stack of smart phones. This seems to be part of the Javaphone API implementation on Communicator 9210/9290 devices. You cannot use them on Series 40 or S60 phones (or the new communicators either).

    Hartti

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Posts
    580

    Re: How to use public EtelGsmPhoneId getPhoneId() ?

    Quote Originally Posted by hartti
    These methods and classes are not part of the normal MIDP + optional API stack of smart phones. This seems to be part of the Javaphone API implementation on Communicator 9210/9290 devices. You cannot use them on Series 40 or S60 phones (or the new communicators either).

    Hartti
    I know. I have an UIQ phone!
    But I think these methods are just any other java method, so who knows java can probably help me figuring out how to use them!

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. error LNK2001: Please Help
    By sourish_khan in forum Symbian
    Replies: 9
    Last Post: 2006-04-19, 11:16
  3. 关于Float的问题,急死了,各位帮忙一下,谢谢!
    By show_up in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 4
    Last Post: 2004-08-17, 08:57
  4. EXPORT error when doing armi build HELP!
    By al3ph in forum Symbian
    Replies: 0
    Last Post: 2002-12-09, 00:19
  5. some problems with label
    By vivienzhung in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-21, 09:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×