用于Android phonegap应用程序的cordova.js

用于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