网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > J2EE/J2ME
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.Servlet容器工作原理(一).
.Java数据对象(JDO)介绍(四).
.J2EE应用服务器Jboss + Tomcat安.
.实例说明锚点位置的定义.
.使用SPRING AOP框架和EJB组件.
.Log4j深入浅出.
.漫谈EJB (1).
.MVC构架学习之渐行渐进(一).
.在Spring中使用JDBC.
.使用FileUpload组件实现文件上传.
.在resin-ee-2.1.5上构建j2ee应用.
.经典飞机游戏代码S60.
.J2EE Web开发技术期待一次新的技.
.漫谈EJB (3).
.Petstore源码追踪记.
.J2EEclusteringpart1.
.Servlet中jdbc应用高级篇之二.
.宠物店大战 (J2EE 与 .NET).
.使用j2meunit进行游戏测试.
.J2ME是什么含义?.
30 microedition.platform null   microedition.encoding ISO8859_1   microedition.configuration CLDC-1.0   microedition.profiles null 37 microedition.locale null   microedition.profiles MIDP-1.0 75 microedition.io.file.FileConnection.version 1.0   file.separator (impl-dep)   microedition.pim.version 1.0 118 microedition.locale null   microedition.profiles MIDP-2.0   microedition.commports (impl-dep)   microedition.hostname (impl-dep) 120 wireless.messaging.sms.smsc (impl-dep) 139 microedition.platform (impl-dep)   microedition.encoding ISO8859-1   microedition.configuration CLDC-1.1   microedition.profiles (impl-dep) 177 microedition.smartcardslots (impl-dep) 179 microedition.location.version 1.0 180 microedition.sip.version 1.0 184 microedition.m3g.version 1.0 185 microedition.jtwi.version 1.0 195 microedition.locale (impl-dep)   microedition.profiles IMP-1.0 205 wireless.messaging.sms.smsc (impl-dep) 205 wireless.messaging.mms.mmsc (impl-dep)

      应用程序属性值是在应用程序描述符文件或者MANIFEST文件中定义的(其中MANIFEST文件是打包在jar文件中的),当我们部署应用程序的时候会定义应用程序属性。比如下面是一个典型的jad文件内容:
 MIDlet-1: HttpWrapperMidlet,,httpwrapper.HttpWrapperMIDlet
 MIDlet-Jar-Size: 16315
 MIDlet-Jar-URL: HttpWrapper.jar
 MIDlet-Name: HttpWrapper
 MIDlet-Vendor: Vendor
 MIDlet-Version: 1.0
 MicroEdition-Configuration: CLDC-1.0
 MicroEdition-Profile: MIDP-1.0
 Which-Locale: en

其中Which-Locale就是应用程序属性值,我们可以通过MIDlet的成员方法getAppProperty()来得到它,代码片断如下:

	import Javax.microedition.midlet.*;

	public class MyMIDlet extends MIDlet {
		private String suiteName;

		public MyMIDlet(){
			suiteName = getAppProperty( "MIDlet-Name" );
			... // more stuff
		}

		... // etc.
	}


     属性值是大小写敏感的,如果属性值在系统,jad文件和manifest文件中都没有定义的话,那么将返回null。如果在jad文件和manifest文件中定义了同样的属性值,那么会出现如下两种情况:如果应用程序是MIDP2.0种的信任应用程序,那么AMS将会拒绝安装。否则在jad文件中的属性值会覆盖manifest中的值。

    在jad文件中使用属性值有一定的好处,如果你需要更改一些数据而又不想重新编译代码、打包的话,那么你可以在jad中定义一些属性值。这样可以配置你的应用程序,想想是不是和你在j2se应用中使用属性文件类似。但是不要在jad文将中定义大量的数据,因为很多设备都是对jad文件的大小有限制的。


(出处:)


介绍MIDP应用程序的属性

发表日期:2007-12-23


    MIDlet是在MIDP中提出的一种应用程序模型,目前在J2ME中应用最为广泛。本文将主要介绍MIDP应用程序的属性问题。读者可以参考MIDP Application Properties

    MIDlet可以访问两种运行时的属性值:系统和应用程序的。

    系统属性的概念是在CLDC(Connected Limited Device Configuration)中定义的,属性值被写入底层的系统,我们可以读取它们但是不能修改这些属性值。如果你想读取一个系统属性值那么你可以使用System类的静态方法System.getProperty()来读取。经常有网友会询问如何读取手机号码或者IMEI号码,其实这些你应该参考具体机型的开发文档。各个厂商的实现都是不一样的。为了让大家查找方便这里列出在J2ME中定义的系统属性值,如果你的手机支持相关的JSR,那么就可以通过上述方法取得属性值。

JSR Property Name
Default Value¹
上一篇:NetBeans的使用(1) 人气:531
下一篇:使用MIDP底层用户接口API 人气:616
浏览全部J2EE/J2ME的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐