Phone screen Action

So, I have the following code provided by RIM ready to use in my application:

package com.rim.samples.device.phonescreendemo;

import net.rim.blackberry.api.phone.AbstractPhoneListener;
import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneCall;
import net.rim.blackberry.api.phone.phonegui.PhoneScreen;
import net.rim.blackberry.api.phone.phonegui.PhoneScreenVerticalManager;
import net.rim.blackberry.api.phone.phonegui.PhoneScreenHorizontalManager;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;

/**
 * This class listens for incoming calls.  When either of the callIncoming(),
 * callWaiting(), or callInitiated() callbacks have been invoked, this sample
 * application will send data to the incoming and active call screens.
 */
public final class PhoneScreenAction extends AbstractPhoneListener
{
    private Application _app;

    /**
     * Constructs a new PhoneScreenAction object
     * @param app A reference to the Application instance
     */
    public PhoneScreenAction(Application app)
    {
        _app = app;
    }

    /**
     * Creates various managers and fields contained within a PhoneScreen object
     * which then sends its data to the Phone application's foreground screen.
     *
     * @param callid Id of an incoming call
     */
    private void sendPhoneScreenData(int callid)
    {
        PhoneCall phoneCall = Phone.getCall(callid);

        if(phoneCall != null)
        {
            String phoneNumber = phoneCall.getPhoneNumber();

            if(phoneNumber.equals("5550111"))
            {
                // Initialize PhoneScreen
                PhoneScreen phoneScreen = new PhoneScreen(callid, _app);
                phoneScreen.setScreenForeground(Color.POWDERBLUE);                                

                // Create a PhoneScreenHorizontalManager
                PhoneScreenHorizontalManager phoneScreenHorizontalManager1 = new PhoneScreenHorizontalManager();

                // Create a Bitmap
                Bitmap bitmap = Bitmap.getBitmapResource("logo.jpg");

                // Get phone screen dimensions
                XYRect incomingLandscape = PhoneScreen.getDimensions(PhoneScreen.LANDSCAPE, PhoneScreen.INCOMING);
                XYRect activeLandscape = PhoneScreen.getDimensions(PhoneScreen.LANDSCAPE, PhoneScreen.ACTIVECALL);
                XYRect incomingPortrait = PhoneScreen.getDimensions(PhoneScreen.PORTRAIT, PhoneScreen.INCOMING);
                XYRect activePortrait = PhoneScreen.getDimensions(PhoneScreen.PORTRAIT, PhoneScreen.ACTIVECALL);              

                // Get phone screen widths
                int incomingLandscapeWidth = 0;
                if(incomingLandscape != null)
                {
                    incomingLandscapeWidth = incomingLandscape.width;
                }
                int activeLandscapeWidth = 0;
                if(activeLandscape != null)
                {
                   activeLandscapeWidth =  activeLandscape.width;
                }
                int incomingPortraitWidth = incomingPortrait.width;
                int activePortraitWidth = activePortrait.width;             

                // Calculate minimum width for active and incoming phone screens in portrait or landscape orientation
                int minWidth =  Math.min(incomingPortraitWidth, activePortraitWidth);
                if(activeLandscapeWidth > 0)
                {
                   minWidth =  Math.min(activeLandscapeWidth, minWidth);
                }
                if(incomingLandscapeWidth > 0)
                {
                   minWidth = Math.min(incomingLandscapeWidth, minWidth);
                }

                int bitmapWidth = bitmap.getWidth();
                int bitmapHeight = bitmap.getHeight();

                // Resize the bitmap if its width exceeds the minimum width
                if(bitmapWidth > minWidth)
                {
                    Bitmap bitmapScaled = new Bitmap(minWidth, bitmapHeight);

                    // Scale the original Bitmap into the new Bitmap using
                    // a Lanczos filter.
                    bitmap.scaleInto(bitmapScaled, Bitmap.FILTER_LANCZOS);

                    // Assign the bitmap and bitmapWidth references
                    bitmap = bitmapScaled;
                    bitmapWidth = bitmap.getWidth();
                }                

                // Calculate and set padding
                int displayWidth = Display.getWidth();
                int padding = (displayWidth - bitmapWidth) / 2;
                phoneScreenHorizontalManager1.setPadding(0, padding, 0 , padding);

                // Add the bitmap image to the PhoneScreenHorizontalManager
                // and add to the phone screen.
                phoneScreenHorizontalManager1.addImage(bitmap);
                phoneScreen.add(phoneScreenHorizontalManager1);                             

                // Create a PhoneScreenVerticalManager and add fields
                PhoneScreenVerticalManager phoneScreenVerticalManager = new PhoneScreenVerticalManager();
                phoneScreenVerticalManager.add(new LabelField("Adam McCombs/Junior"));
                phoneScreenVerticalManager.add(new LabelField("Coach Notes: Loves Biking"));               

                // Create a PhoneScreenHorizontalManager, set padding and
                // add the PhoneScreenVerticalManager.
                PhoneScreenHorizontalManager phoneScreenHorizontalManager2 = new PhoneScreenHorizontalManager();
                phoneScreenHorizontalManager2.setPadding(0, 60, 0, 60);
                phoneScreenHorizontalManager2.add(phoneScreenVerticalManager);             

                // Add fields to PhoneScreen and display
                phoneScreen.add(phoneScreenHorizontalManager2);
                phoneScreen.sendDataToScreen();
            }
        }
    }

    /**
     * @see AbstractPhoneListener#callWaiting(int)
     */
    public void callWaiting(int callid)
    {
        sendPhoneScreenData(callid);
    }

     /**
     * @see AbstractPhoneListener#callInitiated(int)
     */
    public void callInitiated(int callid)
    {
        sendPhoneScreenData(callid);
    }    

    /**
     * @see AbstractPhoneListener#callIncoming(int)
     */
    public void callIncoming(int callid)
    {
        sendPhoneScreenData(callid);
    }
}

Basically it displays a screen action when some number of calls. My question is can I perform a loop to the variable 'phone number' and cross check with numbers I is stored in a database using an XML query and choose to display phone action if a Boolean value returns true? If so how would I implement that by using this code?

one way... 1. first... u must implement phoneListener where appropriate call discount method check you the number with your database and mark a flag... 2. then show you phonescreen according to your flag screen... Another way... have you checked in phonescreen just before displaying the popup, it based on audit outcone... start 'resolved' + kudoes

Tags: BlackBerry Developers

Similar Questions

  • Why my phone screen randomly with lights to touch me.

    Why my phone screen randomly turns without touching myself.

    It might be background notifications (this happens with email on the iPhone of my mother). You can configure notifications by going to settings-> notifications. In addition, if you have an iPhone 6s, 6s, SE, iPhone 7, 7 more, they "raise to wake you up" that allows the user to raise to reactivate the user's iphone. I hope this helps!

  • MY PHONE SCREEN IS BLACK, PHONE WILL RING AND ICAN HEAR THROUGH THE MESSAGES BUT CAN NOT SEE ANYTHING AT ALL

    MY PHONE SCREEN IS BLACK, PHONE WILL RING AND ICAN HEAR THROUGH THE MESSAGES BUT CAN NOT SEE ANYTHING AT ALL

    Try this restart your iPhone, iPad or iPod touch - Apple Support

    If this does not work, it may be a hardware problem.

    Hope this helps, good luck to you.

  • my phone screen is broken

    My phone screen is broken. I can not even use my phone now! How can I solve this problem? It is the only solution to buy a new phone?

    Glass price $100, you can call
  • My I phone screen see the black with a command like a dos {nand} system...

    My I phone screen see the black with a command like a dos {nand} system...

    Your phone has a serious problem. You can try to reboot (hold home and power at the same time for about 10-30 seconds buttons), but if that does not work, your hardware is probably fried. Make an appointment at your nearest Apple Store Genius Bar for confirmation.

  • A way to keep active Wifi when the phone screen crashes?

    I noticed that, although my wifi signal is lower than we should, it is not randomly drop out. He does, however, is drop out whenever the phone screen will Dim and locks (IE, home struck and then slide to unlock).

    It's incredibly annoying! Is it possible to keep wifi on and connected to what I explicitly disable? It makes the option "synchronize then on the wifi only" totally useless. And I'm on wifi almost all the time. Whenever I open the phone, I expect to be in wifi to do something - not wait for a reconnection.

    Seriously, it is a show-stopper for me. If I can't find a way to keep the wifi between the locks of the screen, I have to exchange the phone for anything else.

    Surgo wrote:I've noticed that, while my wifi signal is weaker than it should be, it doesn't randomly drop out. What it does do, however, is drop out whenever the phone screen goes dark and locks (ie, hit home then slide to unlock).
    
    This is incredibly annoying! Is there any way to keep wifi on and connected until I explicitly disable it? It makes the "sync while on wifi only" option entirely useless. And I'm on wifi almost all the time. Whenever I open the phone, I expect to be on wifi to be able to do something -- not wait for a reconnect.
    
    This is very seriously a show-stopper for me. If I can't find a way to keep wifi on between screen locks, I'm going to have to exchange the phone for something else.
    

    As far as I know, you can tell the standby policy wi - fi to do 1 of 3 things:

    (1) when the screen is off

    (2) never when it is plugged

    (3) never

    You can get these settings by migrating the following steps:

    1. Parameters
    2. wireless & networks
    3. WiFi settings
    4. menu key (lower-left)
    5. Advanced
    6. policy watch Wi - fi

    If there is no other means, I would like to learn them as well.

  • site returned more phone screen

    Hello

    I'm trying to make this sensitive site (annabaker.es) but does not not on a phone screen.

    I tried to put all the text boxes and images such as "stretch to the width of the browser" and then "width sensitive", but except the header of all the other boxes seem to be loose on the phone screen, you can scroll through and boxes of moving from right to left, showing a white background.

    I'll appreciate any help with this issue.

    Thank you

    You have solved the problem yet?

    In the opposite case: make sure you have all the objects that extends off the screen when you resize the page. I had a similar problem today and fixed by setting all my sensitive width text boxes. When you resize the browser text areas to get closer, but not always following the speed of the page. This means that some areas of text could extend more further than the edge of the screen on the width of your minimal page, even if you have reactive width on each page object. To fix this, just create a new breakpoint as wide as the width of your minimal page and make sure that no object extends farther than the edge of the screen width.

  • tables and cell phone screen

    Does anyone know an html tag or css that can load another page, if the browser detects Web site is loaded on a phone screen?  or any other solution to put a couple of things in tables maybe so they load correctly on a mobile phone?  I have some pages I'm working very well and they load fine on my laptop and my MS Surface, but watching them in dreamweaver using the resolution feature, the tables don't look just to the right, so I would like to know if there is an alternative out there that might work and always show things in a table properly.

    Thank you.

    Use div tags 3 or more floating that breaks over a width of single column on smaller devices.

    CSS MEDIA QUERY

    =================

    @media only screen and (min-width: 769px) {}

    . Row {overflow: hidden}

    / * clear floats * /.

    . Row: after {}

    Clear: left;

    Display: block;

    content: '.';

    visibility: hidden

    }

    . Box {}

    Width: 33.33%;  / * 3 rows * /.

    float: left;

    }

    }

    HTML CODE:

    ================

    It's 1 box

    It is area 2

    It's box 3

    It's 1 box

    It is area 2

    It's box 3

    Nancy O.

  • My phone screen is not full screen on the phone, as they appear in Design view.  How to solve this problem?

    My phone screen is not full screen on the phone, as they appear in Design view.  How to solve this problem?

    Hey Wilson,

    Please contact the technical support contact customer service if the problem persists.

    Kind regards

    Akshay

  • Phone screen has gone

    Please help: last night I plugged my phone into the charger and left the phone.  This morning the screen turned upward, but empty.  When I press the telephone button I get a white blank screen followed by the main home menu.  I tried to reset soft & hard and I have hot syncd it.  I can receive calls but I can't because there is no longer a phone screen and when I push keys on my keyboard nothing happens.

    Any suggestions out there?  Thank you!

    Thank you!!!  I was not properly doing the hard reset.  You saved me buying a new phone for business.  The phone came back after the hard reset.

    Message is about: Treo 755 p (Verizon)

  • For CS5 phone screen resizing

    I use CS5 to create a Web page, and I try to use media query to resize my text on web page for phone screens. I have a css phone, but apparently not kick when I open the page on a phone.  Also, when I watch multiscreen, it doesn't seem something like what is coming up on my phone.  The phone resizes my page and the text much smaller than what is shown in the multiscreen.  If it looks like the multivision example that would be much better.  Thanks for any help.

    I think I'm probably you leading down the wrong road. Add this line in yoursection and see if it's what you will.

    EDIT: Here is some info from the MQ of iphone...

    http://Stephen.IO/mediaqueries/#iPhone

  • phone screen does not no need to get my pictures in my laptop, how?

    I broke the screen of my phone and I want my photos and videos transferred to my computer, but my phone has not been saved in a couple weeks is possible to get the images?

    Do you use the iCloud photo library to synchronize? If so, they should be on iCloud.com and your Apple ID. Or have you activated backup in settings > iCloud > Backup? You can make automatic backups. However, if the iCloud photo library is enabled, you pictures will not be in a backup to iCloud.

    Otherwise, no. If you do not save them, where they do you hope?

  • Skype sign in the problem solved in phones screen touchscreen nokia s60v5 symbiam.

    Hi NOKIA users!, I solved the Skype sign in problem for nokia 5800 and all the symbian (s60 v5) of touch screens... Now, how to resolve this problem, follow these steps.
    Skype 1.Install in your phone's memory...
    2 hack your phone with these easy steps =
    3. install Norton symbian hack into your phone.
    4. after the installation, open it and open 'Options', then click on "Anti-virus" and then click Quartinine the list, then click on ' restore all.
    4. install Plus patch Rom and open it... you will see two options = Install serv for all, and 'open to all'.click on these and two options will be output green.now rom patcher.
    5. now download the zip from this link =
    www.4shared.com/zip/a9Ubez_gce/Skyp_sign_in_files_for_s60_v3_.html .

    Unzip it and you will have two files = Shared.xml and shared.lck...
    6.now COPY files of teas on c: phone memory/private/20024 D 77 q
    ("- q" is the name of the folder, now both q and - q).
    7.attention! You must install the Netqin Mobile guard to copy these two files.
    8 install and open Netqin mobile guard.click to file manager, click memory c: from the phone... you will see a folder name is 'PRIVATE'... open draconian, open the file, the name is'D 20024, 77'... Here, you will see a folder whose name is "-q" If this folder is not here, create the folder = - q... Now copy these two files (shared.xml and shared.lck) in this folder.
    9.now try to sign in.skype sign on the first try... Enjoy. For more information, contact www.facebook.com/tanveer.afzal.334

    File download link =
    www.4shared.com/zip/a9Ubez_gce/Skyp_sign_in_files_for_s60_v3_.html ...

    Hi friends! I changed my facebook email.
    But I'm telling you that Skype will no more work to buy everything from phone.plz symbian, a mobile phone androia to continue using Skype! Buye.

  • the iPhone 6 vacuum but on the phone screen. Screen is confirmed good on another phone

    If a friend gave me his iphone 6 to see if I can fix it.  Originally, the screen was broken/broken and was replaced (out-of-warranty repair by non-authorized repair service).  The phone has worked but deleted soon after.  Then all of the sieve was subscribed and put it in another phone and worked very well. I have checked and cannot see damage to the pins of connection on the Board because it the screen in the process of downloading an update of the software to try it.

    Is there a way to allow access to the computer and the iphone without a working screen drag? I managed to restart into recovery/download mode that brought the update to start the download, but he returned to request access after a certain time - download update is still in progress.

    Also, I did a LOT of reading about it, is apple offering free repairs for all that widely "known issue" with the iPhone 6? possible and other models?

    kjmck1 wrote:

    If a friend gave me his iphone 6 to see if I can fix it.  Originally, the screen was broken/broken and was replaced (out-of-warranty repair by non-authorized repair service).  The phone has worked but deleted soon after.  Then all of the sieve was subscribed and put it in another phone and worked very well. I have checked and cannot see damage to the pins of connection on the Board because it the screen in the process of downloading an update of the software to try it.

    Is there a way to allow access to the computer and the iphone without a working screen drag? I managed to restart into recovery/download mode that brought the update to start the download, but he returned to request access after a certain time - download update is still in progress.

    Also, I did a LOT of reading about it, is apple offering free repairs for all that widely "known issue" with the iPhone 6? possible and other models?

    Given that unauthorized third-party cancels all service options & support running on Apple, your question goes beyond the limits of this forum.  I recommend that you are looking for an answer also.

  • I phone screen 5 came out

    Today, I was on my i phone 5 then it froze all of a sudden the screen went black... I still receive calls, I can speak to siri, but the screen is black, wjat I do I don't think that my screen went out or something please help

    There a reset or restore will not get the rear screen, so it's probably hardware. Make an appointment at the Genius Bar to the nearest Apple store or service provider authorized Apple and watched it.

Maybe you are looking for

  • How can I stop the app store of notifying me of an update?

    I can't update one of my apps on the app store, but the notification won't disappear.

  • Gmail IMAP will not be synchronized in the background

    I have multiple imap Gmail accounts. For the past several months, they stopped sync in the background and sometimes cannot connect to smtp either. When I open the mail, it does not connect. If I leave the e-mail, then restart it, it will start the sy

  • How can I correct the mistakes of PMSpeed.exe

    As my computer starts up, I get an error that says "PMSpeed failed to load. It is also said that something about INSO Library failed to load. Is PMSpeed a type of file that is needed by XP to run right? If not, can I find the file and delete? I ran t

  • Illustrator cs3 does work, using windows

    I tried to launch Adobe Illustrator, the other day on my laptop. I got an error message saying that the license was expired and try to reinstall the software. I tried but no luck, it's now failing install. Help?

  • Why CC 2015.1 allow me to work with the vector Smart Objects?

    Since the update, I was unable to use the dynamic vector objects to switch between Photoshop and Illustrator. I can bring things manually, one to the other, but I don't like having to relocate my vectors whenever I need to change. This seems to be a