Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:01, 24 August 2007.

TSJ000516 - Restricting a Java application to Nokia devices only

From Forum Nokia Wiki


Subject:

Restricting a Java application to Nokia devices only TSJ000516

 

Platform(s):  Device(s), SW version(s):
All All

Category:

Java

Subcategory:

MIDP

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

Creation date:

December 19, 2006

Last modified:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
Using ringtones with Java Apps waperman Mobile Java General 1 2003-03-13 16:10
What can Remote Device Access service NOT do for you? tote_b5 Tools and SDK Feedback 4 2007-10-30 12:17
How to develop program in J2ME peaceworld Mobile Java Tools & SDKs 2 2007-09-01 16:47
Java Application Development mathulang General Symbian C++ 1 2003-04-04 12:43
upload image to web server nowanda Browsing and Mark-ups 6 2004-06-25 07:34
 
Powered by MediaWiki