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

Java Development

Reply
Contributor
Posts: 27
Registered: ‎06-28-2011
My Device: 9800
My Carrier: AT&T
Accepted Solution

Override incoming call screen

Hello,

 

Blackberry devices (OS 5.0 and above) allows us to override the phone screen by using PhoneScreen. I tried to do this but it does not work. I can add some fields to the Outgoing call screen, Active call screen but Incoming call screen.

 

I follow the guide at this link. I also signed my app with the developer signing code. Something's wrong?

 

Thanks.

Developer
Posts: 53
Registered: ‎11-13-2009
My Device: Not Specified

Re: Override incoming call screen

I think we'll need a little more information. When you say, does not work do you mean you get an error/exception. Or does nothing display.

A little look at your code would be beneficial too.
Contributor
Posts: 27
Registered: ‎06-28-2011
My Device: 9800
My Carrier: AT&T

Re: Override incoming call screen

Thanks for quick reply.

 

Following is the callIncoming method

		        ScreenModel screenModel = new ScreenModel(callId);
		        PhoneScreen phoneScreenPortrait = screenModel.getPhoneScreen(PhoneScreen.PORTRAIT, PhoneScreen.INCOMING);

		        LabelField labelField1 = new LabelField("Hello")
		        {
		            public void paint(Graphics g)
		            {
		                g.setColor(Color.GREEN);
		                super.paint(g);
		            }
		        };    
		        LabelField labelField2 = new LabelField(" to the World.")
		        {
		            public void paint(Graphics g)
		            {
		                g.setColor(Color.RED);
		                super.paint(g);
		            }
		        };

		        labelField1.setFont(phoneScreenPortrait.getCallerInfoFont());
		        labelField2.setFont(phoneScreenPortrait.getCallerInfoFont());

		        phoneScreenPortrait.add(labelField1);
		        phoneScreenPortrait.add(labelField2);
		        
		        screenModel.sendAllDataToScreen();

 I found that I can override the incoming screen, but the text is very small.

Developer
Posts: 53
Registered: ‎11-13-2009
My Device: Not Specified

Re: Override incoming call screen

[ Edited ]

I'd imagine the text is small because labelField1.setFont(phoneScreenPortrait.getCallerInfoFont()); is creating a small font but don't hold me to that. Everything else looks fine.

 

Previously I've pushed my own screen. So in the callIncoming method I've done something like..

 

InboundScreen activeScreen = new InboundScreen();
            			UiApplication.getUiApplication().invokeLater(new Runnable() 
            			{
            				public void run() 
            				{
            					UiApplication.getUiApplication().pushGlobalScreen(activeScreen, 0,UiEngine.GLOBAL_SHOW_LOWER) ;
            				}
            				
            			});

 Then the screen class is something like

 

public class InboundScreen extends PopupScreen 
{
        public InboundScreen()
	{
		super(new VerticalFieldManager(USE_ALL_HEIGHT|USE_ALL_WIDTH|FIELD_HCENTER));    
	}
}

 Which you can use just like any other screen.

 

Hope that is some help, but to be honest it sounds like you're well on your way already Smiley Happy

Contributor
Posts: 27
Registered: ‎06-28-2011
My Device: 9800
My Carrier: AT&T

Re: Override incoming call screen

I removed line labelField1.setFont(phoneScreenPortrait.getCallerInfoFont()) but there is no change. It looks like the OS only allow me to add my controls to the bottom of the incoming call screen (please take a look at my snapshot)

I also tried to use another workaround to push a screen on top of the call screen by using override the onObscured() and onExposed of MainScreen. It seems something wrong, I can push my screen on the top but I can remove it.

Highlighted
Developer
Posts: 53
Registered: ‎11-13-2009
My Device: Not Specified

Re: Override incoming call screen

My Apologies, after an hour or so of trying to get this to work properly myself. I've realised I've given you incorrect information and it's not actually possible to override the incoming screen. See the thread below.

 

http://supportforums.blackberry.com/t5/Java-Development/Phone-callIncoming-question/m-p/151419

 

My apologies again.

 

Alan

Contributor
Posts: 27
Registered: ‎06-28-2011
My Device: 9800
My Carrier: AT&T

Re: Override incoming call screen

Dear Alan_Hollis,

Thanks for your help, I tried another solution and it look fine. Anyway, I think it is an issue of BlackBerry or maybe for security purpose and they do not allow us to customize the incoming call screen.

I think this topic should be closed here.