Accessing native library code from rho elements application

Hello All,

I have one issue and one question while working with native extension + native library(.jar) file

Issue#1

We added native (.jar) library and able to compile rho elements application.

While we are creating new object from library we are getting following runtime exception :

java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

Can anyone faced this problem? If so, how did you approached to solve?

Qustion#1

How to get native android UI reference in native extension. Do we need to use “com.rhomobile.rhodes.RhodesActivity” or something else?

I have situation that, i need to display an alert during application sleep/wake through native extension.

Alexey Tikhvinsky
Hi,To run in UI thread you

Hi,

To run in UI thread you may use com.rhomobile.rhodes.util.PerformOnUiThread.exec(Runnable r) util.

In order to access UI Context object use com.rhomobile.rhodes.util.ContextFactory.getUiContext() util.

Alexey

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Bhoomesh gupta
import com.rhomobile.rhodes

import com.rhomobile.rhodes.util.PerformOnUiThread;

PerformOnUiThread.exec(new Runnable(){

@Override

public void run() {

//Your method here..

}

});

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Bhoomesh gupta
Thanks Alexey,I haven't check

Thanks Alexey,

I haven't check with above API's you mentioned. I will check with above API's and let you know the results..

Do you know, where can i find rhomobile android API's documentation? I found below link for source code

https://github.com/rhomobile/rhodes/tree/master/platform/android/Rhodes/src/com/rhomobile/rhodes

But, i did not find any documentation at above link.

Documentation at below link has all Ruby API's not Android native API's.

http://docs.rhomobile.com/rhodesapi/rhoutils-api. Could you please suggest us.

Thanks,

Bhoomesh

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexey Tikhvinsky
Unfortunately there is no

Unfortunately there is no documentation for Rhodes internal native API.

You may just look rhodes sources.

Alexey

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Log in to post comments