With the development of mobile terminal devices, Apple is gaining momentum in the mobile Internet electronic product field, and Google is also making great efforts. The competition between iPhone and Android products of the two giants is booming. Mobile app development based on these two platforms is also in full swing. Recently, I have the opportunity to start some pre-research work on mobile Flash lite technology and try to explore the development of mobile phone applications on another technical level.
It focuses on some technical differences between Flash Lite running on mobile phones and computers. Because Flash Lite runs on mobile phones, hardware performance and network transmission speed must be considered in particular. Therefore, some functions are reduced relative to Flash. For example, filters that occupy memory, consume CPU for graphic color operations, and hybrid mode. If Flash Lite is primarily used for interactive applications, the reduction of these visual enhancement functions will not have a great impact on program development. What makes developers feel troublesome is, some standard UI controls with better functions in Flash cannot be directly used in Flash Lite, such as ComboBox and DataGrid. during development, you need to write code for Flash Lite to encapsulate the simplified UI control.
Some notable features of Flash Lite mobile app development are mainly reflected in the following aspects:
1. the AS 2.0 script is still used. Currently, the highest version of Flash lite 3x Player is also developed based on Flash Player 7, and the Flash programming language AS 3.0 has been released for nearly three years, the current Player version has been updated to Flash Player 10.
When Flash Lite was launched a few years ago, there were few researchers due to insufficient support for mobile terminals. Although the platform's support rate has improved significantly, the development and running environments of Flash Lite are still far behind, many developers feel that there is no research value, leading to a relatively low level of application and a relatively small amount of research materials. Currently, many applications are used in standalone games, and few cases are used for network interconnection applications. However, this also reflects the development potential of Flash Lite. The development of wireless Internet should be similar to that of the early development model of wired Internet. In the initial stage, due to the limitations of network speed conditions and hardware platforms, the materials used are saved text and small images. Applications and games are dominated by local installation files; with the improvement of the network environment and the upgrade of hardware, multimedia materials such as sound and light movies will gradually occupy the mobile Internet, and various network-based applications and games will emerge more. Adobe has always paid great attention to the cross-platform development of Flash. I believe that no matter which type of mobile phone OS will win in the future, it will directly upgrade Flash Lite or Flash. Note: after this article is complete, Adobe has released the latest version for google mobile Android system Flash10.1) to provide support. From the current development of Flash in the wired Internet, we can foresee the future of Flash Lite in wireless networks.
2. Flash Lite provides interfaces for some special functions of mobile phone devices.
For example, you can provide Interface Support for most dialing buttons, navigation keys, and left and right function keys on your mobile phone. You can control the interaction process by listening to button events and setting responses; provides interfaces to read information about some devices on the mobile phone, such as battery, signal strength, volume, remaining memory, access network type, backlight frequency, and vibration mode, you can call and send text messages through Flash Lite. However, due to security concerns, there are also a lot of restrictions. Many device interfaces Flash Lite cannot be called directly, such as reading and writing text messages, address book data, and mobile phone disks. However, in the latest Flash Lite3.1 upgrade, The ActionScript Extension function is added. Flash Lite developers can use the DLL through the ActionScript API, the DLL file is used to interact with the APIS published by the host device. In this way, the call to the API of the operating system of the mobile phone device comes from the official documentation and has not been compiled for testing ).
3. The Sandbox security model is stricter.
In the Flash Lite2.0 era, local Flash Lite can communicate with the network. It is completely feasible to use the Flash Lite compilation file downloaded to the mobile phone as a client program for network interaction. From Flash Lite 3.0 onwards, the local Flash Lite files on the mobile phone memory card can only load file data on the mobile phone and cannot communicate with the network in any way; the Flash Lite files published through the network accessed by a browser can only communicate with the data in the network and cannot load local data on the mobile phone. The Sandbox Model is based on the Flash Lite Player version installed on the terminal mobile phone. For example, if the Flash Lite2 SWF file is published and played in the Flash Lite3 player, the security model of Flash Lite3 is followed, so developers cannot decide which security model their programs will run. This is also a dialectical philosophy of trade-offs. a stricter security model limits certain functions and closes the possibility channels for some technical applications, but it can win the trust of users, it is conducive to the further promotion and development of technologies.
4. Focus on Flash Lite network communication technologies.
In compliance with the sandbox security model, both Flash Lite and Flash support network communication methods similar to the XMLHTTPRequest object in AJAX, the GET and POST methods are used to send and obtain data to the background program. In addition, the Remoting and Socket methods are also supported in Flash, currently, most games developed using Flash technology adopt these two methods. Remoting is a technology that remotely calls the classes and Methods encapsulated on the server for data communication. You need to configure programs on the server to respond to client connections. Flash implements the Remoting client and uses the exclusive AMF format data to communicate with the server. In addition to the Adobe official technology, the server also implements the open-source version of Remoting AMF, for example, phpamf, rubyamf, and pyamf provide more comprehensive server support for Flash Remoting. Built-in support for Socket communication in Flash, during the exploration process, I tried to write a simple multi-client chat room model to familiarize myself with the communication process testing program and the source code. Download the server script provided by Ljian, a senior Python Development Engineer ). Note that some changes have taken place in the security policy of Socket network communication compared with Flash Player9 and Flash Player 10. In Flash Player9 and earlier Flash players, you only need to place an authorized XML security policy file in the target domain for cross-domain and Socket communication. However, this security policy file is only valid for HTTP Communication. The security policy file for Socket communication needs to be sent through Socket, by default, the player requests the policy file from Port 843 to the server in Socket mode. If no response is received, it tries to send the request to the listener port set in the Socket program code. Therefore, the corresponding solution needs to listen to port 843 in the server program, send the security policy file when receiving the Socket connection request, or directly send it in the listening port set by the Socket Client Connection Request. In the two advanced communication modes mentioned above, Flash Lite currently only supports real-time communication using XMLSocket. The data transmitted must be in XML format, which is relatively inefficient, whether or not the network environment can be applied to the actual project requires further investigation.
The development of wireless Internet product models, especially the rise of some Social Game games, will put forward higher requirements on the interactive experience of mobile apps and bring some opportunities for the development of mobile platform Flash technology. The development of Flash technology on the mobile platform depends on the active efforts of Adobe and requires constant exploration and attention from developers. Let's wait and see.