In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to explore the guidelines for the development of J2ME applications, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Let's focus on the guidelines for developing J2ME applications, and we'll review some of the considerations we need to keep in mind when developing applications for small devices. Take a look at the method that calls the compiler when compiling a J2ME application using J2SE. The editor will explore packaging and deployment, as well as the role of pre-verification in the process.
Guidelines for developing J2ME applications
one。 Develop J2ME applications
1. Introduction
We will review some considerations to keep in mind when developing applications for small devices. We'll take a look at how to call the compiler when compiling a J2ME application using J2SE. We will explore packaging and deployment, as well as the role of pre-verification in the process.
Matters needing attention in the design and development of small device applications
Developing applications for small devices requires you to develop a strategy during the design phase. * is to strategically design applications for small devices before you start writing code. Because you can't take all the "gotchas" into account, correcting the code before developing the application is a painful task.
two。 Here are some design strategies to consider:
Keep the program simple. Remove unnecessary features and, if possible, make them independent, secondary applications.
The smaller the program, the better. This should be obvious to all developers. Smaller programs take up less device memory and take less time to install. Consider packaging your Java application as a compressed Java archive (jar) file.
The runtime takes up the least amount of memory. To minimize runtime memory consumption, use scalar types instead of object types. At the same time, it does not rely on the garbage collector. You should leave the object reference empty when you finish using the object, so that memory can be managed effectively. Another way to reduce the memory required at runtime is to use a "lazy" instance, which allocates objects only when necessary. Other ways to reduce excessive and peak memory usage on small devices are to quickly release resources, reuse objects, and avoid exceptions.
3. Matters needing attention in designing and developing J2ME applications for mobile devices
The rules for developing mobile device applications are the same as the ones we mentioned earlier for developing small devices: design before coding. Let's take a look at some design suggestions to consider when developing mobile device applications:
Let the server do most of the work. Put the more computational tasks on the server and let the server do the work for you. Let the mobile device handle the interface and minimal computing work, while the server does the heavy work. Of course, the mobile device for which you develop applications has a significant impact on how easy and how often the device connects to the server.
Choose the programming language carefully. J2ME is still in the stage of growth and may not be the choice yet. Depending on your needs, it may be better to choose another object-oriented language, such as Cellular languages.
4. Performance consideration
?? Coding for performance. Here are some coding methods aimed at achieving * performance:
Use local variables. Accessing local variables is faster than accessing class members.
Avoid concatenation of strings. String concatenation not only degrades performance, but also increases the application's peak memory footprint.
Use threads to avoid synchronization. Any operation that takes more than 10 seconds to run requires a separate thread. Avoiding synchronization can also improve performance.
5. Compilation considerations
?? Like other Java applications, you need to compile before you package and deploy the application. Despite J2ME, you still use the J2SE compiler and need to make calls with the appropriate options.
?? In particular, you need to use the-bootclasspath option to instruct the compiler to use the J2ME class instead of the J2SE class. Do not set the configuration class in the compiler's CLASSPATH. This will result in a run-time error, because no matter what is in CLASSPATH, the compiler will first automatically search for J2SE's core classes. In other words, the compiler will not be able to reference classes or methods that are missing in a particular J2ME configuration, resulting in a run-time error when trying to run the application.
6. Packaging and deployment considerations
?? Because J2ME is designed for small devices with limited memory. Most of the commonly used Java advance verification has been removed from the virtual machine to form a smaller coverage area. As a result, it is necessary to validate the J2ME application in advance before configuration. A check is attached at run time to ensure that the class has not changed after pre-validation.
How to strictly perform advance verification or check the correctness of a class depends on the toolkit. CLDC provides a command-line utility called advance validation, which can actually validate and insert some additional information into class files. MIDP uses the Wireless Toolkit, which provides a GUI tool that can also be run from the command line.
Deployment depends on the platform you are deploying. The application must be packaged and configured in a format appropriate to the J2ME device type, as defined by the profile.
The above is how to explore the guidelines for developing J2ME applications, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.