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

Android™ Development

New Contributor
Posts: 2
Registered: ‎03-17-2014
My Device: Q10
My Carrier: N/A

Having trouble getting recent call number

[ Edited ]

I have written an Android app designed for BB10 / Android systems and I have run into a problem with getting the most recent call's number on the system. I am currently using a PhoneStateListener to notify and open the app when a call has ended. Here is the PhoneStateListeners code:


public class PhoneStateManager extends PhoneStateListener{
	public static Boolean usingPhone = false;
	private MainActivity mainactivity;
	private String mIncomingNumber;
	public PhoneStateManager(MainActivity main){
		mainactivity = main;
	public void onCallStateChanged(int state, String incomingNumber) {
		switch (state) {
        case TelephonyManager.CALL_STATE_IDLE:
            Log.d("DEBUG", "IDLE");
            	Log.d("DEBUG", "number (PSM): " + mIncomingNumber);
            usingPhone = false;
        case TelephonyManager.CALL_STATE_OFFHOOK:
            Log.d("DEBUG", "OFFHOOK");
mIncomingNumber = incomingNumber; usingPhone = true; break; case TelephonyManager.CALL_STATE_RINGING: Log.d("DEBUG", "RINGING"); usingPhone = false; mIncomingNumber = incomingNumber; break; } } }


This code works fine for the askQuestion() call, but it does not receive any information about incomingNumber (which is null). I have also tried using Android's android.provider.CallLog to access call logs, but to no avail. Will this only work on an actual phone and not a simulator? Is there any way to access an incoming / recent call's phone number on a Android Runtime Application?

Posts: 140
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: Having trouble getting recent call number

This API is currently unsupported.


Appologies for this not being mentioned in the unsupported APIs list.

New Contributor
Posts: 2
Registered: ‎03-17-2014
My Device: Q10
My Carrier: N/A

Re: Having trouble getting recent call number

Ah, that's unfortunate. Is there any possible way on the Android Runtime to get a recent calls number? 

Thank you for the information regardless