A mobile information device (MID) is usually understood to be a computer that you can hold in your hand. Such devices are familiar in the world today as cell phones, iPods, iPhones, and BlackBerries. All such devices have their own operating system, but at the same time, they are developed according to standards that international organizations and corporations have established. Java is a popular language for programming such devices because Java runs on a virtual machine. Sun can create a virtual machine for almost any device, and for this reason, Java has become the premier language for mobile information device programming. For those unfamiliar with Java and mobile information device programming, this chapter provides a few introductory notes. It is not intended as a comprehensive introduction to the topic, but it presents a brief outline of the history of the Java programming language and related technologies. It also discusses the capabilities and limitations of mobile phones.
Java’s Acorn
In early 1995, Sun Microsystems released an alpha version of a new software environment called Java. During the first six months after Java’s release, many people in the software development industry spent their time exchanging bad jokes and puns about coffee beans and Indonesian islands. It didn’t take long, however, for the slogan of ‘‘Write Once, Run Anywhere’’ to supplant the jokes and puns. Java was taken up by thousands of developers, and Java began itsmarch to the top.
The earliest traces of Java go back to the early 1990s, when Sun formed a special technical team (known as the Green Team) tasked with developing the next wave of computing. After an 18-month development effort, the team emerged with the result: a handheld home-entertainment device controller with a touchscreen interface known as the *7 (Star Seven).
The real action, however, was not with the *7 or the device running it; it was with the backend technology that powered it. One of the requirements of the project was a robust, hardware-independent, embedded software environment that facilitated low-cost development.
At this point, James Gosling entered the picture. Gosling, a Canadian software engineer working with the Green Team, was the primary designer of Java. He began to develop the basics of Java by using some of the best elements of C++, such as its general syntax features and object-orientation. He excluded such things as memory management, pointers, and multiple inheritance. Gosling endeavored to create a simple, elegant language that developers could use to quickly deploy applications.
Gosling’s first version of Java, called Oak, ran on the *7 device and featured the familiar Java mascot Duke. Oak’s power wasn’t only in its language design; there were plenty of other object-oriented languages. Oak blossomed because it encompassed everything. Gosling did not create a language and then let other people implement it as they saw fit. The goal of Oak was hardware independence, and with that in mind he created a complete software deployment environment. From virtual computers to functional application programming interfaces (APIs), Oak provided—and, more importantly, controlled—everything.
Unfortunately, the *7 did not last long. The notion of running programs on a fixed device (and devices in this respect ranged from toasters to garage door openers) was promising but not what was really needed. What was really needed was something that went worldwide during the mid-1990s: the Internet. With the help of developers such as Bill Joy, Wayne Rosing, John Gage, Eric Schmidt, and Patrick Naughton, Gosling was able to make Java a core programming language for the Internet.
The Internet emerged as the predominant technology of the day. Browsers could be used to transfer and display digital content in the form of pictures, text, and even audio almost universally on a variety of hardware. Servers could link millions of Internet users. Java proved ideal as a programming language that could accommodate the needs of both browsers and servers.
The goals of the web were not dissimilar to that of Oak: provide a system to let you write content once, but view it anywhere (running on a variety of operating systems). Oak was designed to allow programmers to develop on different devices. Programs running on servers or applications running in browsers amounted to the same thing. The Internet became the framework within which Oak software could be distributed and universally deployed.
Java’s Growth in the Sun
Given the match between the needs of the Internet and the design of Oak, the mission and description of Java soon emerged from Oak. Gosling and the team at Sun developed a host of technologies around the concept of a universally deployable language and platform. One of their first tasks was to develop the Java-compatible browser known as HotJava. (The early versions were named WebRunner, after the movie Blade Runner.) shows the original HotJava browser.
If Sun sought to dominate the Internet through HotJava and distribute Java in that way, something even better soon arose. On May 23, 1995, the Netscape Corporation agreed to integrate Java into its popular Navigator web browser, thus creating an unprecedented audience for the Java software.
Soon programmers from all over the globe flooded the Java website to download the new platform. Sun completely underestimated the platform’s popularity and struggled to increase bandwidth to cope with the rush. Java had arrived.
Development of the Java platform has continued ever since. As the years have passed, it has been expanded to include a number of technologies, such as JSP and XML. Interface components have been rewritten as Swing. The overall platform has been expanded to meet database and security needs. Each new release brings new supporting technology.
Despite Java’s complexity, one of its great attractions continues to be Gosling’s original design. The syntax remains elegant, the development effort proves much easier than it is in many other languages, and the work of documenting and debugging is much more straightforward.
What Is Java?
Java is an object-oriented programming language that you compile to byte code that runs on a virtual machine. In this respect, it differs from traditional programming languages such as C. The C programming language remains a strong foundation language, but it is also a procedural programming language (based on functions). C++ is the object-oriented precursor of Java, but to develop with C++, programmers compile their code directly to a specific operating system. (Microsoft has changed this picture with managed C++.)
ANSI-compliant C++ makes it possible to port code from one operating system to another with relative ease, but programs still must be recompiled as you move them from operating system to operating system. With Java, programmers can either compile or interpret code.
As Figure illustrates, the initial compile phase translates your source code (*.java files) into an intermediate language called Java bytecode (*.class files). The resulting bytecode is then ready to be executed (interpreted) within a special virtual computer known as the Java
Virtual Machine (JVM).
The JVM is a simulated computer that executes bytecode instructions. It acts as a consistent layer between bytecode and the actual machine instructions. Bytecode instructions are translated into machine-specific instructions by the JVM at runtime. This enables programmers to write one program and run it on different operating systems without having to engage in extensive rewriting (porting) work.
The expression often used to sum up the work of the JVM is ‘‘Write once, run anywhere.’’ As Figure 1.4 illustrates, the target platform for a Java program requires only a JVM. Sun provides a JVM specific to each platform (or operating system), and after the JVM is installed, the Java program can run in it regardless of which environment it was developed in.
Running a Java program remains elementary. Developing a Java program involves a bit more activity. You need more than just a programming language; you need a programming platform. The Java platform is made up of three significant components :
- The Java Development Kit
- The Java Virtual Machine
- The Java Application Programming Interface
The Java Development Kit (JDK) is the general name for the entire suite of tools that allows you to develop with Java. Central to this are the compiler and its associated tools. As mentioned previously, the role of the JVM is to provide an interface to the operating system of the underlying device. The Java API provides a limited view of the operating system to the Java program. This makes the JVM the judge, jury, and executor of program code.
The Java API is a collection of Java classes covering a vast range of functionality including containers, data management, communications, IO, and security. There are close to a thousand basic classes available as part of the Java API. Secondary developers provide thousands more that extend and specialize the API.
Multiple Editions
The Java language has evolved over the years. The first major edition, now known as the Java 2 Standard Edition (J2SE) was aimed at the development of GUIs, applets, and other standalone applications. A few years ago Sun expanded the Java suite with the Java 2 Enterprise Edition (J2EE), which was built for use in server-side development. This version included expanded tools for database access, messaging, content rendering, inter-process communications, and
transaction control.
Sun didn’t stop there, though. Desperate to satisfy every programmer on the planet, Sun set its sights on handheld or portable devices. The version of Java Sun designed for these devices is designated Java 2 Micro Edition (J2ME). The current version of Java has been incremented beyond the first release, so Sun often refers to it simply as Java ME.
Mobile Information Devices Everywhere
Mobile information devices are generally small enough to carry in your pocket or purse. The most popular such devices are cell phones, iPods, and iPhones. Sun manufactures special versions of its Java virtual machine to allow your Java programs to execute on such devices. Since such devices are available in every description, the virtual machine approach to application deployment enjoys the same advantage with MIDs that it enjoys with the Internet. You can write an application on one operating system and deploy it to many others.
The purpose of portable Java programs is often to provide an interface for the user. Device manufacturers create operating systems that manage such things as games, telecommunications, or music. The user of such devices browses the Internet, answers a phone call, receives a text message, manages and selects tunes, or plays games. The games you find on such devices are often fairly basic, but with each new day, as the memory, speed, and virtual machine profiles of the devices improve, the software built to run on them increases in complexity.
Applications once considered too large for portable devices are now becoming common features of them.What is significant about this is the sheermagnitude of the market calling for this transformation. Cell phone manufacturers deal with a market that includes billions of possible users. Cell phones are so inexpensive that they are often given away as part of a telecommunications package. The device becomes trivial. The interface and services become much more significant. What applies to cell phones applies in general to all mobile devices. As the hardware decreases in significance, the software and services become more important.
It is generally not at all unreasonable to imagine a world (of over six billion people to date) in which everyone from childhood on is equipped with one or two portable devices. Picture a cell phone and an iPod to start with. In time these might be merged into a single device (like the BlackBerry or iPhone), but the general market for applications to run on such devices remains the same.
As a slight digression, it is important to remember that mobile devices often have very specific and somewhat humble market niches. Consider, for example, a device that is responsible for monitoring the output of a microtransmitter embedded in an automobile tire. By pressing a few buttons, a mechanic can see the tread depth and tire pressure of the tire. This basic information is then fed to a PC with an Internet connection. Someone in a back office can then monitor the status of the tire. This technology can be extended to the shoes of runners in a marathon. If a transmitter is clipped to each running shoe, as runners run by given auditing points, their names and times can be fed into a central database and displayed on a website. All the applications involved might be developed with Java. All involve MID development.
Micro Devices and Software
MIDs are often referred to as micro devices. As you will see in Chapter 2, the support for such micro devices broadens as different devices come into the picture. Figure overhead shows several categories of micro devices.
Generally, large corporations can afford (at least to an extent) to create and deploy proprietary development platforms for the devices they produce. In most cases, Java ME provides you with the ability to make use of some of the features of the proprietary development platforms. To use some of these development platforms, you must pay a license fee. In other cases, you can obtain the software for free, but you must integrate software modules with your Java code.
Over the past two decades, micro-device manufacturers have provided programmers and other content creators with various sets of tools to build software applications. This approach to development has met with greater and lesser degrees of success. Generally, the trend now favors open approaches like Java,
and almost every major device manufacturer has made a strong effort to incorporate Java ME. The tendency in this respect is toward standardization of hardware and software. Device manufacturers realize that their surest path to the broadest market is through the interoperability Java provides.
some of the categories into which proprietary efforts have fallen.
Conclusion
With millions of programmers and worldwide distribution, Java is an enormously popular development platform. As a language, it is easy to learn. Given the extraordinary store of libraries and other supplements that exist for Java, mastery of it is probably no longer a possibility for any lone individual. Still, if you can learn how to work with the basic development environment, whether itis the general JDK or a specialized version of the JDK such as Java ME, you are probably on your way to a lifetime of work.
Developing software for portable devices is one of the key areas of development for Java programmers. The programs they produce often center on user interfaces, which vary according to the device on which the interface is deployed and the market the device manufacturer or service provider targets. One of Java’s strengths is that it allows developers to provide software that is both portable and safe for deployment on different devices.
Warmes Regards !
Soure : Thomson Course Technology PTR, a division of Thomson Learning Inc. book of Java™ ME Game Programming second edition by John P. Flynt, Ph.D., and Martin J. Wells
3 komentar:
kita juga punya nih artikel mengenai 'TOPIK KALIAN',
silahkan dikunjungi dan dibaca , berikut linknya
http://repository.gunadarma.ac.id/bitstream/123456789/4242/1/DOKUMEN%20PRESENTASI.pdf
terimakasih
wah halaman yang bagus dan artikel yang sangat baik . saya senang bisa menemukan halaman ini , artikelnya sangat menarik . di tunggu postingan berikutnya .Salam
Really nice blog post.provided a helpful information.I hope that you will post more updates like this Ruby on rails Online Training
Posting Komentar