Android Code in Nativescript app


#1

This is probably a dumb question, but can I just code Android Code straight into a nativescript app? Would it be better to separate native code from nativescript code in separate files and then just use require?

I’m building a geotagging app with Google maps intergration for my business and would like to use some background long running tasks that keep active even when the app is closed due to either a long period not using it, or accidentally by the user. That app should also be able to be stopped later. It seems like I might be able to use nativescript multithreading, but I don’t think it works the same…

In this case, could I just call the Android api for background tasks from my nativescript app using Android code? I’m puzzled how this works.


#2

Please check out these docs

https://docs.nativescript.org/core-concepts/android-runtime/marshalling/java-to-js

https://docs.nativescript.org/core-concepts/accessing-native-apis-with-javascript

https://docs.nativescript.org/plugins/plugin-reference


#3

This content goes alittle beyond me, and I have previous tried to take it in before, but luckily I have manage to implement both geotagging, google maps and multithreading into my project and now I can focus on the eye candy.

Thanks for the links. I’m guessing I might try some tutorials to get me used to the more advanced features of nativescript.