9

I want to use an android library in Unity. The library contains a service which delivers some content to consume in your app. For native android apps (apps programmed using java), this content can be easily received by extending the library's service in the application. But I want to use this service (in fact the content that this service provides) in a Unity application. Can anyone explain how to do this?

Akram
  • 2,158
  • 1
  • 17
  • 24
  • 1
    Checkout this link, it might help. http://jeanmeyblum.weebly.com/scripts--tutorials/communication-between-an-android-app-and-unity – Alireza Farahani Aug 25 '16 at 17:42

2 Answers2

1

First you can't use .aar library files inside unity because the new format for Android Archives (.aar) is integrated with the new Gradle build system, however, Unity does not use that when building the project for Android yet.

So , you can compile your .aar file , extract it, and use the classes.jar to access the java classes inside the project you have. ( I've used this method when I converted from Eclipse to Android Studio ).

SAYE
  • 1,247
  • 2
  • 20
  • 47
-1

You need to create a plugin. Export android project from unity that can be opened in eclipse or Android Studio. Write the code there. Unity has document here that will help you in communication between unity and native android.

Zohaib Javed
  • 323
  • 1
  • 20