Requests that the device handle (for example, display or install) the indicated URL.
此方法执行的是手机设备处理的URL请求,比如:显示URL地址连接的内容或安装URL指定资源的套件。
情况1:
If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MIDlet suite running in the background.
如果手机平台支持此功能并且所请求的资源可获取的话,手机平台“应当”一方面将URL对应的具体请求程序切换到前台,以便使用户和URL对应的具体请求程序进行交互,另一方面使当前的MIDlet suite在后台运行。
情况2:
If the platform does not have appropriate capabilities or resources available, it MAY wait to handle the URL request until after the MIDlet suite exits. In this case, when the requesting MIDlet suite exits, the platform MUST then bring the appropriate application (if one exists) to the foreground to let the user interact with the content.
如果手机平台不支持此功能或者所请求的资源被占用的话,除非发出URL请求的MIDlet suite退出,它“会”一直处理这个URL请求。在这种情况下,当发出URL请求的MIDlet suite退出时,设备平台“必须”将后台的应用程序
(如果存在的话)切换到前台,以恢复其与用户的交互。
This is a non-blocking method. In addition, this method does NOT queue multiple requests. On platforms where the MIDlet suite must exit before the request is handled, the platform MUST handle only the last request made. On platforms where the MIDlet suite and the request can be handled concurrently, each request that the MIDlet suite makes MUST be passed to the platform software for handling in a timely fashion.
platformRequest是一种非阻塞的方法,所以该方法不能够将多个请求进行排队。在请求被处理前MIDlet suite必须退出的平台上,只有最后的一个请求才会被处理。而在MIDlet suite和请求能够同时处理的手机平台,每个发自MIDlet suite的请求必须被实时的传送给手机平台程序管理系统来处理。
If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file), the application handling the request MUST interpret it as a request to install the named package. In this case, the platform's normal MIDlet suite installation process SHOULD be used, and the user MUST be allowed to control the process (including cancelling the download and/or installation). If the MIDlet suite being installed is an update of the currently running MIDlet suite, the platform MUST first stop the currently running MIDlet suite before performing the update. On some platforms, the currently running MIDlet suite MAY need to be stopped before any installations can occur.
如果URL所描述的请求引用了一个MIDlet suite(无论是一个jad文件还是一个jar文件),处理这个请求的应用将将把该请求做为安装某个package的请求。在这种情况下,平台将进行一般MIDlet suite安装,用户也将控制这个安装过程(包括取消安装、下载、确认安装)。如果被安装的MIDlet suite是当前运行的MIDlet suite的更新版本,则在执行升级之前,平台将停止当前运行的低版本MIDlet suite。有一些平台,在安装进行之前当前运行的MIDlet suite可能需要停止。
If the URL specified is of the form tel:<number>
, as specified in RFC2806, then the platform MUST interpret this as a request to initiate a voice call. The request MUST be passed to the "phone" application to handle if one is present in the platform. The "phone" application, if present, MUST be able to set up local and global phone calls and also perform DTMF post dialing. Not all elements of RFC2806 need be implemented, especially the area-specifier or any other requirement on the terminal to know its context. The isdn-subaddress, service-provider and future-extension may also be ignored. Pauses during dialing are not relevant in some telephony services.
Devices MAY choose to support additional URL schemes beyond the requirements listed above.
Many of the ways this method will be used could have a financial impact to the user (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the platform MUST ask the user to explicitly acknowlege each request before the action is taken. Implementation freedoms are possible so that a pleasant user experience is retained. For example, some platforms may put up a dialog for each request asking the user for permission, while other platforms may launch the appropriate application and populate the URL or phone number fields, but not take the action until the user explicitly clicks the load or dial buttons.
- Parameters:
URL
- The URL for the platform to load. An empty string (not null) cancels any pending requests.
- Returns:
- true if the MIDlet suite MUST first exit before the content can be fetched.
- Throws:
ConnectionNotFoundException
- if the platform cannot handle the URL requested.
- Since:
- MIDP 2.0