×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2009
    Location
    Delhi
    Posts
    223

    GPS problem..giving an error

    Hello
    i have made an app in which i used LocationProvider.
    it working fine on emulator .. but when i am trying it in nokia or any other cell phones ..it's giving following exception:
    "no class def found error javax/microedition/location/LocationException"
    this is because nokia 3110C doesnot have GPS support but i want such condition that if GPS is avaiable then it should work and if GPS is not avaiable then also it should work.
    so suggest me what condition do i apply there in the main function or in startApps().

    and what locationprovider returns if GPS not avalaible?
    Thanx
    Pooja

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: GPS problem..giving an error

    well the error is because you don't have the Location API's (JSR179) on your device..
    those are manufacturer-installe,d so you cannot add them later on, hence your device has them or it doesn't, if the latter is the case well there is no way to get those api's on your device...
    So that last part you were mentioning :
    "that if GPS is avaiable then it should work and if GPS is not avaiable then also it should work"
    won't be possible... If you are trying to retrieve the GPS coordinates through JSR179 on a device which doesn't have GPS it simply wont work...
    There are three kinds of devices actually :
    - device with no JSR179 and no gps
    - device with JSR179 and no gps
    - device with JSR179 and gps

    The first one can only connect to an external gps receiver, for example through bluetooth (for communication to bt device and interpretation of the gps data you will have to write your own code)
    The second one can use the JSR179 to communicate with an external gps device... So you wont have to write your own bt communication and gps interpretation code
    The third one is obviously the easiest ; you can use JSR179 to read out the internal GPS

    At the startup of your software you can check if the Location API's are availiable, then according to that result you can act as you like...

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: GPS problem..giving an error

    Hi Poojs
    You can try to put a try/catach while interacting with JSR 179, if it in not present on the device then you can capture "javax/microedition/location/LocationException" and switch to some other way of finding location info i.e. by Cell-id or CBS.

    Ref. FN wiki:
    http://wiki.forum.nokia.com/index.ph..._ID_in_Java_ME

    http://wiki.forum.nokia.com/index.ph...ture_Cell_Info

    thanks,
    ~Amitabh

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: GPS problem..giving an error

    Quote Originally Posted by im2amit View Post
    You can try to put a try/catach while interacting with JSR 179, if it in not present on the device then you can capture "javax/microedition/location/LocationException"
    You won't get a LocationException on this device, since (as Tiger points out) it has no Location API. The error being thrown is NoClassDefFoundError, because the code is referencing the LocationException class, and it doesn't exist.

    Check the device specs for the Nokia 3110 classic.

    You can use the technique described in How to Use an Optional API in Java ME to detect the presence of the Location API.

    Quote Originally Posted by im2amit View Post
    switch to some other way of finding location info i.e. by Cell-id or CBS.

    Ref. FN wiki:
    http://wiki.forum.nokia.com/index.ph..._ID_in_Java_ME

    http://wiki.forum.nokia.com/index.ph...ture_Cell_Info
    Sadly, the 3110 classic is a Series 40, and these techiques will not work.

    Location-based applications are really not possible on Series 40s, unless the network operator provides some HTTP-based location service. Such a service would be specific to a particular operator.

    Graham.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: GPS problem..giving an error

    Hi Poojs,

    Sorry I missed the device name in your post...
    the only solution left to get the GPS location on Nokia 3110c will be through a external Bluetooth based GPS module using JSR-82 and without JSR 179 or depend on the operator's HLR register to share your location info with you over HTTP connection.

    thanks,
    ~Amitabh

    thanks,
    ~Amitabh

Similar Threads

  1. to get ssid
    By d.devendran in forum Symbian
    Replies: 4
    Last Post: 2009-07-15, 09:42
  2. carbidec++ helloworld project problem
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2007-03-11, 12:40
  3. Parsing file content
    By hendrawan.ashari in forum Symbian
    Replies: 7
    Last Post: 2007-03-09, 10:41
  4. C-code..unable to make sis
    By Symbian_Neil in forum Symbian
    Replies: 9
    Last Post: 2006-12-02, 07:55
  5. code warrior problems
    By mayankkedia in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2004-10-25, 06:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •