Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User fabio.ci's Avatar
    Join Date
    Jan 2010
    Posts
    1
    Hi guys, i have a problem...i write a j2me application with jsr179 library and all works fine. But i have a problem...i would this:

    my application start with ( for example ) this criteria: criteria.setHorizontalAccuracy(30);
    if after 5 minuts i don't get valid gps coordinates i want to try with criteria.setHorizontalAccuracy(500);

    how is possible to implement this?
    Code:
    Criteria cr = new Criteria();
    cr.setHorizontalAccuracy(30);
    cr.setCostAllowed(true);
    LocationProvider lp = LocationProvider.getInstance(cr);
    if(!lp.getLocation(480).isValid()){
       cr = new Criteria();
       cr.setHorizontalAccuracy(1500);
       cr.setCostAllowed(true);
       cr.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
       lp = LocationProvider.getInstance(cr);
    is this correct?

    thank you for help and sorry for my bad english.

    Fabio

  2. #2
    Registered User grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Tiger69 might be the better guy to answer this... but I suspect the phone largely ignores the criteria, other than to filter out values that don't match. You're probably just preventing your app from getting information. Leave the criteria as default, and filter them yourself if you really want to. The phone probably doesn't have different ways of getting location for different power requirements, or different accuracies. If it has GPS, it will use it.

    Otherwise, I guess what you're doing is right... create a new Criteria object, then a new LocationProvider.

    Popular wisdom from the location-gurus (like Tiger) seems to be that you should avoid getLocation(), and use the LocationListener mechanism instead.

    Graham.

Similar Threads

  1. Software Engineer - UK & Munich Opportunites
    By evoke in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2006-10-19, 09:17
  2. News:UCanCode Software Releases XD++ Professional Edition V8.60 (100% Source Code)!
    By jackonlyone in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2006-07-26, 03:49
  3. Software Engineer (C++/Symbian, London)
    By mobile2004 in forum Symbian C++
    Replies: 0
    Last Post: 2004-11-05, 09:41
  4. Change to English Version of Software
    By ckn_fsh in forum Symbian C++
    Replies: 1
    Last Post: 2004-09-02, 14:01
  5. Senior Software Engineer NEEDED !!!!!
    By searcheric in forum Symbian C++
    Replies: 4
    Last Post: 2004-01-28, 19:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved