Android 与 Blackberry 开发(可重用代码?)
我知道这个问题已经以某种形式、这样或那样地出现了。然而,其中很多都已经过时了,所以我想我会再问一次,并询问这个问题的真正原因。
Android和BB的开发都可以通过Java来完成,虽然Android在Java SDK之上添加了很多类和功能,但Blackberry似乎依赖于Java的J2ME。如果我编写一个针对两个平台的应用程序,特别是从媒体播放的角度来看,那么两个平台之间可以重用多少代码?根据记录,基于 PhoneGap 的应用程序是不可能的(特别是由于 BB 实施了 Webkit)。
I know this question has come up in some form, one way or another. However, a lot of them are outdated, so I figured I'd ask again plus also ask the real reason for this question.
Both Android and BB development can be accomplished via Java, and while Android adds a lot of classes and functionality on top of the Java SDK, Blackberry seems to rely on Java's J2ME. If I write an application that targets both platforms, especially from a media playback perspective, how much code reuse can I expect between both platforms? For the record, a PhoneGap based app is not possible (esp due to BB's implementation of Webkit).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
恕我直言,不要期望重用大量代码。这些是您可能无法共享代码的领域:UI、网络、安全、正则表达式、java 1.4+ 类。
另外,android 不需要自制的事件系统。所有的活动都可以相互通信,或者你可以使用服务......黑莓没有这些。
我使用这两个平台已经有一段时间了,我只分享这个想法......每个平台的实现几乎都是特定的。
IMHO, don't expect to reuse tons of code. These are the areas where you probably can't share code: UI, network, security, regex, java 1.4+ classes.
Also, android doesn't need a self made eventing system. All activities can talk with each other, or you can use services... BlackBerry doesn't have any of this.
I've being working with these two platforms for a while, and I only share the idea... The implementation is almost specific for each one.
我正在开发一个大型应用程序,该应用程序在 Android、BlackBerry、MIDP 和 J2SE(即桌面 Java)之间共享通用代码。我想说,给定平台上大约 75% 的代码是通用代码。
优点:
缺点:
它是否值得你花时间取决于一些事情......我至少会考虑以下问题:
I work on a large app which shares common code across Android, BlackBerry, MIDP, and J2SE (i.e. Desktop Java). I would say that about 75% of the code on a given platform is common code.
Pros:
Cons:
Whether it's going to be worth your while depends on a few things... I'd at least think about the following:
Android 和 Blackberry 代码可以重复使用。我以前做过并且效果很好。确实存在一些小的差异。我记不清了,但有几个
除了这些之外,我想你会没事的。但是,是的,尝试一下可以节省很多时间。
Android and Blackberry code can be reused. I have done it before and works beautifully. A few small differences do exist. I cant remember them all, but a few
Other than these, I think you will be ok. But yes, do give it a shot saves a lot of time.