CHAPI, Java Content Handler API
Java ME Content Handler API, JSR 211
The Content Handler API (CHAPI) allows Java ME applications to invoke another application to handle the specified content type. The appropriate application to handle a content type based on the application management system (AMS) on the device. Applications may register themselves with the AMS to handle various content types. With CHAPI, applications can be developed that hand off content and data at appropriate places. FOr example, if a message has a music file attached to it, the messaging application may use CHAPI to invoke a devices's music player. For more information on CHAPI visit java.sun.com/products/chapi.
Packages
javax.microedition.content
http://java.sun.com/javame/technology/msa/jsr211.jsp
http://java.sun.com/products/chapi/
JSR211 SPEC
http://jcp.org/en/jsr/detail?id=211
Handling Varied Content in J2ME Applications
http://developers.sun.com/mobility/midp/ttips/chapi/index.html
http://mobilezoo.biz/jsr/211/overview-summary.html
A good example
http://www.devx.com/wireless/Article/21958/1763/page/1
JSR211-Content Handler API 简介
CHAPI和它的执行模型使应用程序能够调用已注册的J2ME程序和手机本地的非Java程序,一般有三种调用形式:1.通过URL;2.通过内容类型;3.通过内容处理程序的ID。程序在处理内容时能够使用内容处理者的某些功能,比如:应用程序使用一个内容处理者去获得一个特殊的显示内容的功能或者其它的打开、打印、播放内容等功能;比如:一个简单的MIDP MIDlet程序被注册来处理image/png媒体类型的内容,其它应用程序能请求其显示图片。一个内容处理程序能提供用于显示内容、更改内容、返回内容不多种功能。CHAPI的执行模型充分利用了应用程序管理系统提供了流畅的用户体验、控制程序的执行、保存资源、执行设备的安全政策和Java运行环境。
该规范包括以下功能:
1.调用内容处理程序和获得返回内容
2.注册内容处理者
3.查询注册信息
4.响应并处理调用请求