user4661864
user4661864

Reputation: 71

NativeScript : Adding native android project to nativescript

i have a question on how to add existing native android project to Nativescript/typescript project.

I have a source code for native android and try to use/call their java classses (eg: MainActivity.java) as an intent in my nativesript project.

I already read a documentation on [Extending the native application][1]

[1]: https://docs.nativescript.org/guides/integration-with-existing-ios-and-android-apps/extend-existing-android-app but its only explain how to add nativescript to existing android-app and not vice versa.

I try to google it but can't find a solution.

I need a guide on where to copy to source code and to which folder and how to call it as an intent. Do i need to change the AndroidManifest.xml and add the class as an activity (Activity tag) or application (Application tag).

If you have a link/documentation which i can refer to, hope you mind to share.

Your help is very much appreciated.

Sorry, i'm quite noob in nativescript.

Thanks in advance

Upvotes: 2

Views: 207

Answers (1)

Manoj
Manoj

Reputation: 21908

You may convert your native project as an AAR library, copy that to your App_Resources/Android/lib then you should be able to access everything in it.

Here are docs that explains how you can access the native Java apis from JavaScript / TypeScript.

Upvotes: 1

Related Questions