您的位置:首页 > 其它

J2ME参数配置

2010-11-24 17:19 260 查看
部分参数适用于特定平台,供参考。
Basic values:
microedition.platform = Nokia7650
microedition.encoding = ISO8859_1
microedition.configuration = CLDC-1.0
microedition.profiles = MIDP-1.0
microedition.locale=en-US
microedition.timezone=GMT
 
JSR-135 MMAPI values:

microedition.media.version: 1.1
supports.mixing: false
supports.audio.capture: true
supports.video.capture: false
supports.recording: true
audio.encodings: encoding=audio/AMR
video.encodings: encoding=video/3gpp
video.snapshot.encodings: encoding=image/JPEG
streamable.contents: audio/mp4a-latm video/mp4v-es
 
JSR-75 File Connection API:

microedition.io.file.FileConnection.version: 1.0
using System.getProperty("..."):
file.separator: /
fileconn.dir.photos=file:///c:/pictures/camera_semc/
fileconn.dir.videos=file:///c:/videos/
fileconn.dir.tones=file:///c:/sounds/
fileconn.dir.music=
fileconn.dir.recordings=
fileconn.dir.private=
fileconn.dir.memorycard=file:///e:/
fileconn.dir.photos.name=camera_semc/
fileconn.dir.videos.name=videos/
fileconn.dir.tones.name=sounds/
fileconn.dir.music.name: null
fileconn.dir.recordings.name: null
fileconn.dir.memorycard.name: null

fileconn.dir.roots.names: returns localized names to the roots
 
JSR 120 - JSR 205 WMA

wireless.messaging.sms.smsc=+18768141109
wireless.messaging.mms.mmsc=www.airtelfun.com
 
JSR-82 Bluetooth

using System.getProperty("..."):

bluetooth.api.version: ??
obex.api.version: ??

Call LocalDevice.getProperty("...") with the following parameters:

bluetooth.api.version
bluetooth.master.switch
bluetooth.sd.attr.retrievable.max
bluetooth.sd.trans.max
bluetooth.connected.devices.max
bluetooth.l2cap.receiveMTU.max
bluetooth.connected.inquiry.scan
bluetooth.connected.page.scan
bluetooth.connected.inquiry
bluetooth.connected.page
bluetooth.system.state
 
Others asorted:

microedition.pim.version=1.0
microedition.commports=COM0
microedition.location.version=1.0
microedition.m3g.version=1.0
microedition.jtwi.version=1.0

     在J2ME开发中,我们经常需要和手机系统进行交互,获得一些和系统相关的信息,在J2ME API设计中,提供了一系列的系统属性,可以让我们来进行获得,下面就一一进行介绍 表1   CLDC、MIDP和JTWI属性
属性名称属性作用
microedition.profiles代表手机支持的MIDP版本,返回格式值为“MIDP-1.0”或“MIDP-2.0”
microedition.configuration代表手机支持的CLDC版本,返回格式值为“CLDC-1.0”或“CLDC-2.0”
microedition.locale代表手机所在的国家或地区,返回值格式为“en-US”
microedition.platform代表手机的品牌和型号,Nokia手机的返回值格式为“Nokia6310i/4.42”
microedition.encoding代表手机默认的字符集名称,返回值格式为“ISO-8859-1”
microedition.commports代表手机可以使用的串口列表,返回值中各个串口之间使用逗号分隔
microedition.hostnameMIDP2.0定义,代表本地主机名称,需要手机支持
microedition.jtwi.version代表手机支持的JTWI版本,值必须是“1.0”
表2 可选包属性
属性名称属性作用
microedition.media.version代表手机支持的MMAPI版本,如果不支持则返回null
microedition.pim.version代表手机支持的PIM API版本,如果不支持则返回null
microedition.m3g.version代表手机支持的M3G API版本,如果不支持则返回null
microedition.location.version代表手机支持的Location API版本,如果不支持则返回null
Bluetooth.api.version代表手机支持的BT API版本,如果不支持则返回null
microedition.io.file. FileConnection.version代表手机支持的FC API版本,如果不支持则返回null
microedition.global.version代表手机支持的Mobile Internationalization API(JSR-238)版本,如果不支持则返回null
microedition.chapi.version代表手机支持的CH(Content Handler) API(JSR211)版本,如果不支持则返回null
microedition.sip.version代表手机支持的SIP API版本,如果不支持则返回null
表3 MMAPI属性
属性名称属性作用
supports.mixing代表手机是否支持混音(同时播放多个Player),返回值为“true”或“false”
supports.audio.capture代表手机是否支持声音捕获(录音),返回值为“true”或“false”
supports.video.capture代表手机是否支持视频捕获(录像),返回值为“true”或“false”
supports.recording代表手机是否支持记录(record),返回值为“true”或“false”
audio.encodings代表手机支持的声音格式,返回值格式为“encoding=audio/wav”,多个格式之间使用至少一个空格进行间隔
video.encodings代表手机支持的视频格式,返回值格式为“encoding=video/3gpp”,多个格式之间使用至少一个空格进行间隔
video.snapshot.encodings代表手机使用getSnapshot方法获得的视频快照格式,返回值格式为“encoding=png”,多个格式之间使用至少一个空格进行间隔
streamable.contents代表手机支持的流媒体格式,返回null代表不支持
表4 Wireless Messaging API属性
属性名称属性作用
wireless.messaging.sms.smsc代表手机发送短信时的短信服务中心号码
表5 FileConnection API
属性名称属性作用
fileconn.dir.photos代表手机中存储照片和其它图片的目录,例如“file:///c:/My files/ Images /”
fileconn.dir.videos代表手机中存储视频的目录,例如“file:///c:/My files/Video clips/”
fileconn.dir.tones代表手机中存储声音的目录,例如“file:///c:/My files/Tones/”
fileconn.dir.memorycard代表手机中存储卡的根目录例如“file:///d:/”
fileconn.dir.private
(Nokia S40不支持) 
代表手机中MIDlet的私有工作目录,例如“file:///c:/System/MIDlets/[1015f294]/scratch”
fileconn.dir.photos.name代表手机中图片目录的名称,例如“Images”
fileconn.dir.videos.name代表手机中视频目录的名称,例如“Video clips”
fileconn.dir.tones.name代表手机中声音目录的名称,例如“Sound clips”
file.separator代表手机中的文件分隔符,例如“/”
fileconn.dir.memorycard.name代表手机中存储卡的名称,例如“Memory card”
使用这些属性,可以获得在程序运行过程中需要的很多和系统相关的信息,也可以使用表2中的属性来获得手机是否支持对应的可选包等信息        
实际使用示例:          String name = System.getProperty(“microedition.platform”);           
注意:如果需要获得JVM或jad文件中的信息,需要使用MIDlet类中的getAppProperty方法,其属性名则需要查阅jad文件的设定,和本文所述的属性名无关

nokia论坛里的手机规范,这个是权威。不过一次只能查看一个机型。
http://www.forum.nokia.com/devices/matrix_all_1.html

motorola的
http://developer.motorola.com/technologies/java/

Sony Ericsson
http://developer.sonyericsson.com/site/zhcn/home/p_home.jsp

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息