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

Adobe AIR Development

Reply
New Contributor
Posts: 4
Registered: ‎05-14-2011
My Device: Blackberry Playbook
My Carrier: None
Accepted Solution

GPS: GeolocationEvent.UPDATE does not fire

I have read this forum post:

 

http://bit.ly/kV0doB

 

I am finding my Playbook reporting lat/long intermittently. The Flex app I am building is a check in, so no map required.  I have wi-fi connectivity. The guts of the code is similar to what is here:

 

http://bit.ly/mFbxWl

 

What is the conclusiion here about the problem. Is it a software or hardware issue?

 

Cheers

 

-Matt

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: GPS: GeolocationEvent.UPDATE does not fire

You don't mention whether you properly specified the read_geolocation permission in your blackberry-tablet.xml file. Presumably that's done right, since you say this is working intermittently...

You also don't mention anything about whether your issue involves the tablet going into standby mode... it will mute the Geolocation stuff when it does that, by default.

Note, however, that even when you do everything correctly, right now, the thing is not reliable. You may get no initial update at all, you may get only the first update, and your updates may start reporting 0 for everything (at which point I've always had to reboot).

This is believed to be a software issue known to RIM and being worked on, but we have no more info than that.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 31
Registered: ‎01-20-2011
My Device: Torch 9800
My Carrier: Bell

Re: GPS: GeolocationEvent.UPDATE does not fire

One thing that may help is to be aware of some of the quirks with flash development.  There are some instances where garbage collection can interfere with your code.

 

For instance, you may want to make the variable for the geolocation. an instance variable of the class (available as long as the class is loaded) so that it does not get removed by GC.

 

Example:

 

import flash.sensors.Geolocation;

public class GeolocTest extends Sprite

{

  private var geo:Geolocation;

     public function MyMap()

   {

  this.geo = new Geolocation();

  this,geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);

  }

 

  private function geolocationUpdateHandler(event:GeolocationEvent):void

  {

  ...

  ...

  }

}

 

Regards,

Moses

New Contributor
Posts: 4
Registered: ‎05-14-2011
My Device: Blackberry Playbook
My Carrier: None

Re: GPS: GeolocationEvent.UPDATE does not fire

Thanks Peter. Yeah read_geolocation in place and no standby mode. Fire up app and sometimes geolocation works other times not. So software issue. I'll keep looking out for their fix.
--Matt
Contributor
Posts: 31
Registered: ‎01-20-2011
My Device: Torch 9800
My Carrier: Bell

Re: GPS: GeolocationEvent.UPDATE does not fire

I have noticed that the Geolocation can take a few minutes at times to properly detect your location (and of course this also depends if the device is blocked from the satelites).

Developer
Posts: 128
Registered: ‎03-18-2011
My Device: PlayBook
My Carrier: verizon

Re: GPS: GeolocationEvent.UPDATE does not fire

I think it's a hardware issue. GPS never works for me inside and only about half of the time outdoors. I also noticed that the wi-fi signal strength on my laptop is always excellent but in the same spot my PlayBook will sometime be at 3 or 2 bars. Their using a 4-in-1 chip for the GPS, wi-fi, bluetooth, and FM radio with 4 different antennas. I don't know if its because of the chip or because of the antenna design or maybe it is software but there is a problem.
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: GPS: GeolocationEvent.UPDATE does not fire

 


XoomMan wrote:
I think it's a hardware issue ...

 

Actually, an integrated hardware solution like the WiLink 7 chip is likely to work much better at all of these things than earlier approaches where each function is handled by separate components.  By integrating all these together, TI had better options to isolate the RF and analogue areas from the digital, test with multiple types of signal working simultaneously, reduce the footprint, complexity, and power consumption by sharing common resources, and so forth.  There's a nice video where TI demonstrates the part simultaneously handling GPS, WiFi, Bluetooth, and HDMI video (or whatever... I don't recall the details), all working quite nicely.  This approach probably makes it hard in some ways for RIM to even have certain types of hardware issue.

 

I expect most if not all of the issues we'll see with this stuff come down to software.

 

By the way, my GPS results are pretty close to excellent so far, other than the unreliability with the startup and the periodic "all zeros" issue.  It works perfectly well indoors in my house, at least on the upstairs floor where I've tried it, and quite well outdoors.  Takes anywhere between 10s and 2 minutes to give the first reading, except when it doesn't manage to do that at all before I give up (after 5-10 minutes).  Often the accuracy isn't great for the first 30-60s, but after that it's settled down and gives pretty consistent results, certainly no worse than I see with an Android phone.

 

The horizontal accuracy reading generally reads 2.0m or better when I'm getting stable readings (just an FYI... the absolute value there doesn't mean much...).  Vertical accuracy always reports as 0.  Heading and speed are fairly accurate on average based on only a bit of driving around in overcast conditions.

 

I let the thing run for about 14000 samples at 2Hz last night, with it heavily overcast and pouring rain all night.  After discarding some outliers, one standard deviation away from the average is a circle of about 5m radius.

 

Also, for what it's worth, running for almost 8 hours over night, with wifi/bluetooth off, the battery dropped from 52% to 41%. My test app appended the readings to a file each time one was received so I don't know how much of that drop can be attributed to the use of the GPS.

 

(Stray note: I actually asked for geo.setRequestedUpdateInterval(1000); but my readings were 2s apart... I guess the unit refuses to readings more frequently than that, at least when running on battery, or perhaps it's simply not possible to do more frequent readings.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 128
Registered: ‎03-18-2011
My Device: PlayBook
My Carrier: verizon

Re: GPS: GeolocationEvent.UPDATE does not fire


peter9477 wrote:

This approach probably makes it hard in some ways for RIM to even have certain types of hardware issue.


That chip still needs antennas to work. My tom tom will work in my house but I can't get GPS data with my PlayBook inside and the wi-fi signal strength on my PlayBook is sometime weaker then what I see on my laptop.

 

I don't know. I hope you're right and it's just a software issue.

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: GPS: GeolocationEvent.UPDATE does not fire

One thing nobody seems to have reported yet is where the GPS antenna is located. From the iFixit teardown, it appears there may be antennas in each of top left, top right, and bottom left corners. Depending on how we hold the thing, it could be that we can improve the GPS reception somewhat (or hinder it).

As for WiFi signal strength, I hope you aren't just watching how many little bars there are. Even if you're going by the numeric signal level (e.g. -67dBm) I'm not certain that can really be compared effectively between two different types of device. All I know is that, so far, my PlayBook has better WiFi communication in and around my house than either my Android phone or my laptops have ever had, and apparently fewer disconnects.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: GPS: GeolocationEvent.UPDATE does not fire

After some experimentation cupping my hands over the corners, I'm 90% sure the WiFi antenna is at upper left, and the GPS antenna at lower right.

If you're having trouble getting good readings or getting a lock, try leaving it sitting on a table (outside, preferably) or holding it without your right hand covering up that corner very much.

In fact, I just retested my app starting up with the bottom right corner tightly clutched by my hand to block the signals. For over two minutes it did not report any update, but within a few seconds of my switching to hold the unit by my left hand with the bottom right corner fully exposed, I got readings.

The readings stabilize with horizontal accuracy reported down around 2.0m or better. When I clutch the bottom right corner in the palm of my hand again, over a period of 10-15s the accuracy reading climbs to around 60m and updates slow then stop entirely. When I remove my hand again, within seconds I get fresh readings and accuracy back around 2.0m or better.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!