Using existing java code in Android Studio or eclipse - java

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.

Related

Why is it impossible to start a project for android in IntelliJ?

I have been trying to create an empty Android Application in IntelliJ and cannot get it to work at all. All my issues are with Gradle refusing to be cooperative with the basic dependencies needed for Android development.
I have spent hours messing with different versions of gradle, java, and android sdk. The most confusing thing for me is that it is a brand new project. It should work before I start changing things already, so I'm not sure what I am doing wrong. I have tried starting a project in Android Studio and that works perfectly fine.
Does anybody else have issues using IntelliJ for android development? Is it more common practice to just use Android Studio or is IntelliJ more the industry standard?
IntelliJ is a Java IDE for java programs, because Android uses Java (or Kotlin) it has a plug-in so you can make Android Apps. Android Studio is designed solely for the purpose of making Android Apps and has a lot of great documentation and user-friendly features. Back in the day before Android Studio people used Eclipse to make Android Apps and it became depreciated and everyone had to switch and learn Android Studio. If you do manage to get IntelliJ working, likely in the near future it will become depreciated and you will just have to learn Android Studio anyway.

Is it possible to integrate a C++ Solver like IPOPT in an Android App using Android NDK?

I am working on a Android App which will be used as an assistance system for electric vehicles.
For the optimization purposes I have to solve a nonlinear optimization problem with nonlinear constraints. I want to integrate a powerfull Open Source Solver like IPOPT to do that.
I tried to install the solver on my Galaxy Note 4 following these instructions
http://www.coin-or.org/Ipopt/documentation/node14.html
and using IPOPTs Java Interface
http://www.coin-or.org/Ipopt/documentation/node16.html
without succes.
Is there a way to integrate IPOPT using Android NDK or rather a cross compiling approach?
Or is there an alternative approach to do this?
I would be thankful for any help which brings me closer to my goal.
The most difficult part here is due to the fact that IPOPT uses a lot of Fortran code, particularly in its dependencies, like BLAS and Lapack. In fact, you will will very rarely find anybody even trying to compile those for Android, due to the difficulty. Nonetheless, I did it, and recently released exactly what you are looking for.
Here is a simple Android project which uses IPOPT: https://github.com/jeti/android_ipopt_example
It was uses the IPOPT libraries available through this repo:
https://github.com/jeti/android_ipopt
which were, in turn, created using the standalone Android toolchains with Fortran available through this repo:
https://github.com/jeti/android_fortran
I decided to use this solver:
http://www.joptimizer.com
The building of IPOPT using the NDK toolchain has caused too much effort. Maybe it will be an opinion for another project.

How can i get android native java debuging codes with codenameone

is there a way or feature that give us possibility to see the native android codes after debugging the project with codenameone? right now we are just seeing the .apk file from the project not android java source.
I want to explore the android java source and editing them.
This is only useful for debugging, converting then using the sources is pointless as mentioned in the comments since the C code generated for iOS is not maintainable (its over 2000 files for a simple app).
To do this just use the include source feature: http://www.codenameone.com/how-do-i---use-the-include-sources-feature-to-debug-the-native-code-on-iosandroid-etc.html

Using Kryonet with Libgdx

Hi so I know how to use Kyronet and libgdx but what I want to know is when installing the Kyronet library do I only have to copy it into the Main project folder or do I have to put it in the Android and Desktop folders as well or do I have to do that attach source with?
I'm only asking here cause I can't find any documentation on installing Kryonet and want to cover all of my bases
Never used kryonet, but if it's no android native components dependent, it's ok if you just import it in your main project.
Regarding including source code, there's no need unless you're planning to make frequent changes to it.
In my previous projects, I've had to add it to the build paths of both the Main project and the Android project.

OpenFeint with cocos2d-x (iOS and Android)

Apparently OpenFeint supports both iOS and Android. Great.
But how do I integrate it with cocos2d-x Android? The SDK is, apparently a .jar and such. Cocos2d-x uses c++.
I don't get this tutorial: http://blog.molioapp.com/2011/11/openfeint-and-admob-integrated-with.html
I copy & paste the code and immediately I get errors (JavaVM *gJavaVM;? There is no identifier called that way!)
Are there any other steps not mentioned in that tutorial I missed?
Yes. In order to build a C++ library for Android you need to use the NDK. Getting that set up is pretty involved so I am just going to link you to a separate tutorial that has already covered it.
http://developer.android.com/sdk/ndk/index.html#installing
That is the Google documentation on getting up and running. There are other resources for this as well if you have trouble.

Categories