Technology sharing: Download the local j2's program to the mobile phone with OTA

Source: Internet
Author: User

Java2MicroEdition is an integral part of Java2. It is also known as J2SE and J2EE. Here we will give a brief introduction to how to use OTA to download the local j2_program to your mobile phone. I believe that you will have a deeper understanding of j2_through this article.

Use OTA to download the local j2_program to the mobile phone

Environment: windows2000 + tomcat4.1.24 + j2wtk2.0

1. Install a web server and use tomcat. Modify the corresponding configuration file to support the JAD and jar mime types.

Type

JAD: text/vnd. sun. J2EE. app-descriptor

JAR: application/java-archive

Do not tell me If TOMCAT is installed ?), The new version of tomcat is supported by default. in earlier versions, modify % tocmat %/conf/web. xml to find the mime and add it.

 
 
  1. <mime-mapping> 
  2.  
  3. <extension>jad</extension> 
  4.  
  5. <mime-type>text/vnd.sun.J2ME.app-descriptor</mime-type> 
  6.  
  7. </mime-mapping> 
  8.  
  9. <mime-mapping> 
  10.  
  11. <extension>jar</extension> 
  12.  
  13. <mime-type>application/java-archive</mime-type> 
  14.  
  15. </mime-mapping> 
  16.  

2. Create a directory on disk D for jsp, html, and jar. Jad files are all lost here). Many articles have been written before configuring tomcat to support methods). Create a time in d: \ jsp. jsp, content: <% = newjava. util. date () %>, open the browser to access http: // yourip: 8080/jsp/time. jsp. The current time indicates that the configuration is successful.

3. in d: \ jsp, create a new directory, and complete the xxx. jad and the corresponding xxx. drop the jar file in it. Pay attention to xxx. fill in the corresponding xxx in the MIDlet-Jar-URL attribute of the jad file. the absolute path of jar. In this example, http: // yourip: 8080/jsp/j2-xxx. jar

4. Create a j2me.html file in d: \ jsp. the content is

 
 
  1. <?html> 
  2.  
  3.  
  4. <title>J2ME</title> 
  5.  
  6.  
  7. <body> 
  8.  
  9. <ahrefahref="http://yourip:8080/jsp/J2ME/demos.jad">demos.jad</a> 
  10.  
  11. <ahrefahref="http://yourip:8080/jsp/J2ME/UIDemo.jad">UIDemo.jad</a> 
  12.  
  13. <ahrefahref="http://yourip:8080/jsp/J2ME/games.jad">games.jad</a> 
  14.  
  15. <body> 
  16.  

So far, tomcat is started after server configuration is complete.

5. Install j2wtk2.0, start OTAProvisioning from the j2wtk menu in the Start Menu, click apps in the lower right corner of the screen, click installapplication, and enter http: // yourip: 8080/jsp/J2ME.html, demos appears on the screen. jad, UIDemo. jad, games. select an install option for jad and execute the command. If it runs normally, proceed to the next step.

6. if you use a mobile phone that supports java, you can use motoT720 to activate the GPRS Service. Enter the http: // yourip: 8080/jsp/J2ME.html URL in the corresponding Internet application, after the installation, the image is the same as step 5, and the image is the same as Step 5.

Note:

1. Make sure that the MIDlet-Jar-URL attribute in the xxx. jad file points to the absolute URL of the corresponding xxx. jar file.

2.The j2me.html file in the previous steps is on the camera and should be modified accordingly.

3. before downloading the SDK, use j2wtk for testing. After the download is successful, use your mobile phone to download the gprs package)

4. Currently, midp2 is supported on the market. There aren't many mobile phones with 0, so do not use midp2 in the program. 0 api

5. replace all the above yourip addresses with the local ip address.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.