Firefox OS itself and all of its above applications use HTML5 technical standards. For developers familiar with HTML, JS, and CSS technologies, the process of developing a Firefox OS application is very simple. The difference is that Firefox OS has some characteristics suitable for mobile devices, such as dialing, sending and receiving text messages, 3G and Wi-Fi network connections. Fortunately, these functions can be called very easily, just like calling common JS components, you can control JS objects. Mozilla is also communicating with W3C standards development organizations to add these features developed by itself to HTML5 technical standards.
The following describes two methods for publishing the Firefox OS application:
1. Before GAIA compilation, move your test app to the apps folder under the GAIA directory and execute the make command.
In this method, your test application can be flushed into the B2G device or run in the computer desktop simulator.
2. Publish your application to the network server for online installation. But the trouble is that you need to submit your application to the mozilla Application market and install it after the application is approved, or write your own APP installation page, and then install it through this page.
Next we will use a very simple DEMO to illustrate how to develop the Firefox OS application.
1. Create a folder named appdemo as the project root directory TIPS: the folder name must be a lowercase letter)
2. In the appdemodirectory, create index.html and COPY the following content:
- <!DOCTYPE html>
-
-
-
-
-
- <meta charset="utf-8" />
-
-
-
- <body>
-
- Welcome to visit:Mozfans.com
-
- </body>
-
-
3. Create a manifest. webapp file under the appdemo directory and COPY the following content:
- {
-
- "name": "Firefox OS App Tester",
-
- "launch_path": "/index.html",
-
- "developer": {
-
- "name": "chy",
-
- "url": "http://www.mozifans.com"
-
- },
-
- "appcache_path": "/cache.manifest",
-
- "fullscreen": "true",
-
- "icons": {
-
- "120": "/source/appdemo.png"
-
- },
-
- "permissions": [
-
- ]
-
- }
Bytes
5. Release. Here I use the first method mentioned above to put the entire appdemo folder under the apps directory of the gaia folder. Recompile your GAIA source code and run the desktop simulator. On the simulator page, you will see your published application.
Source code download: http://chyblog-chyblog.stor.sinaapp.com/wp-content/uploads/2012/09/testapp.zip
Effect:
Running result: