Use StringBuffer on BlackBerry

Hi there everyone,

I'm trying to give a sense of the documentation on best practices to use when developing for BlackBerry. One of the elements addressed StringBuffers:

Avoiding StringBuffer.append (StringBuffer)

To add a string buffer to another, must use a Java Application from BlackBerry®

net.rim.device.api.util.StringUtilities.append (StringBuffer StringBuffer src, dst [, int offset, int length]).

Now this means that we should not use StringBuffer in the following scenario.

StrigBuffer buffer = new StringBuffer();

buffer. Append ("Some String"). Append ("another string");

or

buffer. Append ("a string");

buffer. Append ("another string");

Alternatively, hehehe, East - this linked to add two StringBuffer? There is also example code in the PDF (http://docs.blackberry.com/en/developers/deliverables/3831/JDE_4.5_Fundamentals_Guide.pdf - Page 17)

Code example

public synchronized StringBuffer append (Object obj) {}

If (obj instanceof StringBuffer) {}

StringBuffer sb = (StringBuffer) obj;

net.rim.device.api.util.StringUtilities.append (this, BS, 0, sb)

Back to this;

}

Return append (String.valueOf (obj));

}

In this regard, that means * that * consult? All ideas and suggestions are welcome.

Thank you!

Schalk

as long as add you strings to the stringbuffer, you are good.
by adding another stringbuffer should be avoided, instead the stringutilities method should be used.

Tags: BlackBerry Developers

Similar Questions

  • Can I use getAppProperty on BlackBerry 9000

    Quote from previous forums:

    Guest: Willy
    Can I use getAppProperty on BlackBerry 9000
    Posted the: 11 July 2008 15:41
    Response
    MIDP allows to read the .jad file properties file using the method "getAppProperty". Is there anything like her using RIM, which can change its properties without having to compile the project?

    Holders of BlackBerry 9000 "BOLD" jad reading attributes of file using the MIDlet.getAppProperty method.  Please see the link below for more information.

    How - to read the attributes of a JAD file programmatically

    DB-00638

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800646/How_To _...

    No, reading of jad file attributes is not supported in the version of BlackBerry device under 4.3 software

  • Use of data blackBerry Passport Standby mode

    Hello, I have a problem with the use of data from the idle mode on my passport for BlackBerry. IT uses the largest amount of data, more than any other about 650 mb in 8 days. When I enter the application manager and tap the Standby Mode it constantly shows in any case "no use of data during the last 48 hours" and the leeks of data... could you explain what happens?

    Probably, it is the synchronization of e-mail and other data for example, if you have a cloud service like box or dropbox sync to your device.

  • Use of data blackBerry on Z10 Z10

    The use of my data is 2 to 3 times higher than with my Z10 he was with my previous Blackberry models.  I've been told 10 series of Blackberry phones compress not given, and my use is higher than before.  Do you know if it is accurate.

    With the Z10 there no compression of data more like before with the older BlackBerrys. Basically, BlackBerry exchanged compression for speed.

  • How to change the title for the alert box using javascript in Blackberry Z10?

    Hi all

    I developed 10 Blackberry webworks using the emulator to ripple and Blackberry Webworks SDK 1.0.4.11.In I use box alert and drop-down list in Javascript... When you use those Blackberry Z10... It displays the title for the alert "JavaScript Confirm" box and the "Select"dropdown list... So I want to change the title for these controls. Please me... Thanks in advance...

    Kind regards

    Marimuthu_P

    Alerts are native OS controls and you can not change the titles.

    You can use the WebWorks dialog API to create custom if dialog boxes:
    https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.UI.dialog.html

  • BIS - B using outside of BlackBerry Alliance program

    Hello

    I would like to ask if it is legal to use the BIS - B connection outside of BlackBerry Alliance program settings. If somehow, I became aware of the required parameter, but I am not a member of the alliance program, could I use it? Would it be legal?

    Thank you.

    "If the RIM is going after anyone using the service without permission: who knows?

    And the point of my post above is that RIM can track the traffic on their infrastructure and can determine who is, and who has not asked permission.

    In addition, as I understand it (and this isn't my field) it is against the terms of the agreement of the Alliance to publish the code, so put this provision, someone who has broken their agreement.

  • How do you see the System.out.println (without using Eclipse and BlackBerry JDE)

    Hi all

    I just want to know if there is no solution to see System.out.println.

    I use neither Eclipse nor BlackBerry JDE for my development.

    I have my jar, jad files. I convert my jar file using the CAP tool. The .cod files are generated.

    I start the trainer. Now I have 2 windows: Windows Simulor and the output (see picture).

    Then I load my .cod files. But I see not all System.out.println ("...") in the output windows.

    How can I see these System.out.println ("...")?

    Please help me.

    Thank you all.

    Thanks for your help.

    I try your solution EventLogger.

    But I have another problem:

    My request is not a native application (it is a midlet in J2ME, not a UIApplication). Do you think that it will work with EventLogger?

    How can I make a registry for EventLogger:

    static boolean register(long guid, String name) 
    Registers the name and the guid of the calling application.
    static boolean register(long guid, String name, int viewerType) 
  • How to use EDP on BlackBerry 8830?

    Hello guys.

    I am a member of www.vzwdevelopers.com. In fact, I registered on this site, in order to to use POE to my Blackberry application.
    I read a few question here. I need to make this point: GPSSettings.setPDEInfo (";" + clientID + ';' + password, 0);

    You have perhaps faced with my problem before. So, I hope you can help me.

    How can I get clientID and password?
    I need a manual to take the first steps.

    Please help me guys.

    Thank you.

    Closed.

  • BlackBerry Smartphones can not add or Remove Applications using the latest Blackberry Desktop Application, 700_b060_multilanguage.

    1. I was running Blackberry Desktop BBM 610_b038_multilanguage.

    2. I installed it yesterday, 700_b060_multilanguage.

    3. I was offered an update of my device software, 5.0.0.975 I did not because I wanted to take a backup first.

    4. after the backup, when I tried to update, he told me that no updates exist.

    5. after that, when I plugged in the set, I saw many new options in the Application section.

    6. There was a lot of languages and applications such as Facebook obnoxious that I didn't.

    7. I can't be able to add/remove languages, AND other Applications.

    8. I select (+) or clear (x) my required applications and click apply.

    9. something seems to happen, and then I'm back to the same page where I was with the same Applications installed that were there at the beginning. Two options that are at the bottom of the section that tells the actions pending poster always two actions that were there in the first place.

    10. What can I do to remove the additional languages and installed applications and install this than anything I really need?

    Thank you.

    PAL

    PS. I can't have a data Plan on this subject for the next two weeks or so my number is in migration to be a pre paid to a post paid connection that offers services of BB.

    sdgardne wrote:

    FYI... we seem to be discussed a set of interrelated issues on multiple threads... Here is a...

    I do not know where to consolidate them all for... According to me, that there are more threads with same interdependent questions...

    This is not useful at all.

    Double and permutation on the same questions just causes frustration users trying to follow different threads and various information.

    So let's abandon this thread.

  • Use of Smartphones blackBerry to the Mexico

    I will be going to Mexico in 2 weeks and would like to know if I'll be able to use the internet and check my email on my Blackberry Curve 8330, while I'm there? My service is the United States. Anyone know?

    I contacted the supplier of world food DAY and here's what I learned: the Blackberry Curve 8330 data services will not work to Mexico, if your service is the United States. You must have the world edition phone for data services. The phone itself would work for $3.00 per day more than $1.99 per minute for incoming and outgoing calls. Text messaging also will not work.

    Thanksfor the tip.

  • Use only the blackBerry PDA Smartphones

    How can I synchronize a blackberry that I use as a PDA only?  I have Lotus Notes at work.  And I thought I'd be able to synchronize the blackberry with this via the USB connection.  Is this possible?  I was a user pilot Palm and I want the same functionality I had previously.  Only, I have a blackberry because my office only allows BB 8800 or better.  I don't have a wireless plan.

    There is the Blackberry Desktop Manager software to make the synchronization between the device and Lotus Notes.

    You can download it here: http://na.blackberry.com/eng/services/desktop/

    Download, install, connect your device via USB cable to your desktop computer and run Blackberry Desktop Manager.

  • Cannot use maps of blackBerry Smartphones

    Why my blackberry pearl 9105 cannot use maps or GPS system...? Please help me...

    Hi and welcome to the forums!

    Do you have a data plan with your carrier? A WI - FI connection is not sufficient.

    Thank you

    Bifocals

  • BlackBerry smartphone how to use GO to Blackberry storm browser option

    Maybe someone can help me because I can't understand it. When you use the browser on your blackberry storm and you click go to and then you manually type in an address that is not already stored in your bookmarks, how to go to this Web site. For instances. Let say I wanted to go on msn.com. I go to google and type in MSN, and then click the link. I should be able to click on GO to and type MSN.com and click OK, but when I type this address or any address for this fact I do have a button print or anything like that. Someone please help

    Hello. On the keyboard, use the arrow curved on the right side after typing a web address. This is the keyboard key entry.

  • How to use gotomypc torch BlackBerry Smartphones. How to install java?

    I just bought a blackberry with ATT as carrier torch. I would like to be able to use the torch to connect to www.gotomypc.com , but it says that java is required when using the web browser. How to install java on the torch so I can use the gotomypc Web site? A link to download would be great. Thanks for any help.

    You can not install the readers of applet Java on the BlackBerry Torch.

    If you want to control your PC from Windows of a torch, you get another protocol of control, such as VNC or RDM.
    for VNC and RDM, you can find apps for your torch on App World.

  • BlackBerry® Smartphones old used email on Blackberry

    Hi all!

    I'm trying to help a friend who just bought a blackberry out of a seller of BB used on Ebay. The device came she seems to be in great shape and I helped to put all this on his server at work. I did a 'Wipe' pocket, first, before doing anything, and in the process, I found myself doing a second time. It syncs great with his company server.

    The problem we have is that it came with a gmail address, I suppose, the former owner configured on it. Surprisingly, when I wiped your handheld, address account re-appearedd!   I went in the emails set up to try to delete this e-mail, but it does not appear on the list at all. I even wiped the Pocket once 3rd, and it reappears every time.

    My friend will try to send an email to the seller, but in the case where he won ' [t do something, does anyone have any ideas on how I can get rid of this email on his Blackberry "BOLD" address?]  He tried emailing and the answer he got was in Spanish... it or me know Spanish and we don't Koe anyone who does.

    Thanks for all the ideas!

    HI and welcome to the Forums!

    Wipe the bag in fact don't delete anything an account configured bis. The reason is that the Setup for this e-mail address is not on the HH... it's rather within the system the carrier BIS former owners. You must get in touch with them and ask them to contact their provider, close their BIS account and have the carrier to release the PIN from their BIS. Then a BIS account could be created on the new system of carriers, in which personal email accounts can be configured.

    Good luck and let us know!

Maybe you are looking for