1. wojc0008's Avatar
    I'm tring to write my software to support the Blackberry Bold and it seems that the Bold string handling shifts strings by one position. A charAt function does not return the same result on a Bold compared to all other Blackberries. Is this an issue with the simulator or is it a new way of string handling?

    Can anyone try doing something like this on the 9000? Or even the 9000 Simulator? Does the 9000 simulator give you null as the result? On all other Blackberries, I get a '1'.


    Code:
    String test = "123456789";
    char first_char;
    first_char = test.charAt(0);
    10-27-08 06:26 PM
  2. wojc0008's Avatar
    I guess it works with standard strings but not with the getDisplayPhoneNumber function. (I was trying to simplify the error). For the 8800 and most others, the charAt(0) returns the first number in the phone number. On the 9000 and higher, getDisplayPhoneNumber returns a char array and on the 8800, it returns a byte array! Weird!


    String phoneNumber;
    PhoneCall callInfo = Phone.getCall(callid);
    phoneNumber = callInfo.getDisplayPhoneNumber();


    On 9000 (Bold)


    On 8800


    I just tested with the following and first try, it fixes my problem. I can now test to see if the first character is a number or not.

    Code:
        String phoneNumber;
        PhoneCall callInfo = Phone.getCall(callid);
        phoneNumber = callInfo.getDisplayPhoneNumber();
    
    
          char[] tmp20;
          char temp;
    
          tmp20 = phoneNumber.toCharArray();
          if(!Character.isDigit(tmp20[0]) )
          {
              temp = 'N';
          }
          else
          {
              temp= 'Y';
          }
    10-28-08 10:50 AM
LINK TO POST COPIED TO CLIPBOARD