First question: do you really need to transfer these files? :-)
You can include Java source code in a Mono project for Android; just set the Build action to AndroidJavaSource
and the source will be compiled into the resulting .apk. This can also be done using .jar
files.
Then the question arises of calling Java code from C # .
In the case of IntentIntegration.java
and IntentResult.java
this may be enough, because these types do not support inheritance (they are final
). Of course, using JNIEnv to call methods on them will be PITA, but this can be done:
In addition, the IntentIntegrator
mention that the activity provided should override the Activity.OnActivityResult method.
All that said, porting IntentIntegrator.java
should not be so difficult, since most of them are a wrapper over Activity.StartActivityForResult with the appropriate intent and construction of an AlertDialog
(which you may or may not need).
source share