You Are Here:

Community: Wiki

This page was last modified on 23 October 2008, at 10:29.

TSJ000516 - Restricting a Java application to Nokia devices only

From Forum Nokia Wiki


ID TSJ000516 Creation date December 19, 2006
Platform All Devices All
Category Java Subcategory MIDP


Keywords (APIs, classes, methods, functions):

Overview

Restricting a Java application to Nokia devices only

Description

If you want to create an application that works only on Nokia devices and cannot be used on other manufacturer’s devices, use the standard system property: "microedition.platform". Nokia devices always use the same format for the return value containing the device model and the software version, for example "NokiaN93-1/10.0.012". It is possible to look for the string "Nokia" in the property and close the MIDlet with or without notifying the user.
Code example:
//Begin
// Check that the platform is there
    String platform = System.getProperty("microedition.platform");
    if (  platform != null )
    {
           if(platform.toLowerCase().indexOf("nokia")== -1) {
               // Not running on a Nokia device.
             // Remove Start possibility.
               log("Closing application");
               //Close MIDlet
           }else{
             log( "Nokia device: " + platform + " found.");
             //Initialize MIDlet
           }
        
    }else
       {
           //Close MIDlet
       }
//End

Related Wiki Articles

No related wiki articles found

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