# import java

**URL:** <https://forums.fusetools.com/t/import-java/6066>\
**Category:** How-to Discussions\
**Created:** [March 26, 2016, 12:19am UTC](https://forums.fusetools.com/t/import-java/6066 "2016-03-26T00:19:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danhanfry](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@danhanfry](https://forums.fusetools.com/u/danhanfry)\
**Post date:** [March 26, 2016, 12:19am UTC](https://forums.fusetools.com/t/import-java/6066/1 "2016-03-26T00:19:41Z")

</div>

Sorry for my English.

Yes, I can run my java files methods

File.ux

```auto
<JavaScript>
  var SystemSounds = require("SystemSounds");

  function button_pressed() {
      SystemSounds.playNotification();
  }

  module.exports = {
      button_pressed: button_pressed
  };
</JavaScript>

<Button Text="Sonido" Clicked="{button_pressed}" />

```

File.uno

```auto
[Foreign(Language.Java)]
static extern(Android) void PlayNotification()
@{

  com.samples.MyClass mc = new com.samples.MyClass();
  mc.miLog();

@}

```

Fila.java

```auto
public class MyClass
{

  public void miLog()
  {
    android.util.Log.d("ForeignCodeExample", "miLog");
  }

}

```

But I do not know how to import external libraries `import com.google.android`

this would be a possible solution, but it does not work

```auto
[Require("AndroidManifest.ApplicationElement", "<meta-data android:name=\"com.google.android.gms.version\" android:value=\"@integer/google_play_services_version\" />")]
[Require("Gradle.Dependencies.Compile","com.google.android.gms:play-services:8.4.0")]

```

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 26, 2016, 11:05pm UTC](https://forums.fusetools.com/t/import-java/6066/2 "2016-03-26T23:05:59Z")

</div>

I’m thinking what you need is to include a jar or an aar?

If it’s a jar you can do it something like this:

[https://github.com/bolav/fuse-facebook-login/blob/de4309c0528926ce776b0b310bc717c5898d624c/Android.uxl](https://github.com/bolav/fuse-facebook-login/blob/de4309c0528926ce776b0b310bc717c5898d624c/Android.uxl)

Inside an uxl file.

Then you can call on the classes inside. If it’s an aar file you want to import, this can also be done, but is a bit more involved.

---

<div class="post-metadata">

**Author:** ![danhanfry](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@danhanfry](https://forums.fusetools.com/u/danhanfry)\
**Post date:** [March 26, 2016, 11:26pm UTC](https://forums.fusetools.com/t/import-java/6066/3 "2016-03-26T23:26:25Z")

</div>

> **Bjørn-Olav Strand wrote:**

Hi, I was just watching your code on github

I wondered how to use admob or apis youtube or any other external library, I see very confusing to me.

I will investigate the link you’ve shared with me.

Let me say that the project opened with “android studio” and everything works fine, android studio Since I import libraries in build.gradle and it seems that everything works, but not if I’m doing well, importing as project → `build\Android\debug\projectDemo\`

Thank you

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [March 27, 2016, 7:21am UTC](https://forums.fusetools.com/t/import-java/6066/4 "2016-03-27T07:21:50Z")

</div>

For exporting to Android Studio’s and gradle with Fuse, and adding other libraries look at this:

[https://github.com/bolav/fuse-facebook-login/blob/master/Facebook.uno#L85](https://github.com/bolav/fuse-facebook-login/blob/master/Facebook.uno#L85)

Please note that gradle/Android Studio’s support is very early yet, and the API’s may not be stable.
