Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Developer
rruzic
Posts: 79
Registered: ‎04-05-2013
My Device: Simulator - developer
My Carrier: No provider

Advice needed - Combined BlackBerry native and Android runtime application

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?

Please use plain text.
Developer
rruzic
Posts: 79
Registered: ‎04-05-2013
My Device: Simulator - developer
My Carrier: No provider

Re: Advice needed - Combined BlackBerry native and Android runtime application

Anybody?

 

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.

Please use plain text.
BlackBerry Development Advisor (Retired)
jjasmann
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Advice needed - Combined BlackBerry native and Android runtime application

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.

 

    Justin

 

 

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Please use plain text.
Developer
rruzic
Posts: 79
Registered: ‎04-05-2013
My Device: Simulator - developer
My Carrier: No provider

Re: Advice needed - Combined BlackBerry native and Android runtime application

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?

Please use plain text.
BlackBerry Development Advisor (Retired)
jjasmann
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Advice needed - Combined BlackBerry native and Android runtime application

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.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Please use plain text.