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
Regular Contributor
Q3test
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

Progress Bar not working in blackberry ?

package mypackage;
/**
 * Test UiApplication
 */

import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class PleaseWaitDemo extends UiApplication {

    public static void main(String[] args) {
        PleaseWaitDemo app = new PleaseWaitDemo();
        app.enterEventDispatcher();
    }

    //constructor
    public PleaseWaitDemo() {
        //Create a new screen for the application
        pushScreen(new PleaseWaitDemoScreen());
    }

}

class PleaseWaitDemoScreen extends MainScreen {

    PleaseWaitPopupScreen _waitScreen = null;
    LabelField _resultField = new LabelField("Result in here");

    public PleaseWaitDemoScreen() {
        this.setTitle("PleaseWaitDemo");
        ButtonField startButton = new ButtonField("Start", ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
        startButton.setChangeListener( new FieldChangeListener() {
            public void fieldChanged(Field field, int context) {
                _waitScreen = new PleaseWaitPopupScreen("Please wait", "Wating for test Thread", "http://50.57.145.165:8080/FirstGroupRailApps/jservices/rest/appsetting?device_pin=cb");
                int result = _waitScreen.show();
                _resultField.setText("Result: " + Integer.toString(result));
            }
        });
        this.add(startButton);
        this.add(_resultField);
    }

}

 

Hi
I am making a progress bar .I want to increase or the value of prgress bar with http response .

So I found this of blackberry but it not work for me

But when I used this code wide my code it not work

 

http://supportforums.blackberry.com/t5/Java-Development/Sample-Please-Wait-or-Progress-Bar-Code/m-p/...

Please use plain text.
Developer
simon_hain
Posts: 15,874
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Progress Bar not working in blackberry ?

"it not work" is not a very good error description.
did you start the MDS with the simulator? can you open a web page on the simulator browser?
does the code work with www.google.com or similar?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Q3test
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

Re: Progress Bar not working in blackberry ?

Actually there is no connection between gauge field and http request.I need to increment when input stream is increase 

Please use plain text.
Developer
simon_hain
Posts: 15,874
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Progress Bar not working in blackberry ?

are you asking how to do that? or did you try to do that and it did not work?
your posts don't contain enough information.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Q3test
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

Re: Progress Bar not working in blackberry ?

Hi

I want to call web service using progress bar ..It mean when I call web service it % is 0 when the data is coming it % is Increase and approch to 100% .

 

Thanks

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: Progress Bar not working in blackberry ?

Do you know how many bytes you are going to download?

Please use plain text.
Regular Contributor
Q3test
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

Re: Progress Bar not working in blackberry ?

No ..i have only web service url 

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: Progress Bar not working in blackberry ?

So how are going to do this

"when I call web service it % is 0 when the data is coming it % is Increase and approch to 100%"

when you have no idea how many bytes make 100%?

Please use plain text.