使用Phonegap作为Rails 3应用程序的本机容器 [英] Using Phonegap as a native container for a Rails 3 App

查看:127
本文介绍了使用Phonegap作为Rails 3应用程序的本机容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PhoneGap为iOS应用程式,以便我可以利用相机API。计划是使用Rails来管理整个体验。在这一点上,我并不特别关注性能。如果不是因为需要相机,我会简单地将它设计为一​​个真正的网络应用程序。

I'm looking into using PhoneGap for an iOS app so that I can utilize the camera API. The plan is to use Rails to manage the entire experience. At this point, I'm not particularly concerned about performance. If it wasn't for the need for the camera, I would simply design it as a true web app.

我发现的大多数答案和教程建议使用ajax到后端服务器来渲染前端。在应用程序开发的这一步,我不确定我想在JS中构建这么多的视图,并且更喜欢使用Rails来呈现视图。我已经看到了几个非常简短的参考,使用PhoneGap作为容器,以字面上渲染Rails应用程序。除了性能,这是可能的,我将如何在PhoneGap中设置核心html文件,让移动应用程序正常运行?

Most of the answers and tutorials I have found suggest using ajax to the backend server to render the frontend. At this point in the app development, I'm not sure I want to build so much of the view in JS and would prefer to use Rails to render the views. I have seen a few very brief references to use PhoneGap as a container to literally render the Rails app. Performance aside, is this possible and how would I set up the core html file in PhoneGap to let the mobile app run normally?

推荐答案

我不相信这样的容器存在于客户端运行,但可以动态服务PhoneGap应用程序(即应用程序充当本地功能可通过JavaScript命令的Web浏览器)。

I do not believe such a container exists to run on the client side but it is possible to dynamically serve a PhoneGap app (i.e. the app acts as a web browser with native functionality available via javascript commands).

这里是一个代码,用于说明您正在描述的内容。

Here is code which demonstrate exactly what you are describing.

这里是我与演示相关联的屏幕投射。

Here is a screen cast I did associated with demo.

注意:演示使用了一个out 3.2.1,和最新版本的Xcode和/或PhoneGap破碎,但它是可能的,和这种性质的应用程序在各种应用商店中有效( Linkedin a>与许多其他人已经在做它。)逻辑是我只是没有时间来修复与新版本的Xcode的bug,或更新PhoneGap代码(做更新可能实际上修复一个错误快速工作会话)。

NOTE: The demo is using an out 3.2.1, and is broken as of the latest version Xcode and/or PhoneGap but it is possible, and apps of this nature are valid in the the various app stores, (Linkedin alongwith many others are already doing it.) The logic is there I just haven't had the time to fix the bug with the new version of Xcode, or update the PhoneGap code (doing the update may actually fix the bug in one quick work session).

这篇关于使用Phonegap作为Rails 3应用程序的本机容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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