2011-07-22 89 views

回答

2

您還可以編程方式檢測功能。查詢microedition.platform以查看它是否是諾基亞。然後,檢查是否存在區分您感興趣的版本的API。例如,檢查Location API JSR179是否存在:

boolean hasJSR179 = false; 
try { 
    Class.forName("javax.microedition.location.LocationException"); 
    hasJSR179 = true; 
} catch (ClassNotFoundException e) { /* no JSR 179 */ }