How to call java from c#?

Let’s learn how to call java from c#. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How to call Java API from NDK C++ thread?

I want to call Java API from NDK C++ thread, but env->FindClass() return 0. But when I call Java API in main thread, it works well. I've already call AttachCurrentThread() in the thread, can anyone help me? Here is the source code: JAVA CODE: public class simple_test extends Activity { ... // This functin will be called in C++ public void PrintNdkLog(String slog) { Log.e(logTagNDK, slog); return; } } C++ CODE: static JavaVM* g_JavaVM = NULL; jobject getInstance(JNIEnv *env, jclass obj_class...

Answer:

I have solved it now. In NDK native thread, only can call static Java API. If you call env->FindClass...

Read more

airun at Stack Overflow Mark as irrelevant Undo

Other solutions

How to call a WCF SOAP 1.0 web service from a Java class?

I am trying to call a WCF SOAP 1.0 web service for my Android application. How do I call it from a Java class? Can I call it using the javax.soap library? Or is there a better way to make it work on Android?

Answer:

Android doesn't provide any SOAP library. You can use HTTP POST request. But better use 3rd party library...

Read more

Abhishek Sett at Quora Mark as irrelevant Undo

How to call java class that is in diffrent location?

Hello. I have a problem. I dont know how to call a class in java from second class to the first. For example: I have one class that is in E:/test, and I have a second class that is in E:/text. How I can call the first class in the second class. Thank...

Answer:

If put one of the classes in a package and by using the package keyword at the top of your code: package...

Read more

Depeche at Yahoo! Answers Mark as irrelevant Undo

Java Eclipse: Gui help. How do I call a class for it to make another buttons and stuff for my frame (host)?

My code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class YAY implements JFrame{ public YAY(){ super("Frame!") setVisible(true); setSize(300,300); setLayout(new FlowLayout()); JButton button = new JButton("...

Answer:

Type another "public class".... Good luck!

Read more

mico at Yahoo! Answers Mark as irrelevant Undo

Java - how to call a double from an action event?

I'm trying to call the double values accel and vel in this private class: private class calculationListener implements ActionListener{ public void actionPerformed(ActionEvent event){ String transfer = (input1.getText()); double accel = Double.parseDouble...

Answer:

Those are method variables. So they are only available in the method you create them. If you want to...

Read more

Kopen at Yahoo! Answers Mark as irrelevant Undo

How do I call my method in Java?

So I have a method that takes in a integer as a menu selection, and then runs a loop based on the selection. The loop is always the same, but the menu selection changes an integer in the loop. Anyway, how do I call this method in my main method? I prompt...

Answer:

Can it be your function is declared "public int compute(...)" for now? Try "public static...

Read more

justme at Yahoo! Answers Mark as irrelevant Undo

How do you call methods that don't return a value in Java?

I'm confused as to how you call methods that don't return values. I understand calling ones that do return values but not ones that don't. I'm still a beginner at Java. Thanks in advance!!

Answer:

Calling methods that don't return values is exactly the same process as calling ones that do return...

Read more

Naomi at Yahoo! Answers Mark as irrelevant Undo

How to call a method in Subclass in Java?

Hi Java professionals, May I ask if it is possible to call a method in a Subclass from a Superclass? I am trying and I can't. The error message is ...show more

Answer:

Yes it is possible. You should show us your code so we can see what is wrong.

Read more

GFJ3IMLRFE5YLULJLUTSQBMNAA at Yahoo! Answers Mark as irrelevant Undo

Answer:

You can't, I'm afraid. Java does not have the ability to call arbitrary code from an arbitrary DLL.more...

Read more

ChaCha Mark as irrelevant Undo

How do I implement a method in java (lets call it as A) which is present in interface B as well as abstract base class C?

1) What  would happen if both the interface method definition and abstract Base class method definition are same? What to do if they are different?

Answer:

The simplest case is when the method signatures are identical. That means that the return type, the...

Read more

Cameron Purdy at Quora Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.