Hi,
I'm trying to build a native extension that makes use of several external java packages. However, when I try to load them, the import always fails. I'm not very sure where to place the .java files for the packages; i've tried several locations without luck:
in my extension implementation, I try:
import com.abc.defgh.Test;
...
Then, I try to place Test.java in:
- extensions\myext\copilot\ext\platform\android\src\com\abc\defgh\Test.java
- extensions\myext\copilot\ext\platform\android\generated\src\com\abc\defgh\Test.java
It fails always with: error: package com.abc.defgh does not exist
Using the CLASSPATH env. variable doesn't work either.
I haven't done anything with Java in a while; sorry if this is a silly question, but i'm not sure if this something specific to Rhomobile or not.
Thanks!
1 Replies
I've found the answer myself: it turns out that if you need additional .java files for android, you have to addin extensions/extension-name/ext/platform/android/ext_java.files an additional line with the url of the .java file.
This way, you are able to import them inside your java implementation for the native extension.