import java

Sorry for my English.

Yes, I can run my java files methods

File.ux

<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

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

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

@}

Fila.java

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

[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")]

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

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.

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

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

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