Skip to content

Commit 36e6dee

Browse files
author
Nikolay Tsonev
committed
add new articles (integration existing android and ios apps)
1 parent 59d17a5 commit 36e6dee

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Extend existing Android app
3+
description: Learn how to extend your existing Android app with Angular 2 and NativeScript
4+
position: 11
5+
slug: extend-existing-android-app
6+
environment: angular
7+
---
8+
9+
# Extend your existing Android app with Angular 2 and NativeScript
10+
11+
## This article provides step-by-stem instructions, how to extend existing Android app with Angular 2 and NativeScript
12+
13+
1.Build your NativeScript app for Android:
14+
`tns build android`
15+
16+
2.Copy your NativeScript app `\platforms\android\src\main\assets` folder to your Android app:
17+
18+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/copy-your-nativeScript.png)
19+
20+
3.Copy your NativeScript app `\platforms\android\src\main\java\com\tns` folder to your Android app java classes folder:
21+
22+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/copy-your-nativeScript-app2.png)
23+
24+
4.Add reference to **nativescript.aar** and **widgets-release.aar**:
25+
26+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/add-reference.png)
27+
28+
> Note: Both can be found in your NativeScript app `\platforms\android\` folder.
29+
30+
31+
5.Add both [Java classes](https://github.com/enchev/android-ng2-tns/tree/master/app/src/main/java/com/example/myexistingapplication) and [JavaScript implementations](https://github.com/enchev/android-ng2-tns/tree/master/app/src/main/assets/app) of **MyCustomNativeScriptActivity** and **MyCustomNativeScriptFragment** to your Android app:
32+
33+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/add-java-classes-java-implementations.png)
34+
35+
6.Start MyCustomNativeScriptActivity using NativeScript RuntimeHelper:
36+
37+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/start-myCustomNativeScriptActivity.png)
38+
39+
7.Run your Android app and enjoy the result:
40+
41+
![Copy your NativeScript](../img/extend-existing-android-app-with-ns-angular2/result.gif)
42+
43+
44+
Get the app from here: [https://github.com/enchev/android-ng2-tns](https://github.com/enchev/android-ng2-tns)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Extend existing iOS app
3+
description: Learn how to your existing iOS app with Angular 2 and NativeScript
4+
position: 12
5+
slug: extend-existing-ios-app
6+
environment: angular
7+
---
8+
9+
10+
# Extend your existing iOS app with Angular 2 and NativeScript
11+
12+
## This article provides step-by-stem instructions, how to extend existing iOS app with Angular 2 and NativeScript
13+
14+
1.Build your NativeScript app for iOS:
15+
`tns build ios`
16+
17+
2.Copy your NativeScript app `\platforms\ios\YourAppName\app` folder to your iOS app:
18+
19+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/copy-your-nativeScript.png)
20+
21+
3.Copy your NativeScript app `\platforms\ios\internal` folder next to your iOS app:
22+
23+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/copy-your-nativeScript-app2.png)
24+
25+
> Note: Both can be found in your NativeScript app `\platforms\ios\`and `\lib\ios\` folders.
26+
27+
4.Add reference to **NativeScript.framework** and **TNSWidgets.framework**
28+
29+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/add-reference.png)
30+
31+
> Note: Both can be found in your NativeScript app `\platforms\ios\` and `\lib\ios\` folders.
32+
33+
34+
5.Add **Run Script** and **Linker Flags** to build and use the metadata:
35+
36+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/add-run-script-and-linker-flags.png)
37+
38+
`cd “$PROJECT_DIR/internal/metadata-generator/bin” && ./metadata-generation-build-step`
39+
40+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/add-run-script-and-linker-flags2.png)
41+
42+
`-sectcreate __DATA __TNSMetadata “$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin”`
43+
44+
> Note: Run Script should be the first build phase.
45+
46+
6.Present NativeScript view controller from your app:
47+
48+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/present-nativescript-view-controller.png)
49+
50+
![Copy your NativeScript](../img/extend-existing-ios-app-with-ns-angular2/result.gif)

0 commit comments

Comments
 (0)