- Home /
How do I override an Android Java class in Unity?
I'm trying to use Picasso (http://square.github.io/picasso/) to load images.
To get Picasso to return a bitmap, instead of using a passed in view, this must be done in native code:
Picasso.with(this)
.load(url)
.into(new Target() {
@Override
public void onBitmapLoaded (final Bitmap bitmap, Picasso.LoadedFrom from){
/* Save the bitmap or do something with it here */
}
});
I'm trying to call it from Unity so I can simply include the Picasso JAR file. Can it be done somehow?
Answer by FortisVenaliter · May 19, 2016 at 06:59 PM
I don't believe you can. Unity only supports C# and Javascript (and it's own built-in language). I don't think you can import or use Java libraries with Unity. You would need to find a C# equivalent or write your own in C#. Luckily, the syntax differences between C# and Java are pretty minor, so if you know one, learning the other is pretty easy.
Your answer
Follow this Question
Related Questions
How to write a java lib for unity as a plugin to make run another android app? 1 Answer
Now that Unity 4.1.2 broke the Android plugin examples, what do you use to learn them? 1 Answer
Help building changes to .java file included in Unity supplied package. 1 Answer
Using AndroidJavaObject properly 1 Answer
Problem in android java plugin 0 Answers