I tried adding .jar files into my android project as a dependency but it didnt work, so now im trying to add just the java files I need. Lets call the file I want cookies.java, and then within the original package structure there is a util folder with 2 files cookies.java needs to execute lets call them cookieDough and cookieRecipe and the pacakage is located int net.sourceforge.cooking. So it it would end up being 3 files I need:
net.sourceforge.cooking.cookies.java
net.sourceforge.cooking.util.cookieDough.java
net.sourceforge.cooking.util.cookieRecipe.java
what I am trying to do is add a cooking folder with the cookies.java class and inside the cooking folder a util folder with the cookieDough and cookieRecipe classes. so:
cooking/cookies.java
cooking/util/cookieDough.java
cooking/util/cookieRecipe.java
My main program is under
src/main/java/packagename/
I tried
creating a java folder withing src, src/cooking
but im having trouble getting both the cookies.java to find the /util/cookieDough.java
and also for my classes withing src/main/java/packagename/
to find the cookies.java or the other files.
The files im adding already have package and import declarations but since im making them local I know I have to change these, I dont know if I need them to be a package all together.
Questions:
1- where is the right location to add the cooking folder within my project structure.
2- how do I get the files im adding to recognize each other, meaning how do i get cookies.java to find util/cookieRecipe.java
?, do I have to declare them as a package
3- How do I get my java classes in src/main/java/packagename/
to find the classes in the cooking directory, an import statement??
It all works if I just add the 3 java files into my main package and remove all import and package statements from them, but I would like to figure out how to do it the right way (best practices) and i am assuming I should have those files separate from mine.
BTW the files I'm adding are opensource.
Thank You