将离线 html 应用程序和数据安装到 iPad 上
我正在考虑购买 iPad,并且想知道我将有哪些选择来开发供个人使用的应用程序......特别是我是否能够将其作为离线浏览器应用程序来完成。该应用程序目前作为 Android Java 应用程序存在;它与大型本地数据库(约 3MB)交互,并显示从本地存储的非常大的资源池(约 2GB)中提取的图像和文本。
我直接的问题是:
- 如何将文件(html/javascript、数据库、图像和文本)从 Windows PC 传输到 iPad 的存储中?对于 Android,这很简单,只需通过 USB 连接并使用 Windows 资源管理器即可。谷歌搜索表明,对于 iPad,我可能必须使用 Windows 上名为 DiskAid 的应用程序,但这要花费 25 美元,对于我的简单目的来说,这似乎有点贵。有免费的替代品吗?
- 文件安装到 iPad 上后,我将如何运行 html 应用程序?在 Android 上,这似乎是在浏览器的地址框中键入“file:///sdcard/MyBrowserAppFolder/mybrowserapp.htm”的问题。 iPad 浏览器是否以类似的方式工作?
I am contemplating buying an iPad and am wondering what options I will have for developing an app for personal use ... specifically whether I will be able to do it as an offline browser app. The app currently exists as an Android Java app; it interacts with a large local database (about 3MB) and displays images and text drawn from a very large pool of resources stored locally (about 2GB).
My immediate questions are:
- How would I get the files (html/javascript, database, images and text) transferred into the iPad's storage from a Windows PC? With Android this is a simple matter of hooking up via USB and using Windows Explorer. Googling suggests that for an iPad I might have to use an app on Windows called DiskAid, but this costs $25 which seems a bit steep for my simple purpose. Are there free alternatives?
- Once the files are installed on the iPad how would I run the html app? On Android this appears to be a matter of keying "file:///sdcard/MyBrowserAppFolder/mybrowserapp.htm" into the browser's address box. Does th iPad browser work in a similar way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
iOS 上运行的应用程序有两种基本类型。
移动设计的 Web 应用程序托管在服务器上并通过 Safari 或其他浏览器访问。
使用 Xcode 和通常 Objective-C 构建的本机应用程序。
对于后者,您可以使用phonegap 框架使用现有的html 和javascript 构建应用程序。
我个人的建议是花时间学习如何使用 Objective-C 编写代码。根据数据库的格式,导入结构和数据可能很简单。这需要投入时间,但我认为使用原生工具进行操作是 iOS 开发的最佳选择。我也处于同样的情况(PHP、VB.NET 和 Javascript 开发人员),只是决定花时间学习如何正确地做这件事。这是一个伟大的决定,现在简单到中等应用程序的开发时间只需要很少的时间。
There are two basic kinds of applications that run on iOS.
Mobile designed web applications that are hosted on a server and accessed through Safari or another browser.
Native applications built using Xcode and usually objective-c.
For the latter, you could use the phonegap framework to build an app using existing html and javascript.
My personal advice is to invest the time to learning how to code this up using objective-c. Depending on what format your db is in, importing the structure and data might be trivial. It will take an investment of time, but doing things using the native tools is the best choice for iOS development in my opinion. I was in the same situation (PHP, VB.NET and Javascript developer) and just decided to take the time and learn to do it right. This was a great decision and the development time of a simple to moderate application takes very little time now.
iOS 上的 Safari 本身不支持
file://
类型的 URL。因此,您要么编写自己的应用程序,购买应用程序,要么使用类似或者,如果您可以验证您提到的应用程序是否可以执行您想要执行的操作,那么 25 美元也许并不是一个很高的价格。取决于您的时间价值:)
不过,有一些更便宜的应用程序允许通过 wifi 和 USB 传输和读取 html。 (不确定我可以在这里命名它们)
USB 传输又名
iTunes 文件共享
是开发人员可以在其应用程序的 info.plist 中启用的标准功能。许多应用程序使用它在计算机和 iDevice 之间传输数据。Safari on iOS does not support the URL's of type
file://
natively. So you either write your own app, purchase an app or use something like a local web server after jailbreaking.Alternatively, and if you can verify that the app you have mentioned does what you want to do, then maybe $25 is not so much of a price. Depends on what your time is worth :)
However there are cheaper apps around that allow to transfer and read html via wifi and usb. (Not sure I can name them here)
The USB transfer aka
iTunes Filesharing
is a standard function that a developer can enable in the info.plist of their app. Many apps use this to transfer data between Computer and iDevice.