1

I am developing a word game. My aim is to have 90% of the code in pure Java, which is then referenced by Android Studio for an android app, by GWT to make a web solution and exported into objective C for iOS for the small amount of UI coding needed.

I have written all the code and I am only able to do this by manually copying the java classes between the projects. Clearly it must be possible as this seems such an obvious use case, but there does not seem to be a straightforward solution.

I realise I may be missing something. I have searched extensively, in particular the following:

Import source java project in Android project

Android studio add external project to build.gradle

Any help would be much appreciated.

3
  • 1
    What did you try, and in what way did it fail? At least in Eclipse It should be fairly straightforward to set up an ordinary Java project and then either reference it as a project from your app project, or export it as a jar which you then put on the build path of your app project. Did you try any of these, and if so, what happened? Commented Mar 23, 2015 at 12:32
  • Thanks for the response. I think the mistake was mine. I have been though this again and I think it was my mistake. I can set up a project in Eclipse as an android library project and put all the standard code in there. I am able to reference this code from GWT, and the mistake I made was that in GWT we need to have the .client package which meant my library package was not enclosed. The solution was to include the .client in the library package. Commented Mar 23, 2015 at 17:02
  • Happy to hear that. For the sake of order please consider closing the question (preferably by answering it yourself and accepting that answer). Maybe it helps someone else. Commented Mar 23, 2015 at 17:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.