Get the GPS Position in a specific interval

Hi BB-Devs,

I m developing a BB10 application where I use the GPS location Services.

I need to update my current position in a specific interval.

First of all:

In the corrugation Simulator, everything works fine. My position will be refreshed every x seconds.

Yesterday, I deployed my application with debugging token to my Z10.

It seems the app works.     BUT:

When I change my position, the new position will not be updated as in the Simulator :-(

In my console log, I see that my function is called every x seconds.

Here is a code snippet of the function that is called in the intervall:

function setAktPosition() {
    //First test to see that the browser supports the Geolocation API
       if (navigator.geolocation !== null)
       {
          var options;
          navigator.geolocation.getCurrentPosition(setAktPositionSuccess, setAktPositionError, options);
       }
       else {
          alert("HTML5 geolocation is not supported.");
       }
}

function setAktPositionError(error)
{
   alert("An unexpected error occurred [" + error.code + "]: " + error.message);
}

function setAktPositionSuccess(position)
{
   //Extract information about the users current position:
   var time = position.timestamp;
   var coordinates = position.coords;

   //Retrieve geographic information about the GPS fix:
   ap.valueLat = coordinates.latitude;
   ap.valueLon = coordinates.longitude;
   ap.valueAlt = coordinates.altitude;
   ap.valueSpeed = coordinates.speed;
   //var acc = coordinates.accuracy;
   //var altAcc = coordinates.altitudeAccuracy;
   //var head = coordinates.heading;
   refreshMap();
}

That's how I got to call this function in a specific interval:

aktiv = window.setInterval("setAktPosition()", intervallInSec);

However - the works of the intervall-function-call - but my application still get the top position - no update of position when changing my situation :-(

Corsica, I did this in my config.xml file:


   access_location_services

My application has requested when starting fist approvals of the location. I also checked this in the settings of the device of my Z10.

Are there problems with the GPS location services in the webworks for BB10?

Or is it not possible to achieve?

I will be happy if anyone has any advice for me :-)

Thank you very much!

Lars.

Try changing the options to activate enableHighAccuracy

https://developer.BlackBerry.com/HTML5/APIs/positionoptions.html

Tags: BlackBerry Developers

Similar Questions

  • How to get the exact position of the text?

    Hi try the code below, I do not get the exact position of the text.

    TextModel InterfacePtr< ITextModel > (() Utils< IXMLUtils >->QueryTextModel(inXMLElement));

    FrameList InterfacePtr< IFrameList > (textModel->QueryFrameList());

    TextIndex start_pos, end_pos;

    Utils< IXMLUtils > ()->GetElementIndices(inXMLElement, & start_pos, & end_pos);

    Int32 fidx;

    TextFrameColumn InterfacePtr<ITextFrameColumn> (frameList->QueryFrameContaining(start_pos, & fidx));

    UIDRef = focusedText:GetUIDRef(textFrameColumn);

    not signed int current_page = GetPageNumberFromUIDRef(focusedText);

    UID pageUID;

    UIDRef spreadUIDRef = GetPageSpreadUIDRef(current_page, pageUID);

    PMRect PageCoords = GetPagePasteBoardPos(UIDRef(db, pageUID));

    InterfacePtr<IWaxStrand> (((IWaxStrand*) textModel-> waxStrandFrameQueryStrand() kFrameListBoss IID_IWAXSTRAND)));

    if (waxStrandFrame is nil) Break;

    K2: waxIteratorscoped_ptr<IWaxIterator> (waxStrandFrame->NewWaxIterator());

    PMReal PositionY = 0;

    if (waxIterator is nil) Break;

    IWaxLine* waxLine = waxIterator->GetFirstWaxLine(start_pos);

    PositionY = waxLine->GetYPosition();

    Can you suggest a solution for above problem.

    Instead of GetYPosition, try waxLine-> GetToPasteboardMatrix(). Transform(&positionPB); Then you can convert it into page coordinates

  • How can I get the stream position for a publication?

    I am writing a CEAP for AfterFx plugin and I need to get the stream position for a composition. I based my plugin on ProjDumper.

    Can anyone help?

    When you place the compA in compB you are supposed to receive an AEGP_LayerH, for this comparison of layer nesting.

    If not, you can use AEGP_GetCompLayerByIndex() on compB to obtain this handle layer, because you know its index. (you must know, you put here)

    If you try to find the layer in compB starting only with the AEGP_CompH of the company, so it's a bit problematic...

    You cannot just ask wherever model is nested, you must analyze each layer for this source control project... yuk.

  • How to get the current position from the point of view

    can I know how to get the current position of the view?

    Edited by: anIdiot July 27, 2011 22:01

    1 - get belvedere of the universe:

    u = new SimpleUniverse (canvas3D);
    ViewPlat = u.getViewingPlatform (); view of the universe

    definition viewplat: ViewingPlatform ViewPlat;

    2 - get look a transform of the platform in an existing Transform3D

    ViewPlat.getViewPlatformTransform () .getTransform (t3d).

    3 - Look at the trandform: t3d.get (Quater1, vector1); orientation object Get and coords

    Kind regards.
    JFP

  • Flex TextInput to get the current position of the cursor

    TextInput component in how to get the current position of the cursor? Because I want to record a loss of focus on the location of TextInput dynamically add text.

    Here:RichEditableText is a part of the skin of the class spark TextInput and is what is doing all the text in the editing/rendering of work. If you need to make all text advanced operations, they need to go through the property here. Because it is a part of the skin, you need to make sure that is not null before doing anything on this subject.

    Fixed typo: it is the property here is, not textInput

  • Get the GPS location API error - provider is not available

    Hello

    I am trying to access the information of location using Android location API (via LocationManager.GPS_PROVIDER), but without success. I get error "provider not available."

    AndroidManifest.xml has lines related to the relevant permissions:


    But I do not get prompt the same security to grant these permissions to my request.

    OS version 2.0.0.3894

    Build 73070

    Thank you.

    I solved this problem by restarting and place the device near a window.

    What I was wondering now is why Android player never asked security permission to access the location of the GPS. What is a function of development?

  • Get the current Position/location of the blackberry

    Hi all

    I am developing an app that tells you so to were you are in the world... the less minimalist. any ideas how to on this subject? I have searched for the API for useful method calls, have only seen class net.rim.blackberry.api.Maps.MapView. I don't think that's all that is needed.

    In particular, I want to at least get the latitude and longitude of the current position of the phone. This is the main task for now. What are my options and how can I do to solve this.

    Thanks in advance

    Dan

    http://www.BlackBerry.com/developers/docs/5.0.0api/javax/microedition/location/LocationProvider.html

    There is also a pdf developer for this topic, check

    http://docs.BlackBerry.com/en/developers/subcategories/?usertype=21&category=development+guides

    (maybe you should read them all!)

  • How can I get the new position before applying the rotation in javafx?

    I had this class but when I print the line.endXProperty () .get () when the low is to apply the property does not change the value

    Can how I get the updated value after processing?

       @Override public void start(Stage stage) throws Exception {

              root = new Group(); stage.setScene(new Scene(root)); 

              line = new Line(); line.setStrokeWidth(5.0);

              line.setStroke(Color.BLACK);

              line.setStartX(10.0f);

              line.setStartY(80.0f);

              line.setEndX(10.0f);

              line.setEndY(10.0f);

              System.out.println("line.getEndX()="+line.endXProperty().get());

              rotate = new Rotate(90, 10.0f, 80.0f);

              line.getTransforms().add(rotate); 

              System.out.println("line.getEndX()="+line.endXProperty().get()); 

              root.getChildren().add(line);  stage.show();

         }

    You can transform the coordinates by the transformations of the node in this way:

    Point2D transformedEnd = line.localToParent(line.getEndX(), line.getEndY());
    

    If you want to turn only by the rotation, you can do this way:

    Point2D transformedEnd = rotate.transform(line.getEndX(), line.getEndY());
    
  • How to get the relative position of the layer in the largest precomp.

    The installation program:

    COMP 1 is 2000 x 3000 pixels. COMP 1 contains X positioned layer in the 1750,1250. (or other)

    I shoot 1 Comp in Comp 2, which is 800 x 600. I have the scale and move Comp 1 inside 2 Comp by an arbitrary amount.

    How can I determine the x position of the layer using the coordinate space of Comp 2?

    Something like this:

    L1 is comp("Comp_1").layer ("layer X");.
    P1 = L1.toWorld (L1.anchorPoint);
    L2 = thisComp.layer ("Comp 1");
    L2.toWorld (P1)

    Dan

  • selection of the daq card to get the angular position of 6 motors with encoder

    can you suggest me best daq card to use 6 positions of engines as outputs using encoders attached to the engines. I'll use single window for each engine. Or what can I use a single window for all the coders of engines?

    Hello Prabhakar7117,

    You need a counter for each encoder. Because you are going to use 6 encoders, you should get a DAQ hardware with 6 or more counters. Take a look at the PCI-6624 or PCI-6602. Another option would be a CompactDAQ chassis with modules that are able to access counters. Take a look at them.

    PCI-6624

    PCI-6602

    KB which cDAQ Modules can be used to access the counters of the shipped?

    Best regards

    Alina M

  • Cannot get the attachments to email from specific sender

    Hello
    I have reception issues a daily attachment from a specific sender. I receive and are able to open all attachments. When this specific sender sends me an email with an attachment, I do not yet see the trombone. My computer is running Vista and MSN. I hope you can help me. Thank you. MCG555

    Hello
    I have reception issues a daily attachment from a specific sender. I receive and are able to open all attachments. When this specific sender sends me an email with an attachment, I do not yet see the trombone. My computer is running Vista and MSN. I hope you can help me. Thank you. MCG555

    It is not your problem. Problem is on the end of the SENDER.
    Say that you can not open attachments to this sender.
    This sender is probably using Outlook and sending attachments in winmail.dat format (just speculation on my part).

    t-4-2

  • How to get the Date format for a specific date?

    May be it is inept to ask, but I'm aware of the Date.
    which appear on client - it's just that the average customer treats the date.
    Right?
    So what happens if a need to check the format to set the server to date.
    Or need to write common code indicating the date format
    on the server, it is running.

    This requirement came into my mind while using the extract method.
    Actually, I wanted to date of manipulation of the side back end.
    Let's say the time is 04:12:2012 03:05:16.
    Now, if I add 100 minutes, the result will be.
    04:12:2012 04:45:16.

    It's the requirement. Maybe there may be best way to do
    but it's the way I think now.

    Thank you.

    It's something that you don't need to know:
    you have a string containing a date or timestamp, and then he must know the format of this string and not the fornat date used by the server.
    or you have a date or timestamp, and then you can add minutes to it without knowing the format as described before.

  • Get a current GPS position in Simulator

    Hi experts,

    I am quite new to Java of BB application development.

    The current application I have devlop requires to know the current GPS position. Normally, how developers could fix this situation? Are there classes/methods, directly available for it?

    Please help with solutions.

    Best regards,

    Year s

    Yes, you can get the current Position. Example: Latitude, Longitude, Altitude etc...

    Check this URL, it had Development Guide for GPS.

    http://NA.BlackBerry.com/eng/deliverables/1125/GPS%20and%20BlackBerry%20Maps%20Development%20Guide.p...

    You can use the Simulator to test the GPS.

    Use simulate-> GPS on Simualator.

  • How can I get the position of a field in a Manager?

    Hi all

    I just want to know that how I can the position of a field in a Manager (Vertical or flow)?

    If I get the x, position y, I can do a pop-up screen depends on this position...

    Can someone help me solve this problem?

    Thank you very much.

    Welcome to the forums.

    I use getFocusRect to fetch the XYRect of the target field. You can get the details from there.

  • Get the position of the upper left corner?

    Hey guys,.

    by geometricBounds [1] and geometricBounds [0], I can get the starting positions of my objects.

    In my case I need the position of the upper left corner. When you rotate an object, the geometricBounds always reflect a bounding box so that I can not get the desired coordinates.

    How can I get the properties of the "points of departure" (the upper left corner of my object)?

    Thank you very much!

    You have entered the field coordination complex spaces here.

    In short, you can use resolve() to find the anchor points on one

    object. But you have to decide in what coordinate space to get the

    results.

    Your best bet is probably to use spread coordinates. The point 0,0

    who is in the middle of spread.

    So, given a pageItem i, try:

    i.Resolve (AnchorPoint.TOP_LEFT_ANCHOR, CoordinateSpaces.SPREAD_COORDINATES);

    If you want to deepen this topic, Marc Autret has a good guide PDF

    on that.

    Ariel

Maybe you are looking for

  • I can shrink iMessage received images display?

    Can I reduce the size of the new photos of iMessage on my screen? I think they're called stickers. Their biggness and their lively movement that bothers me. I would like to block them entirely without blocking text even if it is possible. Animation o

  • Don't replace an iPhone battery warranty?

    Some of my cousins named David is 12 years younger than me, he's 21, but he has an iPhone 5 and I saw him today and he wanted to replace his battery with screws. I have replaced on some phones, but it void warranty? It uses iOS 8.1.2.

  • Downgrade to XP on Satellite A200-1VN

    Hi all.I have the following problem:I have a laptop A200-1VN Satellite with Vista and I want to Setup with XP.When I go to the screen "" I know that I have to press F6 for additional driver (otherwise can not detect HARD drive), but I do not know WHA

  • Shared variables problem

    Hello I'm using LabVIEW 8.5.I uses about 80 variables shared in my project using Datasocket also to write on the network wanted to know if I face any problem while doing the exe? What I have to follow a special procedure to generate exe? Help, please

  • Why my pc always says update of the vista sp1 when it has already downloaded?

    When I go to Windows update it always rises "12 important update 1.9 MB' which is Vista SP! who has already downloaded 4 times?