How can I reduce the first time lock GPS?

I am building an app that takes your location and calculate the distance of a few specified benchmarks.

The problem I have is that it takes on average about 5 minutes to get what he first lock. Even when I change the settings to use explicitly aided in GPS is still takes a long time. I know that there must be a better approach is because Google Maps takes less than a minute to get his lock. Here's the code I used to build criteria:

Criteria criteria = new Criteria();
criteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT);
criteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);
criteria.setSpeedAndCourseRequired(false);
criteria.setAltitudeRequired(false);
criteria.setAddressInfoRequired(false);
criteria.setCostAllowed(true);
criteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_HIGH);

Here is how I load the location:

try {
            LocationProvider provider = LocationProvider.getInstance(criteria);
            Location location = provider.getLocation(-1);
            int method = location.getLocationMethod();
            if ((method & Location.MTA_ASSISTED) == Location.MTA_ASSISTED) {
                System.out.println(" Assisted GPS");
            }
            if ((method & Location.MTA_UNASSISTED) ==
            Location.MTA_UNASSISTED) {
                System.out.println(" Unassisted GPS");
            }
            if ((method & Location.MTE_CELLID) ==
            Location.MTE_CELLID) {
                System.out.println(" Cell Site");
            }
            locationUpdated(provider, location);

        } catch (Exception e) {
            String msg = e.getMessage()+" ("+e.getClass().getName()+")";
            _mainScreen.reportError(msg);
            System.out.println(msg);
        }

No idea where I am going wrong?

Are you sure that the fix for Google Maps that you speak is obtained by using the location API at all? Maybe you talk about fix Cellsite-style own from Google that does not use the localization API: simply, he questions a web server with the ID of the current cell and gets an immediate response with a correction. See this post: http://supportforums.blackberry.com/t5/Java-Development/Is-it-Possible/m-p/422751#M83923

Tags: BlackBerry Developers

Similar Questions

  • How can I reduce the size of a file of numbers?

    I have a file that is too big to 650 MB. It is mostly text. I found 1 sheet which is "inflated".  I tried to copy/paste the columns in a new file, but it ends with lines and additional columns that I copied! It seems to me that if I could have something in layers? How can I reduce the size of the file.

    If it's really just the text that seems really strange.  I repeat what you have already done, copy items to a tim in a new file, and then save after each copy and monitor the size of files.  When you see the file size jump exceptionally fast, do NOT save the new file, and focus on the issue.  What are the benefits?  You paste images into a table as a background fill?

    If you did and you want photos, try to reduce the size of the file by using the menu item "file > advanced > reduce file size...» » :

  • How can I display the first image of a built-in clip?

    I prepare a presentation for my 10.11.16 retina, with Keynote 6.6.1 MacPro OSX. I want that it contains clips integrated to my films. I chose the simplest theme - plain black.  I drag and drop these Quicktime movies or .mov of iTunes to a new black slide in Keynnote.

    When I'm in mode Navigator or Light Table etc, what I see is a series of black images - although if I click with the mouse the video will play. How can I see the first frame of the movie, and don't forget that it will start when I move to the slide, so that I can see the order of presentation, or know what's coming?

    You see black because it is what is contained in the poster frame, which is the first frame of the video by default.

    To change the original image: click the video on the slide to select it, then go to: Inspector > Format > film

    either drag the corrector, or enter a number in the box, here I'v entered 4 seconds for the poster so frame the frame of departure:

  • How can I reduce the amount stored?

    How can I reduce the amount stored?

    The amount is stored where? You must provide specific information about what it is you want to do.

    GB

  • A report that contains 3 photos.  How can I reduce the file to send

    Yosemite installed. You want to send photos by email. How can I reduce the size of the file?

    Try control - click on compress.

  • How can I reduce the size of the icons on my monitor

    How can I reduce the size of the icons on my monitor

    Even under Vista or Windows 7. Right-click on the DESKTOP, SELECT DISPLAY, and then select the size you want. If largest size, so inferior next select the size down.

  • How can I get the exact time and date on my FAX LOG

    I have a new HP Officejet 6500 has more on my Dell Inspiron Windows XP computer.  How can I get the exact time and date on my FAX log?

    Hi FrederickFrank7,

    Journal of faxes would just follow the time of your printer. Please set the time and date of your printer.

    I am an employee of HP.
    Please indicate the position that solved your problem as "acceptable Solution".

  • How can I reduce the size of one of 'My images' print to?

    How can I reduce the size of the 'My pictures' draws what size I want (so I can print six or eight copies of the same image on a single sheet of 8.5 "x 11")?

    You must right click on the image and then press on print and work your way through the wizard Methoeds, this should allow you to choose what size to make your prints.

  • How can I reduce the size of an e-mail signature because I am told that it is too large, truncated?

    How can I reduce the size of an e-mail signature because I am told that it is too large, truncated?

    original title: email signatures

    How did you compose the signature?  If you have used the word or some office products, its probably loaded with unnecessary code.  In Word save as html, but use the filtered HTML and which should reduce the size.

    All you really need is the basic HTML code such as:



    This is a signature.

    Here's a picture:


    You can copy and paste that into Notepad and add some text, formatting, and images you want.

    Steve

  • How can I disable the first elements adobe from my computer crashed

    How can I disable the first elements adobe from my computer crashed

    Hi Franks,

    This probably should have been posted in the Premiere Elements forum, as this forum is a place of social discussion.

    However, you can simply install Premiere Elements of the new computer and activate it. If not, then you will need to contact Adobe customer service and use the 'chat' option - they will help reset your activation:

    Contact the customer service

    I hope this helps!

    Mike

  • How can I reduce the size of a PSE11 catalog?

    How can I reduce the size and increase the efficiency of a PSE11 catalog by removing many of its elements?

    A catalogue with more than 10,000 photos works very slowly. But deleting the photos does not help. To take an extreme example, removing all but ten photos, remove all tags and identifications of persons and performs the repair and optimization changes size of the catalogue almost at all, from 516 MB to 493 MB. The properties of the two catalogs indicate the number of files to remain unchanged: 10 279 files. (It seems that each of these files is a photo in the original catalogue, great, all except that ten have allegedly been deleted).

    A whole new catalog created with these same ten pictures has less than 1 MB in size, with only 20 files. This tiny catalogue and the 493 MB each probably contain the same usable information.

    Starting with the large catalog with 10,000 photos, is it possible to delete all but ten of his photos, while reducing its size from 516 to 1 MB? (If so, I want to use the same method with a lot more pictures.)

    Thanks for the comments.

  • How can I reduce the size of the pdf file?

    Hello, can you pls tell me how can I reduce the size of the pdf file?

    @@

    Hello

    Open a PDF in Adobe Acrobat.

    Go to file > save as other > optimized PDF

    In the dialog box optimization PDF

    Under ' make it Compatible with: "drop down select Acrobat 9.0 or higher.

    You can also check the other about the downsampling images and fonts Unembedding.

    Click Ok and save the PDF file

    Thank you

    Abhishek

  • My form is 3.5 meg and 99.41% of it is related to fonts.  How can I reduce the size of the file?

    My form is 3.5 meg and 99.41% of it is related to fonts.  I used the optimizer to remove fonts, but the file size is still very large.  How can I reduce the size of the file?

    Hi erichsonw39146615,

    See this KB document for other methods to optimize the PDF Acrobat help. Optimization of PDF files.

    Kind regards
    Nicos

  • PDF file too large to email.  How can I reduce the size of the file once the PDF file is saved?

    My pdf file is too large to email.  How can I reduce the size of the file once the PDF file is saved?

    Emailing is not the best way to share PDF files, especially if they are large. Transfer to one of the free services such as Dropbox and send the URL of the file.

  • the just cost 29.99 make it difficult for a student to use this product... How can we reduce the cost?

    the just cost 29.99 make it difficult for a student to use this product... How can we reduce the cost?

    Hello

    Please contact customer support for problems with billing.

    ^ Ani

Maybe you are looking for