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.
Related
I wanted to start developing for Android, but found it terribly hard to set everything up so it would work on Sublime Text 2.
I know that I'm supposed to download and set up the Android SDK, but how, where and why? And how do I compile my projects and run them? This is a complete mystery to me.
I've been researching this for about 3 hours now and haven't had any success. Could anyone of you, please, help me by guide me through the process of setting everything up in ST2?
Please note that I do not want to use Eclipse IDE. I've grown to love ST2 and I'd like to stick with it.
I know that I'm supposed to download and set up the Android SDK, but how, where and why?
Visit the official site and follow the instructions for "other/existing IDE". I don't think anyone wrote specific instructions for using Sublime yet though (since you haven't found one).
And how do I compile my projects and run them? This is a complete mystery to me.
As others already answered, other than a JDK, you will most likely need to download and run Ant from the command line.
If you really want start Andriod development, without using the great support of an IDE like Intelji Idea or Eclipse, then you should properly look into building and running your applications in the command line beside Sublime Text 2
If you follow the instructions for using the 'Andrew' software module from github, you can get sublime to communicate with the android sdk and ant build tool via a tool called monitor.
https://github.com/Korcholis/Andrew
Kind of similar to a vim addon i used to use that talked to eclipse service.
But if anyone else is reading this, intellij (android studio) has come on leaps and bounds regarding speed and autocomplete.
Eclipse and IntelliJ are the known supported IDEs for Android development. If you don't want to use Eclipse or IntelliJ, read up about ant scripts and how to build with Ant. That should get you started.
Sublime Text 2, right now doesn't support Android development from within the IDE. The only option you have, other than using Ant, is to wait for someone to write a plugin for that.
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.
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.
I'd like to learn Android app development but I don't want to use any IDE, especially Eclipse and its ADT plug in. It's just that I'm more comfortable with command line, executing commands myself and seeing what's going on beneath. I'm looking for a good reference/tutorial/ebook/walk through on the flow. Is there any such resources available?
From the android dev. website: http://developer.android.com/tools/building/building-cmdline.html
Ofcourse the title suggests using a different IDE, but it explains what directories you need, how to compile your .APK etc.
Ofcourse, you need de SDK and the tools from there, but that's a given. You can however use the above information to develop without Eclipse/ADT
I'd like to develop for Android but I don't really like using an IDE for programming as I find them to be pretty cumbersome compared to a text editor and command console. Is there any way I can develop for Android without doing so in Eclipse, and instead using Gedit? The system requirements specified on the Android developers site list Eclipse as a requirement, but I Ewas wondering if anyone had found a way to manually tap into the SDK libraries outside of Eclipse. I'm using a Linux setup as my development box.
You do not have to use Eclipse, it's just highly recommended because the tools are nicely integrated :
The recommended way to develop an
Android application is to use Eclipse
with the ADT plugin. The ADT plugin
provides editing, building, debugging,
and .apk packaging and signing
functionality integrated right into
the IDE.
However, if you'd rather develop your
application in another IDE, such as
IntelliJ, or in a basic editor, such
as Emacs, you can do that instead. The
SDK includes all the tools you need to
set up an Android project, build it,
debug it and then package it for
distribution. This document is your
guide to using these tools.
See this page on the Dev Guide for more info: Developing In Other IDEs
Yes you can do it with just the SDK and Ant (and the JDK of course). I'm doing it right now as an exercise in relearning Ant, and to make an 'idiot push button' procedure for a release build.
I've got to say that it's slow going just trying to configure the build process on sources that I know will compile. I'm glad that I've got Eclipse for the rapid development in the debug phase.