日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Building a Crosswalk application

發(fā)布時間:2023/12/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Building a Crosswalk application 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

原文訪問實在太慢,轉(zhuǎn)載到這里方便訪問。

Building a Crosswalk application

Crosswalk is a runtime for HTML5 applications. This means that any existing HTML5 applications should run on Crosswalk, providing they already run in a modern browser (Chrome, Firefox, Safari).

For the purposes of this tutorial, we use the simplest possible Crosswalk application: one HTML file.

However, because Crosswalk applications are intended to integrate well with the target environment, they require an additional file, manifest.json , containing metadata for that purpose. The manifest can be used to specify icons to use at different resolutions, set an app description, adjust content security policy settings, and otherwise configure how the app integrates with the target environment.

A simple application

1.First, create a directory called xwalk-simple for the project:

> mkdir xwalk-simple/ > cd xwalk-simple/

2.Next, copy an icon file to that directory, to serve as the application icon. You can use this icon:

To use this example, right click on the image and select Save Image As… (or its equivalent in your browser). Save it into the xwalk-simple directory as icon.ico. (Note that this image is from the Crosswalk source code and is BSD licensed.)

If you have your own favourite icon, copy that to the xwalk-simple directory instead. It should be 96 pixels square or larger.

3.Create two text files inside xwalk-simple. (Create them using any text editor, such as Notepad.):

  • index.html

This is a single HTML file which represents the user interface for the application. For the purposes of this tutorial, we are not using any CSS or JavaScript.

The content should be:

<!DOCTYPE html> <html><head><meta name="viewport"content="width=device-width, initial-scale=1.0"><meta charset="utf-8"><title>simple</title></head><body><p>hello world</p></body> </html>
  • manifest.json

This contains the application metadata (see above).

The content should be:

{"name": "simple","xwalk_package_id": "com.app.simple","xwalk_version": "0.0.1","start_url": "index.html","icons": [{"src": "icon.ico","sizes": "96x96","type": "image/vnd.microsoft.icon","density": "4.0"}] }

See the manifest documentation for more information.

4.From inside the xwalk-simple directory, run:

> crosswalk-pkg --platforms=windows .

The crosswalk-pkg command above can be run from any location by putting the path to your project directory as the last parameter.

This will download the Crosswalk libraries, package the application defined in the specified manifest.json file and produce an .msi (in our example com.app.simple-0.1.0.0.msi). The .msi is currently a 64-bit build of Crosswalk for Windows and will only run on 64-bit Windows. Once you’ve done this, you’re ready to run the application on a target.

What’s next?

Run on Windows

總結(jié)

以上是生活随笔為你收集整理的Building a Crosswalk application的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。