Enterprise J2ME Developing Mobile Java Applications [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Enterprise J2ME Developing Mobile Java Applications [Electronic resources] - نسخه متنی

Michael Juntao Yuan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



3.3 iFeedBack Usage Scenarios


Before we dive into the code, let's see how iFeedBack works from a user's perspective. To test run the application, we have to build and deploy it first.


3.3.1 Build and Deploy


The application download package has three subdirectories, each containing an application component. You can use the ANT build.xml script in each directory to build and deploy the component.

Directory surveyserver contains a sample survey server application. After running ANT, a file bin/iFeedBackSurvey.ear is generated. It can be deployed to any J2EE-compliant server (J2EE v1.3 RI is tested). If this is the first time you deploy it, you need to run the sql/Init.sql script against your default database.

Directory singlesignon contains an example single sign-on token service. Currently, all usernames and passwords are hardcoded into the source code for simplicity. Obviously, in real-world deployment, it must be hooked up with campus identity databases. File deployable.war is produced by the ANT script and can be deployed to the Java Web Services Developer Pack v1.0 engine.

Directory wireless contains the MIDP mobile client. Command ant builds the JAR file in the bin directory. Command ant run runs the client in the J2ME Wireless Toolkit device emulator. In the default setting, the MIDP client assumes that both the class survey server and single sign-on server reside on a computer at IP address localhost.

Note

Once you build the JAR files for the J2ME and J2EE components, you can deploy them to any compatible emulators, devices and servers. For details on how to set up your device emulator and server environment, please refer to your product manual.


3.3.2 Try It Out!


Now, you can follow these steps to test and run the application. Figure 3.2 shows the screen shots.


Start up the MIDlet.

Choose Update Token and put in username/password pair test01/pass01. Then click UPDATE. The MIDlet will contact the single sign-on server and obtain a new authentication token for future use.

Choose Add Course. Add in a new class survey nickname and endpoint URL. You can just accept the suggested values.

Now you should see CS 301 available for selection under the Choose Course menu item. If you want to add more class surveys, you can repeat the last step.

Choose a course. iFeedBack will fetch the current question and display it for you.

Choose the appropriate answer and put in any comments. Then click SAVE to save the time-stamped answer to the on-device persistent cache.

You can repeat the last two steps multiple times for different questions from different courses.

From the main menu, click Submit Answers to submit all cached answers to their corresponding endpoints. All successfully submitted answers will be deleted from the cache.

Now you can view the uploaded answers from the class survey server. Just point your HTML browser to the URL


http://host:8080/iFeedBackSurvey/servlet/Server.



Figure 3.2. The iFeedBack application: The screen in the middle is the main menu. The surrounding screens show how different menu actions work. The application workflow is described in the text.


We have seen how iFeedBack works. It is now time to look under the hood!


/ 204