Monodroid,互操作悫Java和C# [英] Monodroid, Interop betwen Java and C#

查看:182
本文介绍了Monodroid,互操作悫Java和C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有Android的下一个大的Java应用程序(大只是意味着它太辛苦了翻译应用程序)。我们必须访问.NET编写发动机(这款发动机也太大...)。这款发动机是唯一的计算。

We have a big Java application under Android ("big" just means it's too much work to translate the application). We must access to an engine written in .Net (this engine is also too "big" ...). This engine is only calculation.

因此​​,我们寻求与monodroid的解决方案。我们的主要问题是互操作悫monodroid和Java。在这个时候,我们得到:

We therefore seek a solution with monodroid. Our main problem is interop betwen monodroid and Java. At this time, we get :

  • 调用的.jar库中的Java功能,从单声道应用

但是,我们不能打电话,启动Java活动。这可能吗?

But we can not call and start a Java activity. Is it possible ?

第二个问题是,我们不知道如何沟通从Java到单声道。是不是也可以吗?

The second problem is that we do not know how to communicate from Java to Mono. Is it also possible?

推荐答案

您可以方便地调用从本地code Java的活动是这样的:

You can easily call Java activity from native code like this:

var intent = new Intent().SetClassName(this,"com.myapp.java.JavaActivity");
StartActivity(intent);

当我从理解这篇文章您可以调用从Java本机code通过ACW,但我认为这是太困难了。

As I understood from this article you can invoke native code from Java via ACW, but I think that it's too difficult

这篇关于Monodroid,互操作悫Java和C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆