PhoneGap官网翻译 开发中常见问题文档

移动开发
本文翻译自PhoneGap官方网站常见问题解答,PhoneGap官方网站对开发的常见问题进行了充分的解答,如果您英文不好可以参看本文。

Q. I have an issue with PhoneGap for iOS?

A. See “PhoneGap for iOS FAQ”

问:对于iOS PhoneGap我有一个问题?

答:请参考“iOS PhoneGap常见问题”。

Q. Do I need to “Jailbreak” my iphone to use iPhone PhoneGap?

A. No.

问:我需要“Jailbreak”我的iphone去使用iPhone PhoneGap吗?

答:不需要。

Q. What PhoneGap apps are available in the iPhone store?

A. projects

问题:在iPhone 商店里面什么样的PhoneGap应用程序可以使用?

答案:项目

Q. How do you change the default PhoneGap loading screen?

A. Change the default.png file to one of your liking.

问:如何更改PhoneGap默认的载入画面?

答:将default.png文件改成你喜欢的图片。

Q. I get errors while building my iPhone app in Xcode.

A. See the known problems & solutions.

问:当我在Xcode上生成我的iPhone应用程序时,遇到了一个错误。

答:请参考 已知问题和解决方案。

Q. What’s this I hear about Apple rejecting PhoneGap apps? Will my app get rejected?

A. Of course, Apple always has the final say. As of version 0.8, PhoneGap apps should be okay. (or PDF) Also, Apple has done a technical review, and PhoneGap apps should be ok and each app will be judged on its own merits.

问:我听说Apple拒绝PhoneGap的应用程序,我的应用程序会被拒绝吗?

答:当然,苹果拥有最终的决定权。0.8版的PhoneGap应用程序应该是没有问题的(或者PDF),此外,Apple已经做了技术审查,并且PhoneGap应用程序是没有问题的, each app will be judged on its own merits.

Q. I’m using navigator.geolocation on the iPhone, why does it show a popup alert with a funny url to my index.html file?

A. On iPhone OS 3.x, UIWebView’s navigator.geolocation takes over, which will use the native Javascript API for it. This shows the warning and the location of the page asking for the location permission. Discussion here.

The latest solution for iPhone OS 4.x and PhoneGap 0.9.x is to follow the example of the docs for and add an event listener that waits for the device to be ready, otherwise the native navigator.geolocation is used and you get an alert like this: “var/mobile/Applications/UUID/appname.app/www/index.html” Would Like To Use Your Current Location.

问:我在iPhone上使用navigator.geolocation,为什么会弹出有一个奇怪的url到指向我的index.html文件的提示? (为什么会弹出一个指向我的index.html文件的奇怪的url的提示?)

答:在iPhone OS 3.x中,UIWebView中的navigator.geolocation将会使用本地的Javascript API来接管他,这样就会出现警告,并且要求页面所在的路径有权限。这里有讨论。

Q. Why do the iPhone PhoneGap functions not work when navigating to another local html file from index.html?

A. See this bug for discussion.

问:当从index.html导航到其他本地的html文件时,为什么iPhone PhoneGap功能不能运行?

答:请参考这里对错误的讨论。

Q. Can I just create an iPhone PhoneGap-based app that just loads my website?

A.You can, but as for Apple approving it, that’s another matter, and they most likely won’t. As a rule of thumb, if there is no Internet connection, you must at least load the UI (your views) without the corresponding data, and put an error notice to that effect. Therefore your app must have these views included in it. For a guideline, set your iPhone to Airplane Mode in the Settings, then load either the Maps, Weather, Youtube, ITunes or Facebook apps, and see what they do (have a “shell”). Apple is probably concerned about them approving your app based on your app description and functionality as promised by you, and then you turning around and changing it completely after approval to something undesirable.

问:我可以创建一个iPhone PhoneGap-based 应用程序只加载我的网站吗?

答: 可以,但是要被Apple批准,那就是另外一件事情 (这是另一回事) ,他们很有可能不会。根据经验,如果没有连接互联网,你必须加载UI(你的意见)没有相应的数据,会产生一个错误提示。因此,你的应用程序必须有这些包含它的意见。有一个规定,在你的配置中将你的iPhone设置为Airplane模式,然后无论是加载地图,天气,原链接、Itunes或者Facebook应用程序,看看他们做了什么(有一个“shell”)。Apple可能关心 批准你许诺你的应用程序的描述和功能,在批准以后,你将他完全修改一些不可取的内容。

Q. Is the Edge version “safe” to use, since its architecture has evolved? Apple has “approved” only 0.8.0 right, so will using anything else be unsafe?

A. The architecture has evolved only externally to make it easier to develop for, and easier to deploy for users (so if we update the core code, users will not have to integrate it in to their existing code, a big hassle with 0.8.0 and lower). Internally everything is the same, the way we handle commands, etc.

If you are looking for assurances of ultimate safety, there will be none, since Apple can change their mind no matter what they said before. We have never submitted anything to Apple to validate, they are the ones that chose to do so with the last version (a security review), and with any upcoming versions, it will be their decision ultimately.

问:Edge 版本是可以“安全”使用,因为它的架构已经演变了?Apple只“批准”0.8.0的版权,因此使用任何东西都是不安全的?

答:已经演变的架构只是外部使用户更容易开发、部署(因此如果我们修改核心代码,用户将不会与他们现在有的代码进行集成,0.8.0版本和更低的版本都会遇到这个大问题)内部任何事情都是一样的,我们处理命令的方式,等等。

如果你正在寻找最终的安全保证,没有。因为在Apple在没有说任何问题之前,他可以改变主意。我们从来没有提交过任何事情让Apple去验证,他们一旦选择这样做了,***的版本(a security review),和任何即将到来的版本,将成为他们最终的决定。

Q. I want to create an application for phonegap to access externally deployed web services via AJAX. How can i resolve the issue with the cross-domain security policy of XmlHttpRequest?

A. The cross-domain security policy does not affect PhoneGap applications. Since the html files are called by webkit with the file:// protocol, the security policy does not apply.

(in Android,you may grant android.permission.INTERNET to your app by edit the AndroidManifest.xml)

问:我要创建一个通过Ajax访问PhoneGap外部部署的Web服务应用程序,我怎样解决XmlHttpRequest的跨域的安全策略?

答:跨域安全策略不会影响PhoneGap应用。由于html文件被webkit用 file:// protocol,安全策略并不适用。

责任编辑:佚名 来源: phonegapcn
相关推荐

2011-10-11 09:03:57

常见问题PhoneGap

2010-05-12 17:04:20

BlackBerry开

2011-01-21 14:13:10

2010-04-06 17:26:26

Windows Pho

2010-08-10 15:09:55

Flex开发

2011-04-08 13:58:52

JavaJSP

2011-09-13 14:40:16

PhoneGap AP

2011-09-13 13:47:56

PhoneGap AP

2011-09-13 16:08:58

PhoneGap AP

2010-08-31 13:49:12

CSS

2011-09-13 10:17:26

PhoneGap AP

2011-09-13 10:40:25

PhoneGap AP

2011-09-13 11:06:08

PhoneGap AP

2011-09-13 14:07:45

PhoneGap AP

2009-06-30 16:03:00

异常Java

2012-03-06 08:47:40

Corona

2020-10-18 12:00:27

前端开发架构

2010-09-07 09:50:35

DIVCSS

2011-05-13 14:56:44

SybaseOracle

2010-08-17 11:35:46

DIV CSS
点赞
收藏

51CTO技术栈公众号