Compiling LibGDX on Android with Jvdroid - java

I am getting back to coding Java after two years, which I sorely missed. I need to set up an environment on Android for game making, so I purchased Jvdroid for the ability to process Maven files from GitHub on my phone. Jvdroid resembles a similarity to IntelliJ from JetBrains with much less features. LibGDX offers a Project making executable JAR, yet the file limits it self only to Desktop operating systems.
My problem then focuses on getting a LibGDX Project for a hopefully simple set up. It is possible that Jvdroid may still say no to downloading required libraries for compiling. I will not be able to use LibGDX I think on Android, if that proves true.
I am familiar enough with GitHub, where I can just download a working sample Project for LibGDX from a different programmer's repository or LibGDX's own. Flappy Bird is a bad example, but that serves just to give you an idea.
If that concept fails, then I would possibly consider an alternate game engine like Cocos2D or Haxe. I need some thing with GLTF file support in the future, because of my love for Daz3D. I also restrict my coding to Java.
I appreciate insight for how LibGDX may possibly compile and run on Android. I believe producing an APK would be comparably good effort at that far of a point. I am aware a couple of other programmers have successfully done such with minimal Project files at the least of it all.
Thank you for reading and your time.

Not familiar with Jvdroid, but I would have looked at Termux and see if your device's OS version is compatible and your device has adequate storage (RAM/Flash). Termux simulates a Linux terminal environment (with limits), so it helps to be familiar with the command line interface. Do realize that there are preferred places to download as Google Play policies no longer compatible.
A quick search brings up projects like: https://github.com/ravener/libgdx-termux which may be a jumping off point.
Of course, if you can do development on a PC - your experience will be better, due to each new Android version adding restrictions to such an environment.

Related

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.

Python for Android Apps

I've learnt python recently and I want to make an app for android. But everywhere on the net, it seems Java and Eclipse are the only ones that can be used.
So, my question is:
1) Can I use python to make an android app?
2) What kind of platform should I use to make an app with python?
Thanks guys!
If you're just looking to run Python scripts, try QPython.
If you're looking to make your Python code run like a native app, or just something more robust than the above, try SL4A.
If you're looking to effectively use Python as a library, and compile an .apk with the Python library included, try Kivy: github.com/kivy/python-for-android.
That said, you'd likely get a lot of benefit from learning Java, and not just for programming natively in Android (which would give you access to a much wider feature set and make your app run more efficiently).
Check out the Scripting Layer For Android, aka SL4A.
Here is a blog for getting started. The blog promises more entries in the series but there don't seem to be any. Still, it is a great starting point. There's quite a few parts to pull together so be patient and check the bottom of that blog entry for dozens of useful links.
If you want to contain everything to the Android device, including the IDE (pretty slick), check this out.
Here's a book from APress that could help with more advanced concepts: Pro Android Python with SL4A

Why I can't use JMF on Android?

I don't really have or want to use the Java Media Framework (JMF) on Android but I am looking for detailed information about why it's not possible to use it. (I know that it's considered as outdated anyway and I am aware that there may be better ways to achieve certain things in Android using this for example: http://developer.android.com/guide/topics/media/index.html)
Nevertheless I need more information regarding JMF on Android but all I could find is, that "JMF isn't working on Android" - but I wonder why.
So I have two questions:
Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android? I wasn't able to find something like that.
Why is JMF supposed to be not working on Android? I am interested in the technical details and would be grateful for all kind of references.
Thank you!
EDIT:
To be a bit more specific and clarify my approach: I built a tiny test-app and tried to play an audiofile the same way as I have done in a standard java desktop application (which was working as expected). I included the JMF.jar (for now without any modification) compiled, deployed and started the app - no problems so far. The (first) exception (javax.media.NoPlayerException) is thrown when calling Manager.createPlayer().
That was actually the point where I stopped and wondered if it's worth digging deeper, although the result is kind of predictable. I decided to ask about the technical background first, instead of figuring it out the hard way in hours of testing and debugging (the reason is not a lack of interest but unfortunately a matter of time at the moment).
I am looking for detailed information about why it's not possible to use it
Because it was not included in the Android SDK. Lots of things from Java SE were not included in Android.
Do you know any kind of "official" statement, for example from Google or Oracle, saying that JMF isn't supported on Android?
I am not aware of such a statement. They also have not released a statement indicating why Android does not integrate with the Hubble Space Telescope, why it does not include shoe-shining APIs, etc. There are an infinite number of things that are not in Android; it would be impossible to list them all.
More generally, Google faces pressure to keep a lid on firmware size, as the bigger the firmware, the more expensive things get (required storage, OTA update costs, etc.). Hence, they only include a subset of the Java SE SDK as one way of helping reduce firmware bloat.
Why is JMF supposed to be not working on Android?
Because it was not included in the Android SDK. I have no idea if it is possible, let alone practical, to create a fork of JMF that offers a JMF-like API but uses Android media capabilities under the covers.

Android development without SDK

To get a better understanding of what I'm actually asking let me outline my situation (I think the wording of my question is off, but couldn't think of how to word it better).
I'm currently working in a team of 4 people to develop a basic OCR app. I'm focused on the algorithm side, developing the pre-processing and implementing the OCR. I want as little to do with the app side as possible; as from what I've read so far, it is quite a steep hill to climb and I have enough to do without learning to develop the app from scratch.
So my questions are:
Is it possible to develop my code in a black-box style that I can hand to the app developer and say "Here's a list of functions, go for your life"
Is it possible to do the aforementioned in a way that I can test without the Android emulators?
Is it possible I can do all that without even needing the Android SDK? (given that I can develop my code to deal with specific formats of information. e.g. int[][] for pixel data)
You can certainly write and develop the algorithm without a dependency on the Android SDK, and ship an artifact (whether source code or a JAR) to the Android developers.
However, you will be able to reduce the length of the feedback loop if you at least have an Android test project that takes whatever artifact you ship to the Android developers, and run at least some tests on it - given the number of differences between the Android and Java SE runtimes, it is practically guaranteed that you will run into bugs due to platform differences.
Update: If you write native code or use a native library, I do not think you could easily give a working artifact without using the Android NDK.
As long as your code has no reliance on the Android SDK then certainly you can develop and test without it. Just be certain your code also has no reliance on other APIs (AWT, for example) which are not on the Android platform if Android is your intended target. Finally, be sure that testing is complete within the Android environment, once you're satisfied things are working in general.

What are the limitations of Python on Android?

I am getting ready to start a little Android development and need to choose a language. I know Python but would have to learn Java. I'd like to know from those of you who are using Python on Android what the limitations are. Also, are there any benefits over Java?
Most of the points mentioned by Andrew stand, I just wanted to mention that python can be and is used for full fledged Apps published on GooglePlay and even iOS. I can't speak for other frameworks but here are some examples of Apps published using Kivy.
Process Craft Google Play iOS
Fantasy War hammer
PreseMT is a multitouch presentation maker
Memo robots
Ground Truth
Kaleidoscope
Showcase demo example from Kivy project
DefelectTouch game iOS
Bargenius and many more...
On Packaging we have tried to make it as simple as possible, we also provide
A pre-built VM that can be used to make your apk with you having to do nothing except
copying your project dir over and running one command.
On GUI, yes the ui is custom, by default(tries to match Android's Holo theme). However it can be customised to resemble other look and feels, although I haven't tried it personally.
Oh and as long as one is talking about python based apps on android, I found this project mentioned on stackoverflow PyMob, their apps page mentions some interesting apps .
I investigated this recently for similar reasons. My conclusions were that I could not use Python to develop a native-looking application, which is what I wanted at the time. Specifically:
Python can't receive callbacks from the Java UI classes, so you can't use any native Java UI elements such as ListView, etc. Only dialog boxes etc. are easily available. If you have a totally custom UI such as a game, you can try PyGame for Android, or you could look at Kivy, which also uses PyGame.
Packaging of Python applications is very difficult, especially because the Python interpreter is not included on Android by default. The Kivy and PyGame teams are making some intermittent progress on this.
Because of the aforementioned issues, Python is essentially never used to make full fledged applications published in the app store, and so the literature on how to handle the many sundry issues with SL4A (Scripting Layer For Android) is very thin.
So, if you want to make an application that uses native UI elements, that you can actually distribute in the Play Store, or both, Python is regrettably not an option.
I have developed Android Apps on the market, coded in Python. Downsides:
Thus far my users must download the interpreter as well, but they are immediately prompted to do so. (UPDATE: See comment below.)
The script does not exit properly, so I include a webView page that asks them to goto:Settings:Apps:ForceClose if this issue occurs.

Categories