This document https://v7.docs.nativescript.org/core-concepts/android-runtime/advanced-topics/extend-application-activity describes how to extend an activity on Android.
It looks like this code isn't executed directly but provides a skeleton for creation of a Java file.
My question is this: Where and how do I add custom javascript code for the activity events? I haven't been able to find any examples of this - or maybe I have but just can't see the custom javascript.