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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
New Developer
Posts: 5
Registered: ‎09-15-2008
My Device: Not Specified

4.6.0 Bold Simulator location is always 0

I am using the Bold simulator and MDS-CS from the JDE 4.6.0 I downloaded, the browser is working fine and can connect to the web sites.  However, the Location object always returns 0 for both latitude and longitude properties.

 

Here is the code I used to obtain the latitude longitude information:

            // called when location object changes
            function locationCB() {
                window.alert("locationCB: Latitude " + blackberry.location.latitude);
                window.alert("locationCB: Longitude " + blackberry.location.longitude);
                return true;
            }

            // test to see if the blackberry location API is supported
            if (window.blackberry && blackberry.location.GPSSupported) {
                this.document.write("GPS Supported");

                blackberry.location.onLocationUpdate("locationCB()");
                blackberry.location.setAidMode(2);  // I have tried 0, 1 and 2

                blackberry.location.refreshLocation();
            }   
            else {
                this.document.write("This Device doesn't support the Blackberry Location API");
            }
 

I manually refreshed the location information on the phone after using the environment command to set the location values (e.g. 43.0, -79.0).  The phone was showing the correct value before I ran the web page.

 

Is this a known problem or I have missed something?

 

Any help is appreciated.  Thanks.

BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: 4.6.0 Bold Simulator location is always 0

Please try clicking on the Simulate menu and choose GPS Location. Do you see a change when you select a different location?

 

Within the BlackBerry Simulator you can verify the location by going to Options, Advanced Options, GPS and observing the GPS coordinates.  Is this screen showing a non 0 value?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
New Developer
Posts: 5
Registered: ‎09-15-2008
My Device: Not Specified

Re: 4.6.0 Bold Simulator location is always 0

Yes, it does.  The GPS Location is refreshed to the values I changed. 

 

The values are changed using fledgecontroller Location(43.0,-79.0,0,-1), etc.

 

Thanks.

BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: 4.6.0 Bold Simulator location is always 0

Does your page prompt you to allow GPS access?  If not please ensure that the following are enabled in the BlackBerry Simulator.

 

JavaScript, to verify it is enabled:

1.  Open the browser.

2.  Select Options from the menu.

3.  Select Browser Configuration.

4.  Check off Support JavaScript.

 

JavaScript Location Support

1.  Open the browser.

2.  Select Options from the menu.

3.  Select General Properties.

4.  Check off Enable JavaScript location support.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Highlighted
New Developer
New Developer
Posts: 5
Registered: ‎09-15-2008
My Device: Not Specified

Re: 4.6.0 Bold Simulator location is always 0

I have missed the second part.  It is working fine now.

 

Thanks so much for your time and help.