Bruce Hopkins is the Chief Architect at Hopkins Technology and Research in Oak Park, MI (www.hopkinsTR.com). He has worked in Java for more than seven years, and has researched wireless networking for four years. He's the co-author of Bluetooth for Java (Berkeley, CA: Apress, 2003).
If you're a typical mobile application developer, then you've most likely used traditional programming languages (such as J2ME, C++, or BREW) to create your applications. However, over the past few years, Macromedia has been positioning Flash on mobile devices for applications and games. In the desktop browser market, Flash is succeeding Java and is allowing developers to create interactive Web sites.
What Exactly Is Flash?
If you have never created a Flash application, then you may be confused by all of the terminology flying around Flash developers. First of all, Flash is not a programming language. It's a specification. To create Flash applications (or "movies") in the Flash 7 format, you need a Flash Authoring Environment, which is currently either Flash MX 2004 or Flash Professional MX 2004. When using a Flash Authoring Environment, the native Flash applications are saved as .fla files. Compiling the .fla files produces a .swf file, much like when compiling a .java file that produces a .class file.
Also like Java, Flash needs a run-time on each platform where it must execute because the compiled .swf files are not native machine code to any platform. Of course, that's why your browser needs the Flash plug-in. It's the "Flash Virtual Machine" in Java-speak. On desktop operating systems, .fla files can be compiled into standalone executable files called "projector" files. For most mobile devices (such as the Nokia 9200 series of devices and the Sony CLIÈs), the Flash run-time is built into the operating system of the device. The PocketPC platform is the only Flash-capable mobile platform where you must download the Flash run-time separately.
Note: You can also use a tool called the "Flash Standalone Player for the PocketPC" to create .exe files for the PocketPC 2002 and 2003 operating systems.
Flash has a scripting environment called ActionScript (which is very much like JavaScript) where you can script actions and events based upon a button click or other events. If you want your Flash movie to connect to Java Database Connectivity (JDBC) databases, to SOAP Web services, or to make remote procedure calls, then you must implement Flash Remoting MX on the server-side. The Flash Communication Server is a useful tool if you want two or more users to communicate and collaborate with each other (such as in a chat room or in video conferencing). Macromedia Flex allows you to dynamically generate Flash movies on the server-side from a text file, much like Java Server Pages (JSPs) allow the dynamic generation of Java class files on the server-side from a text file. Finally, Macromedia Central allows you to download and run Flash content outside of the Web browser (just like with Java Web Start).
Table 1 summarizes the nomenclature for those who are new to Flash, and also compares the terms for those who are familiar with Java programming.
Table 1: Flash Versus Java Features and Terminology
Flash | Java | |
---|---|---|
Current desktop version | Flash 7.0 | J2SE 1.4.2 |
Runtime implementation | Flash Plug-in | Java Virtual Machine |
Authoring environment | Flash MX 2004, Flash Professional MX 2004 | JBuilder, Eclipse, text editors, and so on |
Uncompiled source file extension | .fla | .java |
Compiled runtime file extension | .swf | .class |
Scripting environment | ActionScript 2.0 | None |
Current version for PocketPC platform | 6.0 | J2ME CDC + Personal Profile 1.0 |
Compiler for native PocketPC executables | Flash Standalone Player | *No Equivalent* |
Technology for connecting to remote enterprise resources (databases, Web services, RPC) | Flash Remoting MX | J2EE 1.4 (JDBC, Java Web Services, Java RMI) |
Enterprise server for multimedia communications | Flash Communication Server | *No Equivalent* |
Technology for dynamically creating executables from text templates | Macromedia Flex | JSP |
Utility for network-based application deployments, with run-offline capability | Macromedia Central | Java Web Start |