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.
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
Points: 0
You voted ‘up’
import com.rhomobile.rhodes.util.PerformOnUiThread;
PerformOnUiThread.exec(new Runnable(){
@Override
public void run() {
//Your method here..
}
});
Points: 1
You voted ‘up’
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
Points: 0
You voted ‘up’
Unfortunately there is no documentation for Rhodes internal native API.
You may just look rhodes sources.
Alexey
Points: 1
You voted ‘up’