high level display screens in j2me price
CIOs and IT managers are always struggling to improve the availability of corporate data to those who need it to run the business. In the case of salespeople and mobile executives, that"s a tall order. Ideally, you would use the very gear that these people already carry — such as PDAs or cell phones — to act as messaging systems and data terminals that can fetch customer information or place an order.
Unfortunately, the vast differences among these devices — Pocket PCs running Windows CE, PDAs running Palm OS or Linux, cell phones running the Symbian OS — pose significant problems for developers. Even the cell phones from a single vendor such as Motorola (the company I work for) can vary widely in processor type, memory amount, and LCD screen dimensions. Worse, new handsets sporting new features, such as built-in cameras and Bluetooth networking, are released every six months to nine months.
For IT managers whose chief concern is that applications running on device A today also run on device B tomorrow, the best choice among development platforms is J2ME, a slimmed-down version of Java tailored for use on embedded and mobile devices. Most handset vendors implement their own Java VM, and third-party VMs provide Java support in Palm and Pocket PC devices. For a broad range of devices, past, present, and future, J2ME provides a high degree of security and application portability — but not without drawbacks.
As were all editions of Java technology, J2ME was built to provide controlled access to program resources. The run-time architecture uses a “sandbox” mechanism that contains the executing program in a separate, protected memory space. This prevents code malfunctions from damaging other critical components of the run-time environment. Also, the program doesn’t have unfettered access to any low-level hardware or resources outside of the sandbox. Instead, all device operations are conducted via J2ME API calls.
There are good reasons to isolate a program from many of the phone’s functions. Unlike a desktop PC in which a program crash might clobber a word processing session, a cell phone is essentially a two-way radio. The Federal Communications Commission frowns on the improper use of radio transmitters regardless of the culprit — a cell phone’s owner or a malfunctioning program. And you wouldn’t want a Trojan program “phoning home” and transmitting personal information to a cracker. Because over-the-air provisioning allows users to download new applications, this makes the Java security sandbox more important than ever.
However, this protection scheme has its downside. Stated simply, if an API isn’t defined for a specific hardware feature, a developer can’t use that feature. For example, the Sony Ericsson T610 handset comes with an army of features: Bluetooth networking, infrared and serial connectivity, and a built-in digital camera. However, the current APIs in the T610’s J2ME implementation don’t utilize these features. Instead, you must use C++ and the Symbian OS (which lies under the J2ME abstraction layers) to access them.
Most vendors sidestep this issue by providing special Java APIs designed to access proprietary features. Unfortunately, each vendor devises its own unique set of APIs to use similar services. These incompatible APIs defeat J2ME’s prime directive to provide an abstract platform with a consistent interface that accesses all available features across all devices. Using such vendor-specific APIs also ties the application to a particular mobile device, which reduces an IT manager’s options to deploy the application as far as possible across the enterprise.
J2ME limits support for vendor-specific hardware features to accommodate variations among devices. J2ME tackles hardware variations in two ways. First, J2ME defines an abstraction layer known as a configuration, which describes the minimum hardware required to implement Java on an embedded device. The J2ME configuration that addresses resource-constrained devices such as mobile phones and low-end PDAs is the CLDC (Connected Limited Device Configuration).
Second, J2ME defines a second abstraction layer, termed a profile, that describes the device’s hardware features and defines the APIs that access them. Put another way, profiles extend a configuration to address a device’s specific hardware characteristics.
J2ME currently defines one profile for CLDC devices: the MIDP (Mobile Information Device Profile). In addition to stipulating the basic hardware requirements, the MIDP implements the APIs used to access the hardware.
It’s important to understand that a J2ME device can have only one configuration that describes the core hardware. However, multiple profiles are allowed, including the MIDP and vendor profiles that support device-specific features. A vendor can therefore quickly adapt J2ME for a new device by writing profiles for it.
Besides interfaces, the MIDP describes the characteristics of a J2ME application, known as a midlet. Midlets are taxonomically similar to Java applets, the major difference being that a midlet can download data but not additional code through the connection. The end result is that a midlet has the potential to run unaltered on any J2ME-enabled device. Furthermore, because J2ME profiles define the interface, the appearance and behavior of the midlet on different devices is nearly identical. J2ME thus holds out the promise of becoming a universal front-end for client applications that can run on any mobile device.
The astute reader will have no doubt noticed the words “potential” and “nearly” in that last paragraph. Let’s face it: A few limitations in J2ME can hamper application portability. To begin with, subtle variations in each vendor’s J2ME implementation can cause incompatibilities.
Another issue is that if an API doesn’t exist for a specific device feature, you can’t use that feature at all. J2ME does specify optional standards, such as the MMAPI Mobile Media API, which provides support for audio playback and streamed video. Unfortunately, a developer can’t rely on an optional standard being available on every device.
However, J2ME is constantly evolving to address these concerns. In November 2002, the Java Community Process (JCP) released a significant revision to the MIDP specification. Called MIDP 2.0, it adds mission-critical APIs that support secure network connections (via HTTPS) and implements permissions with digital signatures to support trusted code. The specification also provides improved UI elements that offer enhanced form layout for business applications.
Unlike optional standards, a device that uses MIDP 2.0 must implement all the APIs that it describes, thus ensuring their availability to a program. Handsets that support the MIDP 2.0 specification should appear on the market later this year.
Down the road, the JCP proposes a new JTWI (Java Technology for the Wireless Industry) specification. In JTWI, a number of optional J2ME APIs — such as MMAPI and WMA (Wireless Messaging APIs) — become required services.
Even in its current state, J2ME offers developers the ability to write once and deploy a business application across the wide range of wireless gear currently available. J2ME’s abstraction layers also provide a hedge against vendor lock-in, and they help cope with the rapid changes in today’s wireless devices. Developers may have to craft the midlet’s interface to address the lowest-common-denominator display, but that’s a small price to pay compared with writing a custom client application for each device the corporation owns.
Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.
This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.
To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:
For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.
For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.
Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.
Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.
If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.
On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.
We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users" wishes when a user submits their information through our Contact Us form.
Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.
Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.
This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.
Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.
Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.
If a user"s personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user"s personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user"s account.
Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.
While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.
California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson"s commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.
To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.
This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.
We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.
For further setting forth the technological means that the present invention takes and the effect obtaining, below in conjunction with accompanying drawing and preferred embodiment, to J2ME game running method proposed by the invention and the technical scheme of device, know and complete description.
Refer to Fig. 1, the schematic flow diagram of J2ME game running method of the present invention.J2ME game running method of the present invention comprises the following steps:
S101 preserves MIDlet class on Android platform; In the MIDlet of described preservation class, create a method of calling switch view for other class;
MIDlet class is the entrance of J2ME game application.MIDlet is similar with Android Activity life cycle, and MIDlet directly inherits Activity, thereby Activity API is converted to MIDlet API.Defined method in J2ME MIDlet is carried out to same definition, and call accordingly in the life cycle of Activity, mainly comprise: definition abstract method abstract void startApp (), abstract void destroyApp (boolean unconditional), and in onCreate (), call startApp (), and realize destroyApp () in MIDlet derived class, only need call System.exit (0).
The interface that a difference that it is pointed out that Android platform and J2ME platform is Android is refreshed and is switched and can only in main thread, carry out, and sub-thread need to be notified main thread to refresh or be switched Canvas interface by Handler.Therefore, need in MIDlet, create the method that other class of confession is called switch view, refresh picture and in Canvas, realize.
S102 preserves Canvas class, Display class, Front class and Graphics class on Android platform; Wherein, by the SurfaceView on succession Android platform, to preserve Canvas class, by the android.view.Display on Android platform, change to preserve Display class;
J2ME Canvas is the core of 2D development of games, and the function of the Canvas function of Canvas on corresponding A ndroid platform not on J2ME platform, but the function of corresponding SurfaceView.Therefore preserving Canvas need to inherit SurfaceView.
Because Android need to inherit interface SurfaceHolder.Callback.SurfaceHolder.Callback has defined the life cycle of SurfaceView, Canvas is defined as abstract method by SurfaceHolder.Callback interface method and is realized by derived class, and derived class needs the initialization content in structure to move on in the surfaceCreated () method of SurfaceHolder.Callback definition.
Definition abstract method paint (Graphics g) offers derived class and realizes.SurfaceHolder object mHolder of initialization in building method, in paint () method, by mHolder, obtain android.graphics.Canvas object, and be Graphics object as parameter initialization, and then pass to paint (Graphics g) method as parameter.
While preserving Canvas on Android platform, other method can adopt similarly directly conversion regime, and as key response method, definition keyPressed () calls keyPressed () in onKeyDown ().
Although MIDlet has realized the control that view is switched, in J2ME game application, generally by Display, control view and switch.Transplanting for convenience of J2ME game application, has defined Display class in the present invention, and this Display class is by changing and obtain android.view.Display.The method providing due to android.view.Display be difficult to J2ME platform on Display method directly corresponding, so the present invention defines an android.view.Display member object in the Display of J2ME.So just can directly define initial method static Display getDisplay (MIDlet mid), by MIDlet object, obtain WindowManager, then by WindowManager initialization android.view.Display object.Above-mentioned define method in the present invention than the Display.getDisplay () of J2ME platform just many MIDlet parameter, can at utmost reduce difference semantically, reduced the complexity of transplanting.
Another important method of preserving Display on Android platform is setCurrent (View view), directly calls the sendMessage (View obj) of MIDlet object in the method.
Font function is comparatively simple, is mainly used in recording font size and style, only needs the corresponding variable of definition, and assignment method is provided.Obtain character string width and highly by Paint, take out font size and directly calculate.
Graphics member comprises android.graphics.Canvas, Bitmap, Paint, Rect, Font object, and realizes its function by these objects.Method for drafting (comprising draw characters, figure) is realized jointly by Paint and android.graphics.Canvas.Rendered images needs to obtain Bitmap object, draw out, and Bitmap is included in the parameter of Image type by android.graphics.Canvas.Rect is for shearing the region of drafting.Because android.graphics.Canvas does not support to arrange reference point, so the coordinate that need to draw according to reference point parameter adjustment by program is realized.
Graphic graphics module is the nucleus module of J2ME game, and the visual effect of game all realizes by graphics module.After preserving Canvas class, Display class, Front class and Graphics class, set up the corresponding relation of Graphic graphics module in Canvas class, Display class, Front class and Graphics class and J2ME games.
S103 preserves Image class on Android platform; Wherein, on Android platform, define a Bitmap object, described Btmap object is changed to preserve Image class;
Image class is the function of corresponding A ndroid API directly, defines Bitmap object on Android platform, directly Btmap object is changed, and games are converted to the operation to Bitmap object to the operation of Image.
S104 calls MIDlet class, Canvas class, Display class, Front class, Graphics class and the Image class of above-mentioned preservation, moves J2ME game on Android platform.
Due to each class of preserving, program entry, Graphic graphics module and picture resource module in playing with J2ME are respectively set up corresponding relation, therefore by raising and use above-mentioned class at Android platform, can realize the operation of J2ME game on Android platform.
After preserving MIDlet class, set up the one-to-one relationship of MIDlet class and J2ME games entrance.By calling MIDlet class, enter J2ME program entry, thereby start J2ME game master routine.
Graphic graphics module is the nucleus module of J2ME game, and the visual effect of game all realizes by graphics module.After preserving Canvas class, Display class, Front class and Graphics class, set up the corresponding relation of Graphic graphics module in Canvas class, Display class, Front class and Graphics class and J2ME games.After game main thread starts, called Graphic graphics module, Graphic graphics module is calling the above-mentioned class of Android platform, and particularly the Canvas mechanism of drawing realizes the function that Graphic draws.
Preserve Image class on Android platform after, set up the corresponding relation of picture resource module in Image class and J2ME games.In J2ME game Graphic graphics module by calling the resource such as picture resource module Loads Image, audio files.Call the Image class of preservation, can on Android platform, realize the function of picture resource module for J2ME game.
J2ME program adopts the storage of RMS data, for to RMS data, storage provides support, the RMS memory mechanism of J2ME platform need to be converted to the file memory mechanism of Android, in the file that the data stream that J2ME game is transmitted and key word directly output to key word appointment, preserve.The data layout of RMS storage only limits to byte arrays, its data layout can be converted into string format and call Android file storage API the data that write are saved as to file.
Preferably, preserve class DataStore, (android carries to create Properties object, the storage class of similar Hash table), by save () save data, game data is converted to Object object, and add key assignments (key), be saved in Properties, create file input stream, by properties.store () method, be written to file output stream; By load () method reading out data, by filename, create file input stream, write data in properties, then from properties, take out data object Object by key assignments, then carry out corresponding data type conversion.
The multimedia of J2ME game is mainly sound played file, if audio files is judged as audio according to the time span of audio files, plays or music.Preferably, if time span is greater than 5 seconds, be judged as music file, otherwise be judged as audio effect file.
Preferably, if audio effect file is play by the audio pond of Android platform.By setting up the mode in " audio pond ", when initialization, record the identifier list of audio, and audio effect file is loaded in " audio pond ", J2ME games call play sound effect method at the node of playing, and find corresponding audio to play by identifier.If music file is play by the MediaPlayer object of Android platform.Audio loading velocity is very fast, and reproduction time is shorter.And the support of music multimedia is play for a long time, but the load time is longer.Preserve acoustic management class SoundManager, by addSound (), load audio files used, judgement sound reproduction time length, if be greater than 5 seconds, be loaded as MediaPlayer object, otherwise be loaded as SoundPool object, and deposit in Hash table, when playing, by key assignments, from Hash table, find corresponding target voice, call its player method.
Control information is the mode of user and program interaction.J2ME games are general, and only to physical button, control information responds, for this feature, Android platform is except sending to J2ME games physical button control information correspondence, also adopt the characteristic control mode of Android platform, touch screen and gravity sensing are played and are expanded J2ME.J2ME games are converted to the control information of the same operating physical button of response by receiving after the touch screen of supporting frame and gravity sensing control information the operation of response as required.
Android control information is sent on Canvas, then by Canvas, information is mapped as to key information, implementation method is that Canvas has inherited Android gesture and gravity sensing is monitored interface OnTouchListener, realize onTouch (View v, MotionEvent event) method (system passes over information by calling the method), by the method, take out the coordinates regional that screen triggers, according to real needs, be set as the button value of response, and call key response method.Game state is converted to corresponding key-press event (J2ME game generally can complete all operations by key-press event and control) to touch screen gesture event and gravity sensing event.Module receives the state value of J2ME games, corresponding key value and toggle area, and toggle area is a rectangular pixels region, if certain toggle area produces touch screen event, according to game current state, returns to corresponding key-press event.In like manner, gravity-feed tank is to make Canvas inherit interface SensorEventListener, by onSensorChanged (SensorEvent e) method receive gravity towards coordinate figure, according to real needs, be mapped as corresponding button value, and call key response method.Gravity sensing event according to mobile phone towards being converted to corresponding key-press event.J2ME games only need carry out the setting of control module at each initialized node, can expand to and support touch screen and gravity sensing function, have enriched user"s experience.
J2ME game running method provided by the present invention provides the running environment of J2ME game application on Android platform, has realized the support of Android platform to J2ME game application.Game developer adopts can be extended to after J2ME platform development on Android platform, also develops a set of games and can run on J2ME platform and Android platform simultaneously.So both guaranteed that the J2ME game of developing can cover more low and middle-end mobile phone, also greatly reduced the cost that J2ME game application is transplanted to Android platform, improved development efficiency and the maintainability of game application simultaneously.
And the API opening to J2ME game on Android platform all realizes same function with reference to the function of J2ME platform api, and with corresponding J2ME API name, make the program code of J2ME game self without making an amendment, greatly improve operability and maintainability.
Refer to Fig. 2, the structural representation of J2ME game running device of the present invention.J2ME game running device of the present invention comprises games entrance respective modules 201, Graphic graphics module respective modules 202, picture resource module respective modules 203 and game running module 204;
Described games entrance respective modules 201, for preserving MIDlet class on Android platform; And in the MIDlet of described preservation class, create a method of calling switch view for other class;
Described Graphic graphics module respective modules 202, for preserving Canvas class, Display class, Front class and Graphics class on Android platform; Wherein, by the SurfaceView on succession Android platform, to preserve Canvas class, by the android.view.Display on Android platform, change to preserve Display class;
Graphic graphics module is the nucleus module of J2ME game, and the visual effect of game all realizes by graphics module.After preserving Canvas class, Display class, Front class and Graphics class, set up the corresponding relation of Graphic graphics module in Canvas class, Display class, Front class and Graphics class and J2ME games.
Described picture resource module respective modules 203, for preserving Image class on Android platform; Wherein, on Android platform, define a Bitmap object, described Btmap object is changed to preserve Image class;
Described game running module 204 for calling MIDlet class, Canvas class, Display class, Front class, Graphics class and the Image class of above-mentioned preservation, is moved J2ME game on Android platform.
Due to each class of preserving, program entry, Graphic graphics module and picture resource module in playing with J2ME are respectively set up corresponding relation, therefore by raising and use above-mentioned class at Android platform, can realize the operation of J2ME game on Android platform.
Described game running module 204 comprises that J2ME games start module, Graphic graphics module operation module and picture resource module operation module.
After preserving MIDlet class, set up the one-to-one relationship of MIDlet class and J2ME games entrance, by calling MIDlet class, enter J2ME program entry, thereby start J2ME game master routine.
Described Graphic graphics module operation module for calling Canvas class, Display class, Front class and the Graphics class of preservation, is moved the Graphic graphics module in J2ME games on Android platform.
Graphic graphics module is the nucleus module of J2ME game, and the visual effect of game all realizes by graphics module.After preserving Canvas class, Display class, Front class and Graphics class, set up the corresponding relation of Graphic graphics module in Canvas class, Display class, Front class and Graphics class and J2ME games.After game main thread starts, called Graphic graphics module, Graphic graphics module is calling the above-mentioned class of Android platform, and particularly the Canvas mechanism of drawing realizes the function that Graphic draws.
Described picture resource module operation module for calling the Image class of preservation, is moved the picture resource module in J2ME games on Android platform.
Preserve Image class on Android platform after, set up the corresponding relation of picture resource module in Image class and J2ME games, in J2ME game Graphic graphics module by calling the resource such as picture resource module Loads Image, audio files.
The file storage API that described data memory module calls Android platform stores the data of the string format of conversion in the file on Android platform into.
If multimedia file is sound played file, described multimedia playing module classifies the documents as audio effect file or music file according to the reproduction time length of file;
J2ME game running device provided by the present invention has encapsulated the total solution that J2ME game application is expanded to Android game application on Android platform.Not only realized the support of Android platform to J2ME game application, for the control characteristic of touch screen machine, J2ME has been played and done many improvement to improve user"s experience simultaneously.Realize the J2ME development of games across Android platform, improved development efficiency, reduced the cost that Android platform is transplanted in J2ME game.
Above-described embodiment of the present invention, does not form limiting the scope of the present invention.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in claim protection domain of the present invention.