04-09-2013 06:26 AM
I have an Android application, which I would like to port to BlackBerry. The application is written in Java Android development kit, but a library, which implements one feature is written in Android native C++ code. The application is rather featurefull and the feature implemented in the native library might as well be a standalone application.
The plan is to separate the native lib out of the application and build the application for BlackBerry without the native feature. But in future we would still like to offer our users the fully functional application, so the feature will be reimplemented in BlackBerry native SDK.
My question is - how can I call a BlackBerry native application from my application, which is running in BlackBerry android runtime? The native application needs to take input data and return output data. Both pieces of data are bitmap images, in Android, JPEG format is used, but we can live with pretty much anything. Is there a way to expose an interface to a native app, which can be called from an Android runtime app?
Can anybody please point me to some documentation or to an example, where I could learn how to call native apps from Android runtime and return data to them?
04-11-2013 08:19 AM
I did RT*M and ST*W and found no examples of such architecture and no pointers on how to go about seting it up.
Does anybody at least have an idea, whether spinning off a performance-critical part of my Android app into a native BlackBerry port and calling it from the rest of my app running in android runtime in Blackberry is a feasible scenario for porting an Android app with a part implemented in native code? Or would I be better off re-implementing a low-performance scaled down version of the performance-critical feature and running everything in android runtime?
Any advice would be much appreciated.
04-11-2013 11:03 AM
Due to the fact that BlackBerry is very security conscious, communicating with Native BlackBerry 10 applications from an application running within the Android runtime is not possible.
Your two options are as you say, reimplement the logic in Java for use purely within the Android environment, or rewrite the rest of your application to run as a native BB10 application.
04-12-2013 02:54 AM
Thank you, Justin, so now I understand, that Android app -> Native app connection is not possible.
There is another question that i have; On Android there is an arbitrary memory usage limit imposed by the system, in Android 2.3 it is 16MB, in Android 4.X it is double that.
Is there such an arbitrary limitation in BlackBerry's Android runtime? If there is, what is the memory usage limit?
04-12-2013 01:09 PM
For Android, the heap size allocation depends on the specific device and is relative to the screen resolution.
As such, BlackBerry is using an 80MB max heap size allocation, which is similar to the comparable Android units.