开发者

how to start conference call programatically

开发者 https://www.devze.com 2023-02-01 02:07 出处:网络
I am creating an app depend on parent child relationship, in which when child got a call from a particular no, it shoul开发者_StackOverflow中文版d changed in a conference call with parent automaticall

I am creating an app depend on parent child relationship, in which when child got a call from a particular no, it shoul开发者_StackOverflow中文版d changed in a conference call with parent automatically. Is it possible?

I read about a class com.android.internal.telephony.gsm.GSMPhone

from which we can do this functionality. But I am not getting this class directly. So please help me to do this. I got the call from incoming call receiver.


You cannot do this from an application. com.android.internal.telephony.gsm.GSMPhone is an internal class and you cannot access it. You can try instantiate it by using JAVA reflection, but you will get exception. You can only set Phone state listener etc. from application or you can intercept the out going call by receiving some broadcast "NEW_OUTGOING_CALL". try Like this, but it will not work :-)

try {
            final Class<?> classPhonefactory = classLoader
                    .loadClass("com.android.internal.telephony.PhoneFactory");
            Class.forName("com.android.internal.telephony.PhoneFactory");

            // Object objPhonefactory = classPhonefactory.newInstance();



            Method method_getDefaultPhone;
            method_getDefaultPhone = classPhonefactory
                    .getDeclaredMethod("getGsmPhone");
            method_getDefaultPhone.setAccessible(true);
            Object phoneProxyInstance = method_getDefaultPhone.invoke(null, null);

            if (null == phoneProxyInstance) {
                Log.i("CALLActivity", "Exception!");
            } else {
                Log.i("CALLActivity", "GOT phoneProxyInstance!");
            }

        } catch (ClassNotFoundException e) {
            Log.e("CALLActivity", "PhoneFactory", e);
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消