Demo MIDlet and Service

NNAClientExample MIDlet and example.com service demonstrates how to use the Nokia Notifications API.

  1. Run Nokia Asha SDK Emulator and then tap Environment Selector in Home.

    Note:

    The Environment Selector MIDlet is preinstalled on the SDK Emulator and has been made available (as a part of the NNAClientExample package) for installation on the device.

  2. Select Sandbox environment from the list. Tap Save and then tap Done.

    The Notification Enabler now points to the sandbox environment.

  3. Run Nokia IDE for Java ME (Eclipse) and then select Nokia Hub > Code Examples.

    The Code Examples window displays a list of code examples included with the SDK.

  4. Select NNAClientExample from the list and then click Load into workspace.

    NNAClientExample loads in the workspace.

  5. Under the Package tab, right-click NNAClientExample and then select Run As > Emulated Java ME MIDlet.

    NNAClientExample loads in the SDK Emulator.

  6. Tap Register.

    The MIDlet tries to connect to the Notification Enabler, registers it, changes its notification status to Online, and enables it to receive notification messages.

    Note:

    If the notification status does not change to Online, check and correct the network proxy server settings.

  7. Tap Get Notification ID.

    The MIDlet retrieves the Notification ID from the Notification Server and then displays it on the screen.

    Note:

    The generated Notification ID can be copied from the Diagnostics window of the SDK Emulator.

  8. Go to Nokia Developer Console and then sign in with your Nokia Developer Account credentials. Click My services tab and then click the example.com link from the List of your services pane.

    The Developer Console displays the Push Notification pane (Developer Console sending tool) on the right hand side of the List of your services pane.

  9. Enter the required information for push notification as follows and then click Push.

    Field

    Data/Option

    Id

    Notification ID (copied from the Diagnostics window of the SDK Emulator)

    payload

    “Hello”

    Alert

    Selected

    Title

    “Hello Title”

    The notification message is displayed on the screen.

    If the NNAClientExample MIDlet is not running then the notification banner is displayed on the screen.

    Tap notification banner to open the NNAClientExample MIDlet and then tap Register to display the notification message on the screen.