PhoneGap:可以只使用phonegap.js,它的功能只在一个网站(不希望一个应用程序只有一个网页)? [英] PhoneGap: It's possible to use only the phonegap.js and it's functions only in a Website (doesn't want an App only a Webpage)?

查看:147
本文介绍了PhoneGap:可以只使用phonegap.js,它的功能只在一个网站(不希望一个应用程序只有一个网页)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎我还没有正确地理解PhoneGap的工作原理。
我认为:
使用 index.html ,将 PhoneGap.js 包含在 中作为JavaScript类型并打开在iPad / iPhone上的结果。

It seems that I haven't understood correctly how PhoneGap works. I thought: Take an index.html, include the PhoneGap.js in as type of JavaScript and open the result on iPad/iPhone.

但是,加速度计,哔哔声,振动()是否有必要构建一个应用程序,使其正常工作?

But then, none of the functions like accelerometer, beep(), vibrate() is working. Is it necessary to build an app for that for working correctly?

我有一个网页,我想只包括PhoneGap的功能,以便iPad可以识别是否

I have a Webpage and I want only include the functions of PhoneGap so that the iPad can recognize if it was shaken or a draggable HTML Element was touched and thrown at an other place on screen.

是sencha能够执行的动作

Is sencha able to do that and is it the better choice?

Greetz和谢谢!

Greetz and Thanks!

Markus

推荐答案

PhoneGap是各种不同手机平台的本地应用程序包装器。 要求您使用PhoneGap框架,该框架是针对每个支持的平台的本地代码编写的,用于您定位的任何平台,并允许您将HTML,CSS和JS资源拖放到此框架中,以便您可以为仅使用这些Web技术的手机构建应用程序。

PhoneGap is a native application wrapper for a variety of different phone platforms. It requires that you use the PhoneGap framework, which is written in native code for each supported platform, for whatever platform you are targeting, and allows you to drop HTML, CSS and JS assets into this framework so that you can build applications for a phone with only those web technologies.

只需在服务器上托管的网站上安装phonegap.js就无法工作,因为phonegap.js与(本地)PhoneGap框架代码通信。框架代码执行访问手机的API的振动,加速度计,联系人和罗盘功能(等等)的工作。 phonegap.js只是在JavaScript中提供一个一致的API来访问这个本地设备功能。

Simply including phonegap.js on a web site that is hosted on a server will not work, because phonegap.js communicates with the (native) PhoneGap framework code. The framework code does the work of accessing the phone's APIs for vibrate, accelerometer, contacts and compass functionality (among others). phonegap.js simply provides a consistent API in JavaScript for accessing this native device functionality.

这篇关于PhoneGap:可以只使用phonegap.js,它的功能只在一个网站(不希望一个应用程序只有一个网页)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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