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
Highlighted
Regular Contributor
Posts: 52
Registered: ‎02-26-2013
My Device: Curve 9650,Bold 9900
My Carrier: Airtel

Loading Screen for GPS Location Fetching

Hi

  I wants to create a loading screen for gps location .I have create a button( Get Location) on my screen .

  When i click on this button i wants a loading screen start and run until the app get the gps location from device.

   When app gets location(lat , long) this popup loding screen should close.

  Any code reference will be helpfull...!

 

Thanks in Advance

 

Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Loading Screen for GPS Location Fetching

For code that is getting your location, look at this:

http://supportforums.blackberry.com/t5/Java-Development/Simple-Location-API/ta-p/1145951

 

Personally I am not sure that you need to lock the user out while you are looking for a location.  But the simple approach to doing this is to push a popup screen and when you have got the location, pop it. I think this is demonstrated in here:

http://supportforums.blackberry.com/t5/Java-Development/Sample-quot-Please-Wait-quot-screen-part-1/t...

 

I am not aware of any sample code that does these two things together.  That can be your challenge!

Regular Contributor
Posts: 52
Registered: ‎02-26-2013
My Device: Curve 9650,Bold 9900
My Carrier: Airtel

Re: Loading Screen for GPS Location Fetching

Exactly i want the please wait screen until i found the Gps location, i get the gps location easily but no idea how to implement it with please wait screen..!

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Loading Screen for GPS Location Fetching

it can be done through using pop up screen... show that screen when fetch location starts and remove that if location fetches
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Loading Screen for GPS Location Fetching

"no idea how to implement it with please wait screen"

 

Have you looked at the link I provided?

Developer
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10
My Carrier: Vodafone

Re: Loading Screen for GPS Location Fetching

popHF = new VerticalFieldManager(); popHF.setBackground(BackgroundFactory.createSolidBackground(Color.WHITE));
popHF.add(new LabelField("Please Wait")); wait1Screen = new PopupScreen(popHF); wait1Screen.setBorder(BorderFactory.createRoundedBorder(new XYEdges(1,1,1,1), Color.DARKGRAY, Border.STYLE_SOLID)); new Thread() { public void run()
{ synchronized (UiApplication.getEventLock()) { UiApplication.getUiApplication().pushScreen(wait1Screen); }
// Enter Fetch Location Code here in try catch block
synchronized (UiApplication.getEventLock())
{
UiApplication.getUiApplication().popScreen(wait1Screen);
} } }.start();

 and in Catch Block add this code again

synchronized (UiApplication.getEventLock()) 
{
UiApplication.getUiApplication().popScreen(wait1Screen);
}