用于Android phonegap应用程序的cordova.js [英] cordova.js for android phonegap application

查看:101
本文介绍了用于Android phonegap应用程序的cordova.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发android应用程序,但无法找到cordova.js来检测事件.请帮我找到这个吗?我在Google代码库上尝试过,但没有用.

I am developing android app , but i can't able to find cordova.js to detect events . Please help me in finding this ? I tried on google code base , but they did not work .

推荐答案

如果您正在使用phonegap构建CLI实用程序(我发现这是最简单的方法),则无需包含cordova.js或phonegap.由phonegap构建实用程序自动添加的项目中www目录中的js文件.

If you are using phonegap build CLI utility (which I find is the easiest way), then you don't need to include the cordova.js or phonegap.js files manually in the www directory in the project as they are added by the phonegap build utility automatically.

您确实需要在所有html文件中添加以下内容:

You do need to add the following though in all html files:

<script type="text/javascript" charset="utf-8" src="cordova.js"></script>

就电话间隙功能而言,您可能需要安装一些插件,如

As far as phonegap functionality is concerned, you might need to instal some plugins as described here.

例如,如果要添加加速度计功能,则必须在phonegap项目目录中输入以下命令:

For example if you want to add the accelerometer functionality you would have to enter the following command while in the phonegap project directory:

$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git

这篇关于用于Android phonegap应用程序的cordova.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆