Examples of PhoneArguments


Examples of net.rim.blackberry.api.invoke.PhoneArguments

        Invoke.invokeApplication( Invoke.APP_TYPE_MESSAGES, args );
    }

    private void invokePhone( final Object arg ) throws Exception {
        PhoneArguments args = null;

        if( arg instanceof PhoneArgumentsObject ) {
            final PhoneArgumentsObject p = (PhoneArgumentsObject) arg;

            final boolean isSmartDialing = p.isSmartDialing();
            final int callType = p.getView();
            final int lineId = p.getLineId();

            if( lineId != PhoneArgumentsConstructor.NO_LINEID && callType == PhoneArgumentsConstructor.VIEW_VOICEMAIL ) {
                // net.rim.blackberry.api.phone.Phone does not support using 'voicemail' to get to the device's
                // voicemail account, since Invoke.invokeApplication doesn't support line id's, we can't
                // handle the case where a developer selects a LINE_ID and wants to call it's specific voicemail.
                throw new IllegalArgumentException();
            }

            String phoneNumber;

            if( callType == PhoneArgumentsConstructor.VIEW_VOICEMAIL ) {
                phoneNumber = PhoneArguments.VOICEMAIL;
            } else {
                phoneNumber = p.getDialString();
            }

            if( phoneNumber == null || phoneNumber.length() == 0 ) {
                args = new PhoneArguments();
            } else if( lineId != PhoneArgumentsConstructor.NO_LINEID ) {
                net.rim.blackberry.api.phone.Phone.initiateCall( lineId, phoneNumber );
                return;
            } else {
                args = new PhoneArguments( PhoneArguments.ARG_CALL, phoneNumber, isSmartDialing );
            }
        } else {
            args = new PhoneArguments();
        }

        Invoke.invokeApplication( Invoke.APP_TYPE_PHONE, args );
    }
View Full Code Here

Examples of net.rim.blackberry.api.invoke.PhoneArguments

    /**
     * Tests the Phone API
     */
    private void testPhone() {
        Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, new PhoneArguments(
                PhoneArguments.ARG_CALL, "555-555-5555"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.