Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When should I use Java.* APIs vs System.* ones?

APIs vs
0
10 Posted

When should I use Java.* APIs vs System.* ones?

0
10

There is some overlap between the Java.* classes and the System.* classes. With MonoDroid we exposed the Java.* namespaces to the .NET world to allow developers to call into any of the native Java APIs. In general, while building MonoDroid applications you should use the System.* classes over the Java.* classes for most of your code. The reason is because using the Java.* classes will actually create two instances of the object: one in the C# world that is the proxy to the real Java class, and one in the Dalvik side that implements the actual functionality. Every time that you invoke a method or a property in one of the Java.* classes, the code will transition from the Mono VM into the Dalvik VM and back. Most of the services exposed by the Java.* classes are available directly from the Mono world in the System.* namespaces and will not incur in this performance penalty. The exception to this rule is when you need to call a specific method in Android.* or Java.* that requires an instan

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123