0

I have an Android SDk done with java whic I already converted to .aar file. I created a plugin and placed the aar file in App_Resources/Android/libs directory. In my index.js file, I have this

var intent = new android.content.Intent(application.android.foregroundActivity, com.iposprinter.printertestdemo.IPosPrinterTestDemo.class) intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); application.android.foregroundActivity.startActivity(intent); This cause the sdk to display.

Doing this

var iposprinter=new com.iposprinter.printertestdemo.IPosPrinterTestDemo() console.log(iposprinter) //outputs com.iposprinter.printertestdemo.IPosPrinterTestDemo@682890e while this console.log(iposprinter.printerInit) outputs undefined while this

console.log(iposprinter.printerInit) outputs undefined console.log(iposprinter.printerInit()) outputs undefined TypeError: iposprinter.printerInit is not a function

How do I call methods from this package?

  • The attribute should be public in the class, did you try generating typings that might make it easier for you. – Manoj Nov 07 '19 at 05:04
  • Pls how do I go about that? I am actually not realy good at that pls. Any guide doing such? – ADEWUMI ADEDEJI Jan 11 '20 at 19:33
  • Just refer the docs for android typings section - https://docs.nativescript.org/core-concepts/android-runtime/metadata/generating-typescript-declarations – Manoj Jan 12 '20 at 04:05

0 Answers0