How can I reference an adk resource in another Android project?

I am developing a research project using the mosembro project (mobile semantic browser) in my Android project. I use Eclipse and I created my project, uploaded / imported mosembro and included it in my project build path.

So now my code should reference the resource in the mosembro project. I want to do something like this:

String commonJS = getScript(R.raw.common);

In this snippet, I want to download the javascript file from the mosembro: project res -> raw -> common.js, so I need the java syntax to get the "R" (precompiled resource class) Mosembro from my HelloGoogle project.

What is the syntax for replacing R-classof thiswith an included project R-class.

It is clear?

+3
source share
1 answer

I found the answer, and it is very simple. You can add projects to your project through the Java build path.

  • Right-click on the project you are working on.
  • Select Build Path -> Configure Build Path ...
  • Then select the tab Projects
  • Finally, click the button Add...and select the project that you want to include.

This saves everything in code synchronization if you make changes rather than cut-n'-paste.

+2
source

Source: https://habr.com/ru/post/1751692/


All Articles