I have an Blackberry library written using JAVA as well Blackberry(RIM) specific API's. I would like to port the same library in to Android platform without making any code changes and make it run.
Here i am looking for the best way to achieve it
Any cross compiler/cross framework is available for making my Blackberry run on Android platform.Thinking this would make my job easy ;)
Please share your inputs on this.
Thanks in advance.
You can't do that. AFAIK, Blackberry uses J2ME technologies(can be wrong here). Android system is built in absolutely other principles. You have got to learn android in order to understand how to build GUI, how to process with background tasks and where you store your data. Sorry.
Start with application fundamentals.
If porting was that easy, a lot of developer would be out of work.
You will not have to rewrite the whole application, but surely there must be quite a few changes done. If you have a clean design, you might be able to reuse a lot of code as it is. Otherwise it will get more complicated. For the RIM API, it might be a good idea to write interface-classes first ("RIMXyz implements IntrfXyz"), that have all the function-call that you use of the RIM-API. Then you can write the Android API classes using "AndrXyz implements IntrfXyz". Put the RIM-dependend stuff in a separate external lib, and do the same with the android-dependent stuff. Then you can have a RIM-prj and an Android-prj, each only linking to the dependent classes and the reusable classes. That way you could structure you porting project quite nicely.
Also the "top" end of the application surely has to change, because you have to use the "activity"-class in Android to get anything running. Those are the two aspects I see.
I hope this is understandable, a bit hard to put it in a few words...
I have started a cross-platform project for Android/Java applet, and this is how I've done it. It works. ;-)
You cannot do this without some code rewrite. If you can tell us more about the classes in the RIM API that you are using, you might get some specific answers as to what classes from the Android API to use.
You should find similar functions in android api to replace RIM API invocations and refactor your code using for example Abstract Factory design pattern. (http://sourcemaking.com/design_patterns/abstract_factory)
Related
My team is looking for something similar to storybook for native mobile development. We're building a design system and need to develop isolated and encapsulated components independently. Any idea if there is a way to enable swift and java on storybook? Or maybe another tool that serves this purpose?
Found this after a quick online search. Xcode contains Liveness since Xcode 7 or something. It basically enables you to have Interface Builder render your custom views. I always use it in my Storyboards. It saves time on making adjustments. Given that all UI related classes are in a separate framework.
SwiftUI has this ability with it's live view option.
I'm looking for a lightweight physics engine for Android. I don't want it to do any rendering itself. It needs to be easy to use, fast, and have some tutorials/api docs.
I had a similar problem a while back ago and eventually decided to go with JBox2D: http://code.google.com/p/jbox2d/.
I agree that docs are not very good for this particular port, however I find the original manual very useful (despite the fact that it's in C++): http://www.box2d.org/manual.html.
Furthermore, JBox2D comes with something that is called Testbed -- a simple GUI application aimed for testing. It has a bunch of examples, which should be enough to get you started.
Libgdx has JBox2D built in and is cross platform (Android, Java Desktop, GWT Web) like Unity, tho it's free and open source. Not sure why you don't want the library to do rendering for you, but you can strip out anything you don't want.
I used Eclipse with the Android SDK to develop the original application. I ask since this was my first Java (and Eclipse, and Android, and XML) project. I assume that most of the Java should run on the PC without too much trouble. I may want to restructure the code to isolate the Android specific functions. Should I stay with Eclipse or move to something like NetBeans? Any advice would be terrific.
Eclipse vs Netbeans is irrelevant to your problem. They are both just glorified text editors that let you edit java code, with a little bit of compilation help. You can write any java app in either, its really just personal preference.
The ease of porting to windows really depends on what your application is. If you have a large chunk of code that is not dependent on any of the UI or lifecycle stuff, then you should be able to create a separate java library for that and reference it in both your android app, and your windows app.
The challange will be replacing the UI. As Fredley mentioned, swing is the built in option. Its a bit of a pain, but you should be able to find plenty of documentation on it.
If your application is tightly tied to the UI, then you are going to have a very hard time finding any code in common.
Assuming that most of your code is in Android-independant classes, your biggest hurdle will be the GUI. Investigate swing to start off with.
The choice between NetBeans and Eclipse is largely one of preference. NetBeans has some nice GUI tools- but so does Eclipse. In my opinion, it's usually best to stay with what you know.
Here's a decent post on the subject of Java IDEs: What is the best free IDE for Java Programming
I know Java apps can be run in Android. But what I want to know is this: I have a perfectly normal Java app and I want to port it to an android platform. What changes would I need to do to my app in terms of GUI and other code to make it usable in Android? I know Android uses XML file to control the look and feel of its app. So would I need to change my GUI completely?
I just want to know the general overview of how porting may be done. If anyone could point me to right resources, that would be great. Also, for your info I'm a newbie to developing android app, so please be patient with me :)
Update: Both very helpful answers. Thank you!
The short answer is that you would simply rewrite all of the GUI from scratch, for Android. It simply uses a completely different UI framework. While basically all of the core Java libraries are there, Swing and AWT libraries are not.
If you are looking to translate parts of it automatically, I don't think there is any such tool. You're going to be building a brand new Android GUI.
And really, that makes sense. These frameworks are serving reasonably different platforms and needs (desktop vs. phone). You probably need to be redesigning your app quite a bit to go from a desktop to a phone.
Good news is the non-GUI parts ought to work as-is with no changes, unless they do something unusual. You may have to package third party libraries into your project if they are used by your code.
I expect that it will be a great deal of work to do the porting, as the way that your application works with Android will be different.
You will also have some issues, perhaps, with the fact that not everything in java is supported, as it is a mobile device, but does more than JavaME.
It would help if you could explain a bit about the application, as how much it needs to interact with the user or any other resources on the device will determine how to port and how much work is involved.
Your best bet though is to see about learning to program on the Android, and there are several good books on the subject. I got one from Manning publications that I found helpful.
You may want to look at the comments in this article, as I think it would be a good starting point for you on what may need to be changed:
http://www.anddev.org/problem_in_android_project_conversion-t1633.html
This is actually two questions rolled into one.
Is there a particular type of Java functionality that people are using JRuby for or is it mainly because of the performance advantage that JRuby gives versus the MRI?
The reason I ask is, I'd like to add some Java functionality to a Rails project (just to show that it's possible). Ideally this Java functionality would also be useful rather than redundant. Which leads to my next question . . .
What's an example of something that would make a good demonstration of Java functionality being added to a simple Rails CRUD app?
I guess anything you can do in a Ruby class, you could just as easily do in a Java class (with about twice as much code), so I understand the question may be hard to answer. I'm just wondering if there is a particular type of functionality that is more appropriate to do in Java.
There's nothing at stake here, by the way. I'm just playing around and testing things out.
I'd find a focused Java library that fills an existing need in Java and work on leveraging that library within your rails application. One possibility is to use JTS (Java Topology Suite) to manipulate geographic regions in a rails app and convert them for display on a map within your rails app.
I think the Ruby class libs (gems) can do pretty much anything the Java libs can do, so there's not much of a compelling reason to use JRuby on Rails in a "stand-alone" scenario.
I use it to integrate with a vendor Java app. Knocking up a quick controller and some views is much easier than extending using Java/Swing.
Also in a "Enterprise" environment, a rails developer may be obliged to deploy to Tomcat or Glassfish. The Warbler gem for JRuby enables this.