编写手机广播电台应用程序 - Javascript/HTML/CSS 可行吗,还是我们需要原生?

发布于 2024-09-27 11:14:04 字数 822 浏览 5 评论 0原文

我想编写一个应用程序,将 MP3 从服务器流式传输到美国三大主要智能手机操作系统(iPhone、黑莓和 Android)中的任何一个。

这是我关心的权衡:如果我原生编写应用程序,它将带来最佳的用户体验,并让我能够根据需要添加更多功能,但我将拥有 3 个独立的代码库,这违反了干原则。

如果我使用其中一个框架以 Javascript/HTML 编写它(例如 Rhomobile Rhodes),那么我有一个适用于所有主要平台的代码库,所以我没有违反 DRY 并且开发过程在这方面更简单,但是 a) 用户体验会受到影响,b) 我使用 SoundManager 在 iPhone 上用 Javascript 播放 MP3 文件,它立即开始糟糕(例如第二阶段)在“酷,我可以播放 MP3”之后的实验是“我无法访问 ID3 标签?这太糟糕了。”)。

我想知道具有多个移动平台开发经验的人是否可以证实或反驳我的印象:使用 Javascript 和 HTML 进行跨平台开发是否可行(特别是对于多媒体应用程序)?或者“开发和维护三个独立的本机代码库”是正确的方法吗?

提前致谢。

编辑:这个问题假设我必须将其作为应用程序来执行。我知道,只提供 mp3 并让用户 iPhone/Android/Blackberry Media Player 处理它们可能会更好,但就我的目的而言,这些解决方案超出了这个问题的框架。

I want to write an app that will stream MP3s from a server to any of the three major smartphone operating systems in the US (iPhone, Blackberry, and Android).

Here is the tradeoff I'm concerned with: if I write the app natively, it will make for the best user experience and give me the capability to add many more features if I want, but I will have 3 separate codebases, which violates the DRY principle.

If I use one of the frameworks out there to write it in Javascript/HTML (e.g. Rhomobile Rhodes), then I have one codebase for all the major platforms, so I'm not violating DRY and the development process is simpler in that respect, but a) the user experience will suffer, and b) I did some simple tests using SoundManager to play MP3 files with Javascript on the iPhone, and it started sucking right away (e.g. the second phase of the experiment after "cool, I can play an MP3" was "I have no access to ID3 tags? That sucks.").

I'm wondering if someone experienced in developing for multiple mobile platforms could confirm or dis-confirm my impression: is cross-platform development with Javascript and HTML viable (particularly for a multimedia app)? Or is "developing and maintaining three separate native codebases" the way to go here?

Thanks in advance.

Edit: this question assumes that I have to do this as an app. I understand that it may be much better to just serve up mp3s and let the users iPhone/Android/Blackberry Media Player handle them, but for my purposes those solutions are outside of the framework of this question.

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

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

发布评论

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

评论(3

护你周全 2024-10-04 11:14:04

在为 Pandora(主要是黑莓)开发过多个移动应用程序后,我可以告诉您,如果不将每个应用程序都作为本机应用程序,那么要按照我们想要的方式获得用户体验将非常困难(如果不是不可能的话)。跨平台框架可能适合“典型”移动应用程序,该应用程序可以在一些树形菜单中导航、显示信息、对后端服务进行一些调用等。但我还没有看到一个公开全面的多媒体 API 的框架。我也能理解为什么——每个平台在播放媒体时肯定都有其怪癖。即使是像预加载播放列表中的下一首曲目这样简单的事情也需要自定义代码。或者选择将音频路由到哪个音频路径(蓝牙?耳机?) 在 BlackBerry 上,流式音频有特殊的网络要求,因为您不能使用默认的 BIS 或 BES 传输 - 它必须通过 Direct TCP、WAP2 或 Wi-Fi (如果有的话)。再说一次,更多的自定义代码。

如果有什么安慰的话,可以在 BlackBerry 和 Android 之间共享一些代码 - 即不使用本机 API 的业务逻辑。由于 BlackBerry 使用 J2ME,因此它只是 Android 使用的 J2SE 的子集。

Having worked on several of the mobile apps for Pandora (primarily BlackBerry), I can tell you that it would be very difficult (if not impossible) to get the user experience the way we wanted it without doing each one as a native application. Cross-platform frameworks may be suitable for a "typical" mobile app that navigates around some tree menus, displays information, makes a few calls to backend services, etc. But I have yet to see one that exposes a comprehensive multimedia API. I can understand why, too -- each platform definitely has its quirks when it comes to playing media. Even something as simple as pre-loading the next track in a playlist requires custom code. Or selecting which audio path to route audio onto (bluetooth? headphones?) On BlackBerry, streaming audio has special networking requirements because you can't use the default BIS or BES transports - it must be over Direct TCP, WAP2, or Wi-Fi (if available). So again, more custom code.

If it's any consolation, it is possible to share a bit of code between BlackBerry and Android - i.e. business logic that does not use native APIs. Since BlackBerry uses J2ME it is just a subset of the J2SE that Android uses.

遇到 2024-10-04 11:14:04

我会选择“开发和维护三个独立的本机代码库”。正如您所说,您将提供更加集成和原生的用户体验,并提供尚未通过 HTML/JavaScript 提供的功能。

我已经成功构建并维护了一个可以在 Android、iPhone、J2ME 和 Symbian 上运行的应用程序,这并不是什么大问题。

I would go with "developing and maintaining three separate native codebases". As you said, you will offer a more integrated and native user experience and offer features that are not (yet) available via HTML/JavaScript.

I have built and maintained successfully an app that was running on Android, iPhone, J2ME and Symbian and it's not such a big problem.

最初的梦 2024-10-04 11:14:04

谢谢,请查看 Jango 、 www.jango.com ,从外观来看,它都是 HTML / JS。效果非常好。

Thanks, check out Jango , www.jango.com , its all HTML / JS by the looks of things. Works real well.

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