×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Excluding specific API's during runtime ?

    Howdy,
    I have a MIDlet which uses the Location API's...
    Inside the created Location class I implemented a checkApiExistence() method that checks for the existence of the api on the device :

    public static boolean checkApiExistence()
    {
    String version = System.getProperty("microedition.location.version");
    return (version != null && !version.equals("")) ? true : false;
    }

    just like in the Location API's example of Nokia... Tried that one on a non-jsr179 device and im getting same error...

    only problem is that in that same class I have a import javax.microedition.location.*; statement...

    so when I try to run the MIDlet i get a No Class Def Found Error... obviously because of the fact that the api's are not supported, and I try to import them right away...
    so... Is there some way to get rid of this porblem ? Maybe to decide runtime not to import those api's ? any other tip is welcome !
    thanks in advance
    Last edited by Tiger79; 2007-05-11 at 10:27.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Excluding specific API's during runtime ?

    Hi Tiger79,

    "so when I try to run the MIDlet i get a No Class Def Found Error... obviously because of the fact that the api's are not supported, and I try to import them right away..."
    Which device are you trying to run your application? Or is it on the emulator? Which SDK?

    Kind regards,
    Juarez Alvares Barbosa Junior - Brazil

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Excluding specific API's during runtime ?

    Found the error

    I had a static class (for singletons) in my project which imported the location api's... so these would be imported regardless if the device included those... So I had to undo the static thingie for that class...

Similar Threads

  1. Porting C Open source.
    By debasish1234 in forum Open C/C++
    Replies: 7
    Last Post: 2008-01-28, 11:06
  2. Replies: 1
    Last Post: 2006-03-15, 05:36
  3. Java I-modeb APIs
    By irfan.khan in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-10, 13:51
  4. Do we still have device specific APIs for MIDP2.0 phones?
    By qmei in forum Mobile Java General
    Replies: 1
    Last Post: 2006-01-23, 12:09
  5. Audio Streaming APIs on 9210
    By Nokia_Archive in forum Symbian
    Replies: 1
    Last Post: 2002-05-30, 12:45

Posting Permissions

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