You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contains the source of the binding generator tool for the NativeScript's Android Runtime.
2
+
3
+
This project is used in the [NativeScript runtime for Android](https://github.com/NativeScript/android-runtime) to generate Java subclasses at runtime. Supppose you have the following Java class
4
+
5
+
```Java
6
+
packagecom.example;
7
+
8
+
publicclassMyClass {
9
+
publicintadd(intx, inty) {
10
+
return x + y;
11
+
}
12
+
}
13
+
```
14
+
15
+
In NativeScript, you can inherit from `MyClass` using the following syntax:
16
+
17
+
```JavaScript
18
+
var MyNewClass =com.example.MyClass.extend({
19
+
add:function(x, y) {
20
+
return x * y;
21
+
}
22
+
})
23
+
24
+
var obj =newMyNewClass();
25
+
```
26
+
27
+
Using `extend` function will create a new Java class that looks roughly as follows
The binding generator uses [ASMDEX library](http://asm.ow2.org/asmdex-index.html) to create the class above and to produce the corresponding `*.dex` file.
0 commit comments