Developing enterprise-Class wireless applications with J2ME

Source: Internet
Author: User

Java technology is increasingly affecting our lives, from desktop to Web applications, to server-side components, to smart mobile terminals (cell phones, PDAs), and Java technology is everywhere. With Java technology, combined with J2ME and EE platforms, we can quickly develop robust, secure, and scalable enterprise-class wireless applications. As you'll see in this article, how to design and implement a mobile customer support management system using the Java Wireless Application technology. This system is the expansion of the desktop Customer relationship management system on the Intelligent Mobile Terminal, which is mainly applied to the customer management Department of small and Medium-sized enterprises. The mobile customer support management system helps field sales and service engineers to understand the company's product information in a timely manner, to better manage customer and contact information, to create and hold more business opportunities, and to quickly and efficiently handle the requests made by customers.

System Requirements

On-site sales staff in the negotiations with customers, need to timely understand the customer and contact details of the information, manage the relevant business opportunities, clear the company's product quotations, inventory and other information, can easily query (multiple conditions), create, update and delete (permission) and other operations, and can download the relevant data to the phone. In addition, on-site service engineers need to keep abreast of customer service requests and their customer and contact information in order to respond quickly and coordinate the service request. As customers, contact information, such as need to fill in more data, the system should support both offline and online working methods, users can first in the offline way to create data information, save to the phone, and then upload data, synchronization, thereby saving costs. Development tools I chose IBM WebSphere Studio.

System design and implementation

Considering the security, scalability and maintainability of the system, I decided to develop the server-side program under the Java-EE platform, which has the advantages of low complexity, low cost and excellent system performance. The system client is running on the Java phone, so this feature must be fully considered and applied in development. The goal of the system design is to separate the business logic and the presentation layer, it is a typical four-tier distributed MVC application architecture, and the design idea and realization principle are elaborated in detail below.

Clients (client Tier)

The client receives the user request and submits it to the remote server, and the results are displayed. I chose to develop the client program on the J2ME (CLDC+MIDP) platform. Because MIDlet program development has the characteristics of small memory, simple interface, limited operation ability and network performance, it is important to design the following aspects:

1. Communication with the Web server

J2ME supports opening network connections, transferring data, and accessing remote server resources. First, the user sets the system parameters offline, specifies the IP address, port, and Web root of the company's Web server, and selects the working mode (online or offline). The program then writes two related information to the local database, one to record the Web server address, and the other to record how it works. This allows the MIDlet to work in the proper state whenever the system is started or when the mode of operation is switched on. MIDlet programming supports HTTP network connections with the following code:

Httpconnection conn = (httpconnection) connector.open (URL);

This creates an HTTP connection between the client and the Web server, where the URL stores the request parameter information, such as:

url = "Http://www.mcrm.com:8000/CRMRoot/custCreateAlias?id=001&name= ..."

The corresponding servlet in the Web server will invoke the Doget () method to process the request and return the response, thus handing the processing of the business logic to the server and achieving the design goals of the "thin" client. After building an HTTP connection, you can easily manipulate the data stream, read and write data, the code is as follows:

InputStream in = conn.openInputStream();
int data;
while(data=in.read()!=0){...} ...

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.