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
New Contributor
neadwerx
Posts: 2
Registered: ‎03-22-2013
My Device: Blackberry Dev Alpha
My Carrier: verizon
Accepted Solution

Android Runtime Is Slow

Hey we're looking into using the android rntime environment to port our app over. During testing we have noticed that the speed on the BB is laggy compared to android. I was wondering if any developers have any tips/ tricks that we could use in our Android Code to speed up the app to make it run faster on BB? Any and all help uis appreciated. Thanks!

Please use plain text.
Contributor
flackery
Posts: 12
Registered: ‎01-12-2011
My Device: Playbook

Re: Android Runtime Is Slow

I found a few things that helped speed my app up quite a bit. 

 

- Don't use a background graphic in your app. Use a solid color.

- set a solid color for the cacheColorHint for your ListViews

- follow the guidline here http://android-developers.blogspot.ca/2009/03/window-backgrounds-ui-speed.html and set the windowBackground to null

 

I also found that setting getWindow().setFormat(PixelFormat.RGB_565); helped but it can cause things to look really bad expecially with gradients and glows.

Please use plain text.
Developer
ndsmyter
Posts: 648
Registered: ‎09-26-2012
My Device: Limited Edition Z10, Playbook 16GB/32GB, Dev Alpha A/B/C
My Carrier: Mobile Vikings

Re: Android Runtime Is Slow

You have two options when you want to port your application from Android (see https://developer.blackberry.com/native/documentation/bb10/porting_from_android_ndk.html). Depending on the type of code you were originally using to develop your Android application you should choose the option to port on the code level (C/C++).

If you are using C/C++ you should use that option when porting. That means that you will be porting your app on the level of the code.
But I guess that most applications (and probably yours too?) will be built in Android Java. And this leaves only the option to really port the whole apk (which is slower).

Next to that, try to optimize the app as much as possible for Android (e.g. using the mentioned by flackery). Code refactoring sometimes helps too.


A like is always appreciated,
but a nomination for BB Elite even more :-)
You can also contact me on Twitter: @ndsmyter
Please use plain text.
New Contributor
neadwerx
Posts: 2
Registered: ‎03-22-2013
My Device: Blackberry Dev Alpha
My Carrier: verizon

Re: Android Runtime Is Slow

Thanks so much guys these relly helped!

Please use plain text.