You Are Here:

Community: Developer Discussion Boards

#1 Old Excluding specific API's during runtime ? - 2007-05-11, 11:14

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
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 11:27.
Reply With Quote

#2 Old Re: Excluding specific API's during runtime ? - 2007-05-11, 23:16

Join Date: Dec 2005
Posts: 1,886
Location: Brazil
Send a message via MSN to juarezjunior Send a message via Skype™ to juarezjunior
juarezjunior's Avatar
juarezjunior
Offline
Forum Nokia Champion
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
Reply With Quote

#3 Old Re: Excluding specific API's during runtime ? - 2007-05-15, 14:37

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
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...
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting C Open source. debasish1234 Open C/C++ 7 2008-01-28 12:06
Can I replace the System APIs with APIs in my .dll? steve.sun General Symbian C++ 1 2006-03-15 06:36
Java I-modeb APIs irfan.khan Mobile Java General 1 2006-03-10 14:51
Do we still have device specific APIs for MIDP2.0 phones? qmei Mobile Java General 1 2006-01-23 13:09
Audio Streaming APIs on 9210 Nokia_Archive General Symbian C++ 1 2002-05-30 13:45

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia