1. anw1652's Avatar
    I just sat down to continue my development efforts after a pause before which I had committed some work to Subversion via Subclipse. I started Eclipse and the first thing I did was to run the simulator, just to get caught up and remind myself where I'd left off, running it through the exact same sequence (supposedly) as when I left off before Christmas. This time when I ran it, though, I started having two very odd problems, one of which is extremely annoying and the other of which is a development show-stopper:

    The simulator keeps spontaneously starting without me telling it to debug or run, the only necessary condition apparently is having Eclipse open and the edit window on my desktop. If it is minimized in the task bar, this doesn't seem to happen. It may start two or three instantiations of the simulator, and it is not "connected" with Eclipse in the debug sense (i. e., the little squiggly doohickey marked "Disconnect" in Debug Perspective is grayed out and no startup messages appear in the console window). I have to start the task manager and kill whatever fledge and BbDevMgr processes are running to get rid of these extraneous, out-of-nowhere simulator startups.

    OK, that's annoying, but the show-stopper is this code snippet:
    Code:
    public boolean getFromUser()
        {
        System.out.println("NativeContact::getFromUser() trying...");
        try
            {
            // Should we do this in RoloContact, since that's where we're trying to isolate native code?
            System.out.println("NativeContact::getFromUser() calling choose()...");
            PIMItem pim_con= ((BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE)).choose();
            System.out.println("NativeContact::getFromUser() returned");
            if(pim_con instanceof Contact)
                {
                System.out.println("NativeContact::getFromUser got instanceof Contact; pim_con= " + pim_con.toString());
                contact= (BlackBerryContact) pim_con;
                System.out.println("NativeContact::returning");
                return true;
                }
            }
        catch (PIMException e)
            {
            // TODO Auto-generated catch block
            System.out.println("NativeContact::getFromUser: " + e.toString());
            e.printStackTrace();
            return false;
            }
        return false;
        }
    Except for the one in the catch clause, all the System.out.println's have been added since I've been fooling with this. The last time I ran this before Christmas it worked fine. When this function returned, I just popped up a dialog in the calling program that said "OK, here we are", waited for a click on the "OK" button, and exited. Now, when it executes the line with choose() in it, the Blackberry screen comes up just as expected. I can add or edit a contact, but it just hangs within the contact-choose screen; i. e., it won't just select and return to my program, but the contact app appears to continue to function.

    These seem like two unrelated problems, and I debated two separate posts, but they "all of a sudden" started happening at exactly the same time, and I am just not that much of a believer in coincidence (having said that, I'm certainly open to other opinions).

    Some additional information: I've tried to do a software update, and was informed that all the software was up-to-date; I've "cleaned" the simulator (as in "Project->Blackberry->Clean Simulator"), whatever that means, and also did a clean on the project, which in most cases seems to have magical restorative properties, but not this time. Also, the behavior is the same in the 8300 and the 8830 simulators. I'm developing on OS version 4.5.

    And, yes, I do know that in the computer world things don't just "all of a sudden" happen, but I can't think of anything I did over the past month that could have caused this. The last major mod I made to the IDE was to add the Subversion Subclipse plugin, but I used the system for at least a couple of weeks and, except for the incredibly touchy, delicate nature of Subversion CM (more the subject of a rant than a forum post;-), there seemed to be no problems. I am going to backtrack that and continue to play around with this, but I'm hoping that in the meantime someone may have some insight.

    TIA...
    Allen
    01-07-11 12:25 PM
  2. anw1652's Avatar
    Hello? Anyone home?

    Since posting, I've broken the choose() call into individual statements & variables, downloaded three brand new, untarnished simulators, and still no joy; just goes into the address book, wihch seems fine adding & editing contacts, etc., but never comes out. Here's a partial stack trace of the app when in the address book:
    Object.wait() line: 480
    SlickSwitch(Application).startModalEventThread(Mod alEventThread) line: 2255
    UiEngineImpl.pushModalScreen(Screen) line: 979
    SlickSwitch(UiApplication).pushModalScreen(Screen) line: 308
    AddressSelectionVerb.invoke(Object) line: 120
    ContactListImpl$ChooseContactRunnable.run() line: 966
    SlickSwitch(Application).invokeAndWait(Runnable) line: 2147
    ContactListImpl.choose() line: 944
    RoloContact$NativeContact.getFromUser() line: 533
    RoloContact$NativeContact.<init>(RoloContact) line: 508
    RoloContact.<init>(boolean) line: 85
    Rolodex.select() line: 138
    SlickInit.yesPressed() line: 83
    SlickScreens$InitScreens$Query2Initialize(UtilScre ens$HelpDlg).fieldChanged(Field, int) line: 137
    BitmapButton(Field).fieldChangeNotify(int) line: 1405
    BitmapButton(UIButton).navigationClick(int, int) line: 263
    HorizontalFieldManager(Manager).navigationClick(in t, int) line: 3081
    UIScreen$2(Manager).navigationClick(int, int) line: 3081
    Evidently, the object (my application object?) is never getting notified.

    Does anyone out there have any ideas?? Is there anyone out there?
    01-08-11 08:36 AM
  3. MobileMadness002's Avatar
    I'm kind of curious here. In your try/catch statement you have a return false statement in the catch. But there is no return true statement in the routine. Am I reading this correct?
    01-08-11 06:40 PM
  4. anw1652's Avatar
    Sorry about the delay. I never got an email that someone responded. I'm still having this problem after a hiatus doing a system upgrade.

    No, that's not quite right. Notice that if the return from choose() is an "instanceof" Contact, it returns true; the only other two options are that an exception is thrown, in which case false is returned, or that the return is NOT an "instanceof" Contact, in which case the code falls through the try/catch block and false is also returned.

    Note that my problem is not an erroneous return, but that the choose() call (PIMList method) never returns.
    Last edited by anw1652; 01-29-11 at 11:56 AM. Reason: Clarify Problem (last sentence added)
    01-29-11 11:50 AM
  5. EveryApp Mobile's Avatar
    I developed an application (EveryLock) that uses the popup contact list chooser and I've had ONE person tell me that when he selects something, it just hangs. However, I cannot reproduce the problem no matter what happens. Have you tried it on other OS? It works fine for me on OS 5 and OS 6. Btw, you shouldn't develop for OS 4.5 anymore. It will be completely dead soon. Probably within another year. You should do 4.6 and up.

    This is my code and it works fine on every phone I have.

    PIM pim = PIM.getInstance();
    BlackBerryContactList contacts;
    try {
    contacts = (BlackBerryContactList)pim.openPIMList(PIM.CONTACT _LIST, PIM.READ_WRITE);
    PIMItem selected = contacts.choose();
    Last edited by EveryApp Mobile; 01-29-11 at 09:56 PM.
    01-29-11 09:53 PM
  6. anw1652's Avatar
    I think I'll take your advice about using 4.6 and up, but this was working on 4.5 and I've also tested it on the 9000/OS 4.6 (I think) simulator.

    I have just done a virgin (re)install with no Subclipse. I can't imagine that being an issue, but I figure I'll try everything because I'm sure any BB help will be predicated on a 100% supported environment.
    01-30-11 12:21 PM
LINK TO POST COPIED TO CLIPBOARD