Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2012

    Post ApplicationContext

    Application Context class is not importing for me .

  2. #2
    Regular Contributor
    Join Date
    Aug 2011

    Re: ApplicationContext

    Due to the lack of details, I can't tell from your posting what your problem is, so it would help if you could provide more information.

    If you are failing to find ApplicationContext on your classpath, the following should help.

    Nokia IDE for Java ME (Eclipse) Classpath Set-up

    Under the 'properties' of your project, the maps-core.jar needs to be added as an external JAR under 'Libraries', and the JAR needs to be selected as an exported entry under 'Order and Export'. The maps-api.jar can be found in the ./plugins/maps_api/lib directory of the installed version of the SDK. For example, if you have installed the Nokia SDK 2.0 for Java in C:/Nokia/Devices/Nokia_SDK_2_0_Java, the maps library JARs will be available in the C:/Nokia/Devices/Nokia_SDK_2_0_Java/plugins/maps_api/lib directory.

    NetBeans Classpath Set-up
    Under the 'properties' of your project, the maps_api.jar needs to be added as a JAR under 'Libraries & Resources', and the JAR needs to be selected as a package entry.

    The important bit here is the exported entry/package entry - failure to do this will compile, but cause a class not found exception when running on the emulator.

    In order to use the ApplicationContext you will need your own app_id and token.

    To obtain them:

    1. Register at Join Nokia Developer.
    2. Use your Nokia Developer user name and password to log in at http://api.developer.nokia.com to enter the "API Registration Home" page.
    3. Follow the on-screen instructions to complete the registration process.

    Setting API Credentials

    Having registered your application, set the credentials on the ApplicationContext class included the API. This is usually the first part of the actual implementation of a new application

    The generalized code example below shows how to do this:

        // Set up the credentials to use the API:
    Please note that the actual values of the strings "YOUR_APPID" and "YOUR_TOKEN" must be the app id and the token you obtain through the registration process. Note that the bundled examples will not work without the presence of the app_id and token.

    If it still isn't working, then you will probably get an "Unable to load copyrights" error - this means that the proxy of your emulator is incorrectly configured. The API will only display a map if it can successfully access the service online.

Posting Permissions

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