Is it possible to import java.rmi.* in Android?

喜欢而已 提交于 2019-12-23 15:35:23

问题


I have a project on my distributed system course and we have to use the java.rmi.* on our project and I knew that android doesn't provide this library because of the dalvik VM problems. So I'm just asking is there away to use these libraries on Android ?

Thanks.


回答1:


RMI is not supported on Android. you could implement it yourself, but that's going to be a non-trivial amount of work.




回答2:


RMI library is not included in Android API. That's really bad. I did a project where I need to use this feature, but couldn't do it. Unfortunately, if you google for this answer, some people tried to wrap RMI into self-defined library, but that does not work for everyone.

You are using RMI, I assume you will need access some database using RMI. Here is my solution:

  1. I built a simple java server to as a connection.

  2. I pull data from the source into the java server, use simple TCP connection to transmit data into my Android.

  3. Also, Android transmit data into my sever, and my server forward data into the source server using RMI.

Not a direct way, but it's quite easy to do so. If you want to read more, I'd include my report on how I construct this intermedia Java server. http://www.shawnfandev.com/wordpress/2014/06/07/ibm-cognos-admin-android/

Good luck!



来源:https://stackoverflow.com/questions/5900157/is-it-possible-to-import-java-rmi-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!