创建网站的移动版本

发布于 2024-08-17 08:53:57 字数 386 浏览 4 评论 0原文

我正在寻找创建我们网站/网络应用程序的移动版本。有什么好方法可以提供最好的、功能最全的版本。

创建它的部分原因是而不是 iPhone 应用程序,所以我想提供一个 iPhone Web 应用程序,充分利用 iPhone 版本的 WebKit(因此 CSS 动画,能够依赖良好的 javascript 支持等) 。不过,我还希望该网站能够在其他智能手机以及更基本的手机上正常运行。

我是否创建两个站点(Mobile WebKit 和基本移动 Web)并基于用户代理进行重定向?我可以创建一个性能良好的网站吗?有哪些可能性,其他人如何处理?

另外:移动网络模拟器值得吗?我有一部 iPhone,所以可以轻松测试。如果我想在 Blackberry/Palm Pre 上进行测试,我真的需要设备吗?或者有可靠的模拟器吗?

I'm looking to create a mobile version of our website/web app. What's a good way to provide the best, most fully featured version.

Part of the reason for creating it is instead of an iPhone app, so I'd like to offer an iPhone web app that takes full advantage of the iPhone's version of WebKit (so CSS animations, being able to rely on good javascript support etc). However, I'd also like the site to work well on other smart phones as well as more basic mobile phones as well.

Do I create two sites (Mobile WebKit and basic mobile web) and redirect based on User Agent? Can I create one site that degrades well? What are the possibilities, and how do other people handle it?

Also: are mobile web simulators worth a damn? I have an iPhone, so can test easily on that. If I want to test on Blackberry/Palm Pre do I really need a device or are there reliable simulators?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天涯沦落人 2024-08-24 08:53:57

以下是一些特定于 iPhone 的库,它们在 webkit 上提供了原生外观:

让其在大多数手机上运行对于大多数库来说肯定是一个问题,因为它们是构建的考虑到 iPhone 的屏幕尺寸(320x480)

要获得更广泛的设备覆盖范围(包括 Android 和 J2ME 手机),请查看 Yahoo Blueprint。它是一种可针对各种平台和设备进行翻译的标记语言。

您可以通过在吐出页面时动态切换服务器上的样式表来获取基于用户代理的移动视图。不过,对于重型页面,这不是推荐的方法,因为您仍然会发送大量不会呈现的数据。或者,如果您的视图有明确的分离,您可以根据用户代理和/或其他参数对视图进行模板化。这样做的优点是可以将控制器逻辑保留在一个位置,而只需更改视图。您可以将上述库用于 iPhone/iPod Touch,并切换到其他智能手机的更简单的移动版本,或者根据需要进行调整。

当发生变化时,创建单独的网站移动版本可能会非常难以维护。

iPhone 和 Android 模拟器与真实情况非常接近。出于显而易见的原因,iPhone 不允许您在模拟器上执行诸如拨打电话之类的操作,但 Android 为设备上的几乎所有内容提供了模拟实现。

These are some of the iPhone specific libraries that provide a native look and feel on webkit:

Getting it to work on most phones will definitely be an issue with most libraries as they are built around with the iPhone's screen size (320x480) in mind.

To get a wider coverage of devices including Android and J2ME phones, checkout Yahoo Blueprint. It's a markup language that translates for various platforms and devices.

You could either get the mobile view based on User Agent by dynamically switching the stylesheet on your server when spitting the page. This is not a recommended approach though for heavy-duty pages as you will still be sending huge chunks of data that would not be rendered. Alternatively, if you have a clear separation of your views, you can templatize the view based on User Agent and/or other parameters. This has the advantage of keeping your controller logic in one place with only changing views. You could use the above libraries for iPhone/iPod Touch and switch to a simpler mobile version for other smartphones or tweak it as you want.

Creating a separate mobile version of the site can be painstakingly difficult to maintain when changes arise.

The iPhone and Android simulators are as close as it gets to the real deal. The iPhone won't let you do stuff like make calls on the simulator for obvious reasons, but the Android provides mock implementations for basically everything on the device.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文