简体   繁体   English

如何正确使用Phonegap

[英]How to use Phonegap properly

I have worked a lot to install Phonegap in my computer with Android. 为了在Android电脑上安装Phonegap,我做了很多工作。 Now I have the Android SDK and everything is fine. 现在我有了Android SDK,一切都很好。 But I have looked for a way to check my app in Android and apparently I don't need the Android SDK. 但是我一直在寻找一种方法来检查我在Android中的应用,显然我不需要Android SDK。 I have seen, that you just have to use the webpage of phonegap build. 我已经看到,您只需要使用phonegap构建的网页即可。 So now I ask me, "why did I install Android SDK, Eclipse, JDK, Ant, and all that stuff? 所以现在我问我:“为什么要安装Android SDK,Eclipse,JDK,Ant等所有东西?

I would like to know what's better, use the phonegap build webpage or use the Android SDK with Eclipse, which emulator by the way, is very very slow. 我想知道有什么更好的方法,使用phonegap构建网页或将Android SDK与Eclipse配合使用,顺便说一句,模拟器非常慢。 I cannot work with it. 我不能使用它。

And in addition, I would like to know how to check my updates in the Android App with the SDK. 另外,我想知道如何使用SDK在Android App中检查我的更新。 I mean, if I use the Phonegap phone app it updates in real time, but I would like to know how to check it manually with Eclipse, because I suppose that I got to build it or something like that. 我的意思是,如果我使用Phonegap电话应用程序,它会实时更新,但是我想知道如何使用Eclipse手动检查它,因为我想我必须构建它或类似的东西。

Greetings and thanks. 问候和感谢。

Even if you use Phonegap build to compile and generate your APK, you will need some IDE or TextEditor to code ie to write your js and css files. 即使您使用Phonegap构建来编译和生成APK,也需要使用一些IDE或TextEditor进行编码,即编写js和CSS文件。 So using an IDE such as Eclipse or text editor such as SublimeText is recommended. 因此,建议使用诸如Eclipse之类的IDE或诸如SublimeText之类的文本编辑器。 Plus in case of phonegap you might come across situations when you will need to access device api's and for that you would have to use plugins. 另外,在使用phonegap的情况下,您可能会遇到需要访问设备api的情况,为此您必须使用插件。 Plugins are coded in Java ie for android framework, so using it in Eclipse along with Android SDK is needed to edit code in proper way, as android coding is best with SDK support on eclipse or studio. 插件是用Java编码的,即适用于android框架,因此需要在Eclipse中将其与Android SDK一起使用,以便以正确的方式编辑代码,因为android编码最好在Eclipse或Studio上获得SDK支持。 Also for accessing third party api's such as PayPal, you will need to add their phonegap sdk to your code and plugins too. 同样,为了访问第三方API(例如PayPal),您也需要将其phonegap sdk添加到代码和插件中。 So using IDE is helpful and necessary. 因此,使用IDE既有用又必要。 Also by using eclipse, you can edit your Manifest and other resources to be used by your application, and access features such as code suggestions and error debugging if any. 同样,通过使用eclipse,您可以编辑清单和供应用程序使用的其他资源,并访问功能,例如代码建议和错误调试(如果有)。 Both are not available in phonegap build. 两者在phonegap构建中均不可用。

Incase of emulator being slow, use Genymotion emulator. 如果模拟器运行缓慢,请使用Genymotion模拟器。 It is many many many times faster than emulator with sdk and has more options and features. 它比使用sdk的仿真器快许多许多倍,并且具有更多的选项和功能。 It can be linked to SDK ie eclipse via a plugin. 它可以通过插件链接到SDK,即eclipse。

Hope this helps and clears your doubts :) 希望这有助于消除您的疑虑:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM