LocationListener does not receive updates when BrowserField 2 renders in 6.0
I have an application that calls a mobile web site using BrowserField 2. The application needs make the current GPS position to the mobile website with each request to the site.
I used code MultipleFixDemo to get a LocationListener job. Everything worked very well in the Simulator and all manual updates of location were received by the LocationListener in the application.
I changed the display to include a component BrowserField 2 and the LocationListener does not update the location of the Simulator.
Y at - it something I need to do something different when the user interface includes the BrowserField. Can I have some kind of thread problem? I only tested on OS 6.0 in the Simulator. I don't have access to a real device.
In the code below, I have two defined screens.
If the pushScreen (new MultipleFixScreen() is uncommented and the pushScreen (new BrowserFieldScreen() is commented out, the LocationListener receives updates.)
If the pushScreen (newMultpleFixScreen () is commented out and the pushScreen (new BrowserFieldScreen() is uncommented, the LocationListener gets no updates.)
Here is my code:
public class MultipleFixDemo extends UiApplication { private double longitude; private double latitude; BlackBerryLocationProvider myProvider; public static void main(String[] args) { new MultipleFixDemo().enterEventDispatcher(); } public MultipleFixDemo() { startLocationUpdate(); pushScreen(new BrowserFieldScreen()); //pushScreen(new MultipleFixScreen()); } private void startLocationUpdate() { try { BlackBerryCriteria myCriteria = new BlackBerryCriteria(); myCriteria.enableGeolocationWithGPS(BlackBerryCriteria.FASTEST_FIX_PREFERRED); try { myProvider = (BlackBerryLocationProvider)LocationProvider.getInstance(myCriteria); if ( myProvider == null ) { Runnable showUnsupportedDialog = new Runnable() { public void run() { Dialog.alert("Location service unsupported, exiting..."); System.exit( 1 ); } }; invokeLater( showUnsupportedDialog ); } else { myProvider.setLocationListener(new LocationListenerImpl(), 2, -1, -1); } } catch (LocationException le) { System.err.println("Failed to retrieve a location provider"); System.err.println(le); System.exit(0); } } catch (UnsupportedOperationException ue) { System.err.println("Require mode is unavailable"); System.err.println(ue); System.exit(0); } return; } private class LocationListenerImpl implements LocationListener { public void locationUpdated(LocationProvider provider, Location location) { System.out.println("update location called"); if(location.isValid()) { longitude = location.getQualifiedCoordinates().getLongitude(); latitude = location.getQualifiedCoordinates().getLatitude(); float altitude = location.getQualifiedCoordinates().getAltitude(); StringBuffer sb = new StringBuffer(); sb.append("Longitude: "); sb.append(longitude); sb.append("\n"); sb.append("Latitude: "); sb.append(latitude); sb.append("\n"); sb.append("Altitude: "); sb.append(altitude); sb.append(" m"); System.out.println("!!!!!!!Location update: " + sb.toString()); //MultipleFixDemo.this.updateLocationScreen(sb.toString()); } } public void providerStateChanged(LocationProvider provider, int newState) { System.out.println("providerStateChanged called"); // Not implemented } } class BrowserFieldScreen extends MainScreen { private BrowserField _browserField; private boolean _documentLoaded = false; private BrowserFieldRequest _request; /** * Creates a new BrowserFieldScreen object * @param request The URI of the content to display in this BrowserFieldScreen * @param enableScriptMenu True if a context menu is to be created for this BrowserFieldScreen instance, false otherwise */ public BrowserFieldScreen() { super(Screen.HORIZONTAL_SCROLL | DEFAULT_CLOSE | DEFAULT_MENU); BrowserFieldRequest request = new BrowserFieldRequest("http://www.google.com"); BrowserFieldConfig config = new BrowserFieldConfig(); _browserField = new BrowserField(config); _browserField.addListener(new DemoBrowserListener()); add(_browserField); _request = request; } /** * @see Screen#onUiEngineAttached(boolean) */ protected void onUiEngineAttached(boolean attached) { if(attached) { try { _browserField.requestContent(_request); } catch(Exception e) { deleteAll(); add(new LabelField("ERROR:\n\n")); add(new LabelField(e.getMessage())); } } } /** * Returns this screen's BrowserField object * @return This screen's BrowserField object */ public BrowserField getBrowserField() { return _browserField; } /** * A class to listen for BrowserField events */ private class DemoBrowserListener extends BrowserFieldListener { /** * @see BrowserFieldListener#documentCreated(BrowserField, ScriptEngine, Document) */ public void documentLoaded(BrowserField browserField, Document document) { _documentLoaded = true; } } } private final static class MultipleFixScreen extends MainScreen { MultipleFixScreen() { super(DEFAULT_CLOSE | DEFAULT_MENU); RichTextField instructions = new RichTextField("Waiting for location update...",Field.NON_FOCUSABLE); this.add(instructions); } } }
Any suggestions would be greatly appreciated.
Thank you
Jackie
This is a limitation of the BrowserField. The BrowserField also recorded a LocationListener that is use to power the GPS updates via JavaScript to pages it restores. This LocationListener / that your application has already registered (given that the application can only record 1).
There are two ways you can work around this problem. You can save your LocationListener again after posting the BrowserField. Note that if you take this approach methods JavaScript GPS won't within your BrowserField.
The second approach is to poll for updates location, instead of using a LocationListener. It should continue to work after posting a BrowserField.
Tags: BlackBerry Developers
Similar Questions
-
I'm developing an application of crossed with phonegap and Jquery mobile platform. I'm trying to implement push notifications for the blackberry application using PushWoosh.
I noticed that I'm not able to receive notifications when the application is in the background, or when it is closed. I get notifications only when the application is in the foreground.
Any suggestions on this problem?
I can use all the help.
The app is a phonegap application Webworks.
Thank you.
Info:
PhoneGap 2.8.0
jQuery 1.9.1
jQuery 1.3.1 Mobile
SDK WebWorks
PushWoosh
Hello
We just push our BB HTML5 / Webworks sample to our github repo:
Team Pushwoosh
-
Original title: updates
Why my PC does not install updates? Although located to automatically receive my last update was February 2015 and all others have failed. Although I tried to reset nothing help.
Have also tried to download Windows 10 but computer spends all day looking for updates, but nothing happens.
As its been almost a year that it is updated, you may be better off to backup your data and backup of your entire system, so you can get back to this point at least if something goes wrong. Then:
Update your anti-virus software and run a full scan. Then download, install, update and run a full scan with Malwarebytesfree. Keep it free, no need to start a trial etc. Malware can be a cause of failure of the updates, the scan won't take long to run and should report something nasty, if its there.
Then you can try the following:
1 convenience store update Windows - http://windows.microsoft.com/en-US/windows7/Open-the-Windows-Update-troubleshooter
2 system update readiness tool - http://windows.microsoft.com/en-us/windows7/what-is-the-system-update-readiness-tool
3 components of reset update - https://support.microsoft.com/en-us/kb/971058
4. check that "Windows update service" and "Background Intelligent Transfer Service" are listed and running according to the details in this article - https://support.microsoft.com/en-us/kb/2730071 "
If the above does not help, consider trying a 'repair installation system' - http://www.sevenforums.com/tutorials/3413-repair-install.html if you have windows installation discs, or a 'factory reset' (updated) If your PC came with no windows disk and was preinstalled. NOTE - in case backup your data and your system first in the form of data may be lost if something goes wrong, and data will be lost in the case of a factory reset.
If you do not want to reinstall again, post back with more details, that is at least what is the error code when the updates fail? (find an update failed in "view history update", right click and click details.) Check a bit to see if the same error code. ). Then someone else can we hope to help more.
-
My creative cloud does not open. When I open it, he continues to say "installing update".
Please see:
Creative cloud is "Installing Update". No percentage or error code.
Connect to CC - stuck on "Installing update..."
I hope this helps.
Concerning
Megha Rawat
-
I downloaded version 5.7 of Lightroom in order to support the captive capture on my Nikon D750 and its still does not. More when I was not invited to give my serial number for update is no where on my Adobe profile, although I bought and pays every month for my creative cloud for photography. Help, please
Your subscription to cloud shows correctly on your account page?
If you have more than one email, you will be sure that you use the right Adobe ID?
https://www.adobe.com/account.html for subscriptions on your page from Adobe
If Yes
Some general information for a subscription of cloud
Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work
Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud
-Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
-http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
-http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
-http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
-ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
-http://helpx.adobe.com/creative-cloud/kb/license-this-software.html
If no
This is an open forum, Adobe support... you need Adobe personnel to help
Adobe contact information - http://helpx.adobe.com/contact.html
-Select your product and what you need help with
-Click on the blue box "still need help? Contact us. "
-
OME does not receive details of the inventory and the State for some devices
OME does not receive the details of the inventory and the State for some servers.
For example when looking at one of our PowerEdge R620s is all that presents itself:
iDRAC firmware and LCC is updated (version 2.21.21.21 is installed.)
I reset the iDRAC, and that did not help. I have no problem with most of the other R620s in the same range of discovery.
I deleted the object to OME and re-discovered twice over the past week it but did not help.
Things seem ok when I use the troubleshooting tool:
Anyone has any info on what may be going on here or how to fix this?
Thank you
Hello
Thanks for the details in the post.
Wanted to check what version of OME use you - OME 2.1?
If so, this behavior with ws - man discovery could potentially due to expiry of certificate on this device. You can launch the iDRAC user interface and confirm the certificate information.
2.1 the OME, the WS - Man communication component is updated. The most recent component does not communicate with the device if that device has been exceeded in the certificate.
Sslresetcfg running via racadm will reset the certificate. For details and solution, see same threadhttp://en.community.dell.com/techcenter/systems-management/f/4494/t/19653767 .
Let us know if that helps.
Thank you
Vijay -
My iphoto does not open. When I click on the circle still turns but nothing happens. I tried to open it with command + option and reconstruction and nothing happened. I have version 9.2.3. Any advice will be greatly appreciated.
If you recently updated to El Capitan, your version of iPhoto is not compatible with this OS.
What version of Mac OS X are you running?
-
Satellite M30-113 does not work well when I use FreeBSD 6.2
Hello
My M30-113 does not work well when I use FreeBSD 6, 2-RELEASE http://www.FreeBSD.Org/
I was told that Toshiba has release a new bios to correct the problem of cooling, because it does not allow me to fan passive cooling in FreeBSD.
So could we have a new bios to solve this issue?
Arabian salvation
I am sure that mobile industry is focused on Windows operating system and hardware architecture together and preinstalled software are adapted and also configured to run well and stable.
This operating system is supported and if something should be better portable manufacturers offer different updates to the BIOS. Of course, you can preinstall what you want but you can not expect support for everything you can find on the market and because of this I n t believe that you won't find any update especially for FreeBSD 6.2 - RELEASE BIOS.
-
Contact does not receive messages
Hello, I need emergency aid, like one of my Skype contacts does not receive any of my messages, but I can receive all their I tried to register another account, but it still does not work, I have no idea why
Update: managed to fix Skype messages obtained through after about 500 of them sent
-
My 5s, IMessage iPhone does not work and when I try to activate it by electronic mail, the box opens, but I hit the sign in button and his stays there as it's frozen! Help
A deal with this * day. Only thing that worked was plugging it into the computer, it supported up to the computer. Do you have a reset, and when that went to spend he asked me to do an update "carrier". If you're on verizon? My co worker and I have the two are facing it today
-
Receiving UDP does not receive messages
Hello. I have problem with UDP receiver.
I can receive messages from the same port you write.
Stream: open vi--> vi--> read vi UDP UDP writing. Transmitter and receiver usinf th test port.
When I try to use vi UDP listen port to just read, I get all the data.
Program flow. I use vi to send the command on the serial port to MCU. Answer MCU return by sending data to the network port using UDP.
I start vi to listen to a port UDP (see attached), then I sent the order to MCU. I can see the response on Wireshark, but UDP vi does not receive anything.
I checked the IP address. Lokks all the same. IP address of the PC and decice is the same as when I write and read at the same time. Any other port.
Any help please.
Is the port that you want to use to open? For safety that many IT services will be blocked in ports that don't think they are necessary, or don't want to use.
-
My ipod does not correctly install when I plugged in now mobile USB keeps freezing
My ipod does not correctly install when I plugged it into USB. Since then, my laptop keeps freezing / crashing. Start repair found the problem mentioned but could not fix it and just send an error report.
I tried restoring the system and installed the updates of windows, but I still have the problem. I reinstalled itunes and my AV is up to date, I can't find a solution.
Hello1. are you confronted this question all the time or only when using the IPOD?2. What is the brand and model of the computer?
3 Please, try to connect the Ipod to different USB ports in the back and the front of the tower and check if you face the same problem.
Please follow the links below to solve the problem.
Method 1
Start your computer in a clean boot and check for conflicts with third-party software.
Start your computer in a clean boot.Note: Please follow step 7 of the article mentioned below to start the computer normally, after completing the necessary troubleshooting.
Method 2Step 1
What is safe mode?
http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-safe-mode
Step 2
Install this update and check if the problem is resolved.
Update for Windows Vista (KB925528)
http://www.Microsoft.com/en-US/Download/details.aspx?ID=620Also try to update the latest version of the drivers your controllers USB host, on the manufacturers site.
I hope this helps.
-
Windows 7 update does not find updates
Whenever I try to update my computer manually, Windows 7 does not detect updates and will sit with the green bar goes all day. He began to do this maybe 3 months ago and I don't have time to focus on the issue so far. I am interested to get SP1, but I can't because the computer will not be updated. Thank you.
"Windows resource protection could not start the repair service."
Follow these steps to reset the startup type of the service.
1. Click Start, type Services.msc
2. double-click on the Installer of Modules of Windows
3. set its startup type to Manual
4. click on OK.
Try the System File Checker
`~`
The TrustedInstaller service has full access to the files of the Protection of the resource Windows (WRP) and registry keys, and these services must be running in order to restore missing or corrupted WRP resources. The TrustedInstaller service starts on request when you run the System File Checker.
`~`
03/13 / 1108:23: 48 pm
-
BlackBerry 10 Z10 STL003 have not received updates to 10.3
I have a STL003 Z10, my position is that the India. And I have not received updates for 10.3. Done what does not
We always expect that your operator to release. If Att release him, you'll probably need to remove the sim card to get the update. ATT has not released the update either.
-
My 'contact' form does not work. When I send a contact test he returned this to my adobe email account:
'Contact form' has a new form submission.
What does not work exactly? As you said form submission notification is received in your e-mail account, so process form working I think but you want the notifications to go to another e-mail account, I think.
Have you added the email address in the field "Email to" in shape options? If Yes and then also you do not receive the form, then please give me the url of the site and post a screenshot or a form with the open option box.
Thank you
Sanjit
Maybe you are looking for
-
Anker TC930 keyboard has worked with 9.3.5, will pair with any iOS10
My keyboard Bluetooth TC930 Anker worked flawlessly with iOS 9.3.5. Of course, once I have upgraded to iOS 10, the keyboard will pair is no longer. Just keep the wheel turn and finally, I get the message "unable to connect". I tried the step to reset
-
Satellite A-L50-1CU - no separate for the headset and speaker volume sliders
Why there is no possibility to control the volume of the headphones separately? I risk my ears (seriously) every time I use headphones, due to the low efficiency of the speakers... Any suggestion?
-
Hp23-r110 all-in-one: the Windows product key
I have restored and installed win 10 once again. But the PC need product key Windows (25 characters). I can't find it on the pc. Where is the key?
-
Update of security for Microsoft Office PowerPoint 2007 (KB2596764)
I attempt in install the following update: Security for Microsoft Office PowerPoint 2007 (KB2596764) and even installed Microsoft Fix it and I keep getting an error message that the update was not installed. Currently, I use Kaspersky Internet securi
-
Windows mail with vista__
Some of my personal documents that I sent to a partner e-mail windows, are presented on a page of google by searching for a certain keyword contained in these files. This only happens on my personal computer, not on others.