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
The `this._callbacks` property is automatically assigned to your extended class by the `frame.setActivityCallbacks` method. It implements the [AndroidActivityCallbacks interface](https://docs.nativescript.org/core-concepts/application-lifecycle#android-activity-events) and allows the core modules to get notified for important Activity events. It is **important** to use these callbacks, as many parts of NativeScript rely on them!
319
319
:::
320
320
321
+
<!-- TODO: fix links -->
322
+
321
323
Next, modify the activity in `App_Resources/Android/src/main/AndroidManifest.xml`
322
324
323
325
```xml
@@ -589,11 +591,13 @@ NativeScript considers instances of `NSNull`, `NSNumber`, `NSString` and `NSDate
589
591
590
592
On the other hand, any API that expects a `NSNull`, `NSNumber`, `NSString` or `NSDate` instance in Objective-C can be called either with a wrapper object or a JavaScript value - `null`, `number` or `boolean`, `string` or `Date`, in JavaScript. The conversion is automatically handled by NativeScript.
591
593
592
-
More information on how NativeScript deals with Objective-C classes is available [here](types/ObjC-Classes.md).
594
+
More information on how NativeScript deals with Objective-C classes is available [here](/advanced-concepts.html#objective-c-classes-and-objects).
593
595
594
596
#### Objective-C Protocols
595
597
596
-
Protocols in Objective-C are like interfaces in other languages - they are blueprints of what members a class should contain, a sort of an API contract. Protocols are exposed as empty objects in JavaScript. Protocols are usually only referenced when [subclassing](../how-to/ObjC-Subclassing.md) an Objective-C class or when checking whether an object or class conforms to a protocol.
598
+
Protocols in Objective-C are like interfaces in other languages - they are blueprints of what members a class should contain, a sort of an API contract. Protocols are exposed as empty objects in JavaScript. Protocols are usually only referenced when [subclassing](#ObjC-Subclassing) an Objective-C class or when checking whether an object or class conforms to a protocol.
More information on how NativeScript deals with structures is available [here](./types/C-Structures.md).
701
+
More information on how NativeScript deals with structures is available [here](#C-Structures).
702
+
703
+
<!-- TODO: fix links -->
698
704
699
705
#### `NSError **` marshalling
700
706
@@ -1136,7 +1142,7 @@ Array in Java is a special [java.lang.Object](http://docs.oracle.com/javase/7/do
1136
1142
- Has length property
1137
1143
- Has registered indexed getter and setter callbacks, which:
1138
1144
- If the array contains elements of type convertible to a JavaScript type, then accessing the i-th element will return a converted type
1139
-
- If the array contains elements of type non-convertible to JavaScript, then accessing the i-th element will return a proxy object over the Java/Android type (see [Accessing APIs](../metadata/accessing-packages.md))
1145
+
- If the array contains elements of type non-convertible to JavaScript, then accessing the i-th element will return a proxy object over the Java/Android type (see [Accessing APIs](#accessing-apis))
1140
1146
1141
1147
```js
1142
1148
var directory =newjava.io.File('path/to/myDir')
@@ -1245,7 +1251,7 @@ var background = button.getBackground(); // if there is no background drawable m
1245
1251
1246
1252
##### Android Types
1247
1253
1248
-
All Android-declared types are projected to JavaScript using the Package and Class proxies as described in [Accessing APIs](../metadata/accessing-packages.md)
1254
+
All Android-declared types are projected to JavaScript using the Package and Class proxies as described in [Accessing APIs](#accessing-apis)
1249
1255
1250
1256
#### Kotlin to Javascript Conversion
1251
1257
@@ -1265,7 +1271,7 @@ Keep in mind that some of Kotlin's fundamental types are translated to a Java ty
1265
1271
| kotlin.Long | long | kotlin.Long? | java.lang.Long |
Although the conversion of Kotlin types in NativeScript is quite the same as the [Java conversion](./java-to-js.md), let's take a look at some examples.
1274
+
Although the conversion of Kotlin types in NativeScript is quite the same as the [Java conversion](#java-to-javascript-conversion), let's take a look at some examples.
1269
1275
1270
1276
##### String & Character
1271
1277
@@ -1423,7 +1429,7 @@ Array in Kotlin is a special object that has an implicit Class associated. A Kot
1423
1429
- Has length property
1424
1430
- Has registered indexed getter and setter callbacks, which:
1425
1431
- If the array contains elements of type convertible to a JavaScript type, then accessing the n-th element will return a converted type
1426
-
- If the array contains elements of type non-convertible to JavaScript, then accessing the n-th element will return a proxy object over the Kotlin type (see [Accessing APIs](../metadata/accessing-packages.md))
1432
+
- If the array contains elements of type non-convertible to JavaScript, then accessing the n-th element will return a proxy object over the Kotlin type (see [Accessing APIs](#accessing-apis))
1427
1433
1428
1434
```js
1429
1435
var kotlinClass =newcom.example.KotlinClassWithStringArrayProperty()
@@ -1445,7 +1451,7 @@ A Kotlin Array is intentionally not converted to a JavaScript [Array](http://www
1445
1451
1446
1452
##### Creating arrays
1447
1453
1448
-
Occasionally you have to create Kotlin arrays from JavaScript. Because of the translation of the fundamental Kotlin types to Java types in Android, creating Kotlin array could be done the same way Java arrays are created. This is described in [Java to JavaScript](./java-to-js.md)
1454
+
Occasionally you have to create Kotlin arrays from JavaScript. Because of the translation of the fundamental Kotlin types to Java types in Android, creating Kotlin array could be done the same way Java arrays are created. This is described in [Java to JavaScript](#java-to-javascript-conversion)
1449
1455
1450
1456
##### Null
1451
1457
@@ -1466,7 +1472,7 @@ class KotlinClassWithNullableProperty() {
1466
1472
1467
1473
##### Kotlin Types
1468
1474
1469
-
All Kotlin types are projected to JavaScript using the Package and Class proxies as described in [Accessing APIs](../metadata/accessing-packages.md)
1475
+
All Kotlin types are projected to JavaScript using the Package and Class proxies as described in [Accessing APIs](#accessing-apis)
1470
1476
1471
1477
##### Kotlin Companion objects
1472
1478
@@ -1790,7 +1796,7 @@ if (android.os.Build.VERSION.SDK_INT >= 21) {
1790
1796
1791
1797
### Accessing APIs
1792
1798
1793
-
One of NativeScript's strongest capabilities is the access to Android (also referred to as **'Java/Kotlin'** or **'native'**) APIs inside JavaScript/TypeScript. That's possible thanks to build-time generated [Metadata](./overview.md) chunks which hold the information about the public classes from the Android SDK, Android support libraries, and any other Android libraries which may be imported into your Android NativeScript project.
1799
+
One of NativeScript's strongest capabilities is the access to Android (also referred to as **'Java/Kotlin'** or **'native'**) APIs inside JavaScript/TypeScript. That's possible thanks to build-time generated [Metadata](#metadata) chunks which hold the information about the public classes from the Android SDK, Android support libraries, and any other Android libraries which may be imported into your Android NativeScript project.
1794
1800
1795
1801
::: warning Note
1796
1802
'Android classes' and 'Java/Kotlin classes' are used interchangeably throughout the article to refer to classes in the Java/Kotlin programming language.
@@ -1836,7 +1842,7 @@ To have access and Intellisense for the native APIs with **NativeScript + TypeSc
1836
1842
:::
1837
1843
1838
1844
::: warning Note
1839
-
You cannot use APIs that are not present in the metadata. By default, if `--compileSdk` argument isn't provided while building, metadata will be built against the latest Android [Platform SDK](https://developer.android.com/about/versions/nougat/index.html) installed on the workstation. See [metadata limitations](./overview.md).
1845
+
You cannot use APIs that are not present in the metadata. By default, if `--compileSdk` argument isn't provided while building, metadata will be built against the latest Android [Platform SDK](https://developer.android.com/about/versions/nougat/index.html) installed on the workstation. See [metadata limitations](#metadata-limitations).
For a comprehensive guide on extending classes and implementing interfaces through JavaScript/TypeScript check out [the dedicated article](../binding-generator/extend-class-interface.md).
1936
+
For a comprehensive guide on extending classes and implementing interfaces through JavaScript/TypeScript check out [the dedicated article](/binding-generator/extend-class-interface).
1937
+
1938
+
<!-- TODO: fix links -->
1931
1939
1932
1940
#### Full-fledged Example
1933
1941
@@ -2347,10 +2355,8 @@ These two lists unambigously determine how filtering is performed:
2347
2355
2348
2356
Sample filtering specifications can be found in `@nativescript/core` plugin's repository:
2349
2357
2350
-
-[Plugin's Android API usage list](https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/platforms/android/native-api-usage.json)
2351
-
-[Plugin's iOS API usage list](https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/platforms/ios/native-api-usage.json)
2352
-
-[App's Andoroid API usage lists](https://github.com/NativeScript/NativeScript/blob/master/tests/app/App_Resources/Android/native-api-usage.json)
2353
-
-[App's iOS API usage lists](https://github.com/NativeScript/NativeScript/blob/master/tests/app/App_Resources/iOS/native-api-usage.json)
2358
+
-[Android API usage list](https://github.com/NativeScript/NativeScript/blob/master/packages/core/platforms/android/native-api-usage.json)
2359
+
-[iOS API usage list](https://github.com/NativeScript/NativeScript/blob/master/packages/core/platforms/ios/native-api-usage.json)
2354
2360
2355
2361
### Troubleshooting
2356
2362
@@ -2369,6 +2375,6 @@ For each global symbol that is discovered by the generator, there should be a li
2369
2375
-`verbose: Exception [Name: 'vfwprintf', JsName: 'vfwprintf', Module: 'Darwin.C.wchar', File: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wchar.h'] : Can't create type dependency. --> [Type Decayed] : Can't create type dependency. --> [Type Typedef] : VaList type is not supported.` - if a symbol is not included because it isn't supported for some reason it will be stated in the logged exception. In this case the symbol cannot be used from JavaScript because {N} doesn't support calling functions with variable argument lists.
2370
2376
-`verbose: Exception [Name: 'GLKVector3Make', JsName: 'GLKVector3Make', Module: 'GLKit.GLKVector3', File: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKVector3.h'] : Can't create type dependency. --> [Type Typedef] : Can't create type dependency. --> [Type Elaborated] : Can't create type dependency. --> [Type Record] : The record is an union.` - Another example of an unsupported symbol, this time the reason is that `union`s are unsupported
0 commit comments