NativeScript On Fire Cross-Platform Development Cross-Plattform Entwicklung

MobiDev. Native. https://mobidev.biz/blog/angular-native-nativescript-with-angular-2 N NativeScript

JavaScript Engine

App code Hooks Dispatcher System NativeScript Runtime N NativeScript

JavaScript Engine

calls native API accesses native objects

App code Hooks Dispatcher System NativeScript Runtime N NativeScript

var button = Button button = new android.widget.Button(getApplicationContext()) new Button(getApplicationContext()); JavaScript Engine

calls native API accesses native objects

App code Hooks Dispatcher System NativeScript Runtime N NativeScript

var button = Button button = new android.widget.Button(getApplicationContext()) new Button(getApplicationContext()); JavaScript Engine

calls native API accesses native objects

calls JavaScript calls callback function App code functions Hooks Dispatcher System NativeScript Runtime N NativeScript

JavaScript Engine

Button

ListView

FileSystem App code Modules Hooks Dispatcher System NativeScript Runtime N NativeScript

JavaScript Engine

Button

ListView

FileSystem App code Modules Hooks Dispatcher System NativeScript Runtime

platform-agnostic platform-specific N NativeScript

JavaScript Engine

Any JS library

Button

ListView

FileSystem App code Modules Hooks Dispatcher System NativeScript Runtime

TypeScript AOT

Routing Components N NativeScript

JavaScript Engine

Any JS library

Button

ListView

FileSystem App code Modules Hooks Dispatcher System NativeScript Runtime Any native .. .. interface TypeScript AOT .. UI component Routing Components .. library N NativeScript

JavaScript Engine Live Reload Zero Day Support

Any JS library Over-the-air updates

Button

ListView

FileSystem App code Modules Hooks Dispatcher System NativeScript Runtime Any native .. .. interface TypeScript AOT .. UI component Routing Components .. library N NativeScript R R React Native

...

public class ReactButtonManager extends SimpleViewManager {

public static final String REACT_CLASS = "RCTButtonView";

@Override public String getName() { return REACT_CLASS; }

@Override public ReactButtonView createViewInstance(ThemedReactContext context) { return new ReactButtonView(context, new Button(), mCallerContext); } ... } N NativeScript

... export class MyButton extends MyButtonBase {

// added for TypeScript intellisense. nativeView: android.widget.Button;

public createNativeView(): Object { // Initialize ClickListener. initializeClickListener();

// Create new instance of android.widget.Button. const button = new android.widget.Button(this._context);

// set onClickListener on the nativeView. button.setOnClickListener(clickListener);

return button; } ... } N Thanks! ? Questions or remarks? N NativeScript