Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG
Accepted Solution

Phone call without invoking system dialpad

Is it possible to "call" a phone call function  without invoking the dialpad - without using the phone class methods.

Let say I have my own written contact list app for example. How can I dial a contact from it without bringing the system dialpad.

A lower level API maybe ?

If this is not possible in the current API implementation, would it be possible in the future ?

 

Thank you very much !

 

Best regards - Nick

Please use plain text.
BlackBerry Development Advisor (Retired)
erahnenfuehrer
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Phone call without invoking system dialpad

Check out the Invocation Framework for invoking the phone:

 

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/phone.html

 

Please use plain text.
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG

Re: Phone call without invoking system dialpad

Hi there,

Thank you for your response.

 

I tried several methods of using Invocation Framework /either C++ or QML/. Finally I used the QML example in the developer documentation:

This bit of code:

Button {
    attachedObjects: [
        Invocation {
            id: invoke
            query {
                mimeType: "text/plain"
                data: "+4640999999"
            }
        }
    ]
 
  onClicked: {
    invoke.trigger("bb.action.OPEN")
  }
}

 

However I get "InvocationPrivate::trigger: no target items available for selected action".

 

Can this be tested in the Simulator, or I must use an actual device ?

 

Another question I have is:

I see that the mimeType used along ith "bb.action.DIAL" is "application/vnd.blackberry.phone.startcall".

Does this mean that invoking action.DIAL will bring the phone application ?

 

Best regards - Nick !

Please use plain text.
Developer
shahumang8
Posts: 619
Registered: ‎08-09-2010
My Device: Not Specified

Re: Phone call without invoking system dialpad

Hi Errno,

 

   You can use below code into cpp

 

   

void ApplicationUI::makeCall(QString number) {
	InvokeManager *iManager = new InvokeManager(this);
	InvokeRequest iRequest;
	iRequest.setMimeType("application/vnd.blackberry.phone.startcall");
	iRequest.setAction("bb.action.DIAL");
	QVariantMap map;
	map.insert("number", number);
	QByteArray requestData = bb::PpsObject::encode(map, NULL);

	iRequest.setData(requestData);
	iManager->invoke(iRequest);
}

   You can also check this functionality into simulator.

 

--------------------------------------------------------------------------------------------------------------------------------------------

feel free to press the like button on the right side to thank the user that helped you.

Please use plain text.
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG

Re: Phone call without invoking system dialpad

Hi,
Thank you for your response.
That way it worked.
However, I was probably not very exact when I asked my question.
By saying "without bringing the system dialpad" I meant literally not showing it on the screen. By using bb.action the system dialer shows up /as we can see in your attachment/.I am not sure if the API allows that or not. I am asking of more direct approach, which is not going through the system's dialer/dialpad. I guess Invocation Framework is not that direct. The behavior I want is, my app to act like a default system dialer.

I'm sorry If I didn't explained myself very well !

Best regards - Nick !
Please use plain text.
BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Phone call without invoking system dialpad

[ Edited ]

Hi errno,

 

Those are you two options for making an outgoing call from your application:

 

1) using the Phone API: http://developer.blackberry.com/native/reference/cascades/bb__system__phone__phone.html

2) or using the invocation framework through the link Erin shared above.

 

As the name suggests, the invocation framework would allow you to make a call through the phone app by invoking the it. It doesn't allow for making a call bypassing the phone app. You can only do so using the phone API.

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG

Re: Phone call without invoking system dialpad

Hi, thank you for your fast response.
I was suggested to use Invocation Framework, after my first post (where I said I do not want to invoke the dialer).
So I tried it.
"It doesn't allow for making a call bypassing the phone app. You can only do so using the phone API." What you say means that I can bypass it by using phone API. Does this makes sense ?
Can I make a dial without the phone app or not ? That is my question.

Best regards - Nick !
Please use plain text.
BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Phone call without invoking system dialpad

Hi errno, you can't bypass the phone app if you are invoking it to make a call. Using the Phone API though (which is not through the invocation framework) you can make a call without the phone app UI appearing.

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG

Re: Phone call without invoking system dialpad

Hi,
That's exactly what I understood from what U said. So i tried this by reading the API reference:
void ApplicationUI::makeCall(QString number)
{
bb::system::Phone::smileytongue:hone phone;
phone.initiateCellularCall(number);
....................
But this way the phone app UI still appears.
By reading the Phone Class reference, I can't find other method which will do differently.
I am probably missing something ?
Please advice.

Best regards - Nick !
Please use plain text.
New Contributor
errno
Posts: 8
Registered: ‎11-14-2013
My Device: BB Z10
My Carrier: Globul BG

Re: Phone call without invoking system dialpad

P.S.
Sorry for posting the source in the previous reply like this.

Regards - Nick
Please use plain text.