Getting started with JUCE for Android - android

I need to start building an Android app that uses the JUCE libraries. I'm reading the web site and trying to figure stuff out.
I tried installing JUCE on an Ubuntu 11.04 system, and when I built the IntroJucer app, the menus don't work right (they flash open when I click with the mouse but then disappear). Can a JUCE app for Android be built on Mac OS X, or even Windows?
If you are using JUCE to build Android apps, please give me any advice you can.

Yes, a Juce app can be written for Android using either OS X (XCode 4) or Windows (Microsoft Visual Studio 2008 and higher). You also have the option of using the Eclipse IDE on either platform.
At the time you posted, Juce was undergoing a major overhaul and the IntroJucer might not have been as stable as it needed to be, especially on systems other than OS X or Windows. You should look into it again. IntroJucer is not required to build a Juce Application (although it can make things easier).
I suggest you first build the Juce Demo application for your platform. If Ubuntu is giving you trouble, try OS X or Windows first. Once you have the Juce Demo running you can move on to IntroJucer. If that works, then try compiling Juce Demo for Android. Your questions can be answered in the Android Juce Forum:
http://rawmaterialsoftware.com/viewforum.php?f=13

Here is what I have figured out now that I have been working with this stuff for a bit.
All of this is based on the most recent "stable" release of JUCE, which is about ten months old as I write this. It is quite possible that things have changed (for the better!) in more bleeding-edge releases of JUCE, and when I get a chance I will try a newer JUCE.
The best platform is Mac OS X. When I tried Linux I had some issues with Eclipse not working; I still prefer Linux so I'm going to go back and try again, but on Windows and Mac I had no Eclipse troubles.
Start by installing the Android SDK, and running the updater to grab all the updates. Also install the Android NDK, and Eclipse. In Eclipse, install the ADT plugin.
JUCE sets up an Ant build file that will build all the C++ code for you, automatically. You need to not mess with this. I had a problem where there was a task called "setup" and Ant didn't know how to resolve it; the solution was to delete the "setup" task and not touch anything else. When I was trying to figure out how to solve this issue, I found suggestions here on StackOverflow to run this command: android update project --path . DO NOT DO THIS for JUCE. This re-writes your build.xml file and the special JUCE stuff to build the C++ code disappears; then you build and you get a tiny .APK file (about 10 KB) that contains only the Java setup code and no compiled C++, and does not work. So, just to be clear, the solution to the "setup" build problem is to delete that build task and touch nothing else, and not to completely replace your build.xml file.
The JUCE build process relies on a Bash shell script to do some work. On Mac OS X this works great; on Windows, the build fails with an error from CreateProcess() because CreateProcess() doesn't understand Bash shell scripts. It should be possible to edit this and make it work, but out of the box it works perfectly on Mac OS X.
For testing your code on an Android device, you must sign your code. Eclipse makes it easy to build either signed or unsigned .APK file, but the unsigned file is nearly useless. The only thing you can do with an unsigned .APK is run it in the emulator.
Once I had all the above stuff correct, I had no problems with building the JUCE app for Android.

Related

Love2D making self-executable with no unpacking

Im create simple game, remake my old ZX-Spectrum game "m2k"
Love2D is simple engine using LUA.
What i need:
Compile Love2D -> exe files, linux binary, android apk.
Goal is pack Win32, Linux64 bit and android apk WITHOUT possiblity of just unpacking .love file and WITHOUT manual installing love2d engine.
https://pp.userapi.com/c637425/v637425257/4a8a8/QCv9Q5dz_b4.jpg
I cannot found anything useful about it. I found LoveExporter 0.2 by shake but this utilite fails compiling normal binary. It fails with error.
All manuals tell me just create .love file and send it to all. No way.
It's no good for me.
Maybe i can run this utilite. I fails with 0.2 version maybe 0.1 works
http://snake174.github.io/html/programs/love_exporter.html
Partially it works, but it requires Microsoft Windows, and android support is broken. Developer not create new versions about a year +.
I don't want to pay for windows, reboot to windows or another using unsafe OS, and requires Native full work analog.
etc
Compile Love2D -> exe files, linux binary, android apk.
The wiki already has a guide for creating executables for Windows, Linux, Mac and Android. Unless I'm misunderstanding your request, you need this.

Use Sublime Text 2 to develop Phonegap applications for Android

I've been using eclipse to develop Android apps with phonegap until, a few weeks ago, I decided to try Sublime Text 2. I found it to be so much better than the eclipse editor so I would like to keep using it. Only thing I'm missing is a quick way to test the app on the device inside Sublime.
Luckily, someone else also had the same idea and developed a plugin for this:
https://github.com/Korcholis/Andrew
Sadly, I cannot get it to work, I installed ant and pointed the plugin to adb but then nothing happens when I try to create a new project (and there is no error message in the console).
I also found this other plugin:
https://bitbucket.org/ucomesdag/sublime-android
But I have no idea on how to install and run it.
Did someone else found a way to do this?
A quick update into 2014.
As of PhoneGap Cordova 3.0, it is no longer required to develop Android apps via eclipse. You are free to use any code editor or IDE you wish as app building is done independently from eclipse via a simple command line.
cordova run android to package the .apk and install on any active devices detected by adb or
cordova build android to package the .apk only.
In your case, you can keep using Sublime and pop in the cordova run android command whenever you ready to go on a test run.
While I agree with Insane Coder that you should stick with supported IDEs to develop for Android, according to this link and existing Sublime Text 2 Ant support, you could build and develop your android project with this IDE (It will just take some time to set it all up... as opposed to using a supported IDE like IntelliJ or Eclipse).
Using PackageControl, look for "Ant". That will install syntax highlighting for Ant. Another plugin that enables the build command (ctrl+b) to work for Ant files, "Super Ant". You should be able to code for android in sublime text 2 with those installed.
On another note... Do you use windows? The Andrew project you link to, seems to have Windows compatibility issues. Apparently related to locating the "SDK" (he says sdk in Andrew's github page but, probably he means JDK?) in your hard drive. Which is probably a hassle because Windows typically installs stuff to "Program Files" and in code, that turns into "Progra~1" because of the space. In the link I give you there is another approach to it, so when you install the JDK set a folder that has no spaces in its name, like c:\java\jdk1.6.0_02 or something else that strikes your fancy. The problem you could be having with Andrew is that it isn't finding the jdk in your hard disk.

Build/Package Android application with rake?

Is it possible to build an android application with rake? The only other question on this subject I saw was a while back and someone advised using Gradle.
So is there any way to do this on the command line, as I am sure under the hood eclipse just runs a lot of command line guff to get the apk file generated then spits it to the device, I just want to generate the apk file (there is alot of other things to be done but these are prior to the APK building).
Is it possible to build an android application with rake?
Yes, insofar as it is possible to build an Android application using Ant, and rake can in theory do everything Ant can.
If you are expecting to find an existing rake script, though, you will likely be disappointed. The Ant scripts necessary to build an Android app are rather substantial, and porting all of that to rake will take quite some time. And, then, they will perpetually be out of date, as those Ant scripts are often modified with Android tools releases.
Here's a small example project that's worth a look: https://github.com/jberkel/android-helloworld-rake
I've been meaning to try it out myself.

Ant versus Eclipse builds for Android: Strengths of Each?

I've used Eclipse and vim variously as development environments for Android applications and found both the Eclipse plugin and the command-line SDK tools to be of similar capability.
Since I haven't explored either in its entirety, however, I'd like to ask:
What advantages are there to using Eclipse over the command-line tools and vice-versa?
I could see:
(Eclipse) nice GUI for debugging
(ant/adb/android) more amenable to automation
(hybrid) you can have it all, can't you!?
I'm especially interested in specific features that may be a deal-breaker for one and move a developer in the direction of the other.
Using Eclipse as a development environment for Android doesn't preclude you from also building with Ant to hook into nightly builds or CI tools. You could even configure Eclipse to build using your Ant buildfile if you wanted. If you want some kind of CLI build tool, you might also consider Maven, as it also has plugins to enable building Android apps.
It has been some time (like six months) since I have used eclipse, so maybe it is better now, but I gave up on it because I found it to be very slow and buggy. Maybe it is the integration with ADT, but several times I spent hours hunting down problems that turned out to be fixed if I killed and restarted eclipse (and these problems were not fixed if I did a "clean" within eclipse). After doing that a few times, I felt like throwing the computer against the wall.
"ant clean" is much easier and faster than stopping and restarting eclipse.
Across my personal projects and multiple professional instances of building Android apps, I've always used both types of builds. You'll want to use Ant (or Maven, if you prefer) to set up continuous integration and automated testing. Trying to get that working with Eclipse (which I did a long time ago when the Android SDKs were first coming out) is a nightmare, while Ant/Maven is easily used from any of your favorite CI tools (I've usually used Hudson for this). If there's nothing unusual about your project, it'll be a snap to put together continuous integration, and off you go.
Meanwhile, for just day to day development work, using Eclipse to build your app locally works just fine. But that can easily be left up to the individual developer. I'd make the build that your CI system is running the canonical build, but I do use Eclipse for my normal development.
I'd use Eclipse until such time as you are happy with the debug build. Then you can set up Ant to produce the signed release build.
You can set it up to use the same source files as Eclipse but put the output binaries outside your workspace. You can also set it to use your release.keystore, sign it automatically and obfuscate the code all in one go.
I've set it up to do this. I open a command line (DOS box) move to the projects home directory (\dev\projects\Eclipse\Project1 say), I type "Ant release" and the apk ends up in \dev\projects\AntBuilds\Project1\bin as Project1-release.apk.
If you want the best of both worlds, you might want to look at the m2eclipse-android-integration Eclipse plug-in which allows you to use your command-line Maven build in the ADT/Eclipse environment as well:
https://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/
Well for me im just a beginner, but I find eclipse much easier to work with. Android is a pretty complicated to get used to (for me) so having everything layed out in a GUI is preferable to command line. Plus SDK updates and such are easier to get.

What do I need to do to compile Android NDK (C++) aps in Visual Studio 2010?

I've read in different places that this is possible. I do not need to debug, just compile. Any walkthrus out there? Thx.
Found links:
Android NDK with Visual Studio - "we've got it partially working, we use Visual Studio to build, using the proper android headers and whatnot, then we call the NDK build scripts. we're currently working on automating the second half as a post-build step"
http://groups.google.com/group/android-ndk/browse_thread/thread/9f3a55366ba08f2a/cb539c80e5729032 - "You have to dig out proper parameters for all the tools, but I assure you
that this all works for me on command-line (well actually in various bat
files called from MS Visual Studio)."
Building and debugging Android apps within Visual Studio is OK. No need to mess with Eclipse, or post build steps.
I've got it running myself, here is a screenshot:
http://www.gavpugh.com/2011/02/04/vs-android-developing-for-android-in-visual-studio/
In case you get "Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre6\lib\tools.jar" you can add an environment variable JAVA_HOME that points to your Java JDK path, for example c:\sdks\glassfish3\jdk (restart MSVC afterwards)
If you like you can also debugg Android apps within MSVC using this:
http://ian-ni-lewis.blogspot.com/2011/01/its-like-coming-home-again.html
Download WinGDC for Android from http://www.wingdb.com/wgMobileEdition.htm
Microsoft (obviously) doesn't seem interested in supporting this:
http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/6641879e-6f47-403a-9ed5-28bb6e040563
Why not stick with Eclipse since that IDE will integrate with the compiler/debugger for the android target (including debugging the native library, I think).

Categories

Resources