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

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

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

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

Michael Juntao Yuan

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

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

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



5.1 Getting Started


The Smart Ticket application is available from Sun Microsystems' blueprints Web site (see "Resources"). The zip package contains source code; ANT build scripts; and prebuilt, deployable application binaries.


A Brief History of the Smart Ticket Blueprint


The Smart Ticket blueprint v1.0 was officially released in early 2002. It featured simple and straightforward designs that did the job but had limited educational value. The first mature implementation is v1.1.1, which was released in both English and Japanese languages.

Smart Ticket v1.2, released in March 2003, features a major architectural revision, which provides excellent examples of several important end-to-end design patterns. The code version covered in this chapter is v2.0 Early Access (EA), which was released on April 15, 2003. The v2.0 EA has the same architecture as the v1.2. The only change is that the v2.0 EA has an enhanced implementation of the presentation layer, which takes advantage of the new MIDP v2.0 UI capabilities.

When you read this book, a newer version of the Smart Ticket application is likely to be out already. But you can still download the exact v1.2 final release and v2.0 EA code referenced in this chapter from this book's Web site.

The Smart Ticket sample contains a J2EE component for the enterprise back end and a J2ME component for the mobile front end. Running the application requires a J2EE application server and a MIDP v2.0-compatible device (or emulator) with Internet connectivity. For learning and testing purposes, we can run both the J2EE server and MIDP emulator on the same computer as follows.


Set up the following environment variables:

JAVA_HOME: The JDK installation directory (JDK v1.4.1 and above required)

J2EE_HOME: The J2EE reference implementation (RI) installation directory (J2EE v1.3.1 and above required)

J2MEWTK_HOME: The J2ME Wireless ToolKit installation directory (J2ME WTK v2.0 and above required)


Start the J2EE server using the following two commands:


J2EE_HOME\bin\cloudscape -start
J2EE_HOME\bin\j2ee -verbose

Deploy the J2EE application using the following script. The setup script in turn invokes the corresponding ANT task in setup.xml:


setup deploy

Point your browser to http://localhost:8000/smartticket and click on the populate database link to import the mock theater and movie data to the Smart Ticket database. This could be a very slow process on older computers, so be patient! The mock data set contains theater information in two zip code areas: 95054 and 95130.

Start the J2ME WTK v2.0 and run MIDlet smart_ticket-client.jad.


Now, you are ready to order some movie tickets from the phone emulator!

Note

If you want to run the MIDP client on an actual smart phone device, the J2EE server must run on an Internet-accessible computer and you must configure the MIDP client for the correct server IP address.


/ 204