Some background:
FTC (First Tech Challenge) is a competitive robotics league that uses Android-based software to make a robot function. In my organization, a majority of programmers come from our school and thus, they often find themselves programming on school-issued Chromebooks with restrictive software. Normally, we would program on Android Studio and it would work perfectly fine. By using Gitpod though, we can essentially have an unrestricted IDE on those computers and thus, I began trying to make this work.
Basically, how can I use the SDK in Gitpod or in VS Code (since they both use VS Code Browser)?
Clone this repository.
Add .gitpod.yml and .gitpod.Dockerfile files and add correct code in there
Install Android SDK via apt-get install android-sdk
Install Command Line Tools by cloning the .zip folder and extracting it to the correct place
Build the project with ./gradlew build (build runs out of JVM memory)
Type out Mo and see if intellisense suggests MotorEx, a class in the SDK.
Fail :(
Related
I have been tasked with developing an Android and iOS application with PhoneGap (http://phonegap.com/)
However, as I read, things start to get really complicated: Some people say Cordova (http://cordova.apache.org/) is now PhoneGap, others say PhoneGap is just a distribution of PhoneGap.I lost 3 days and still can't find a proper way or a guide to install a fully functional PhoneGap plugin either in Eclipse or Netbeans running Ubuntu 12.04 64-bit.
What I tried:
1. Installing Eclipse, installing MDS AppLaud Phonegap Plugin (http://marketplace.eclipse.org/content/applaud-phonegap-android-jslintjshint#.Utf1JPiSTh8). This one actually installed at once, and it actually lets me create a new PhoneGap project in Eclipse, however, the I cannot select any SDK different than 4.4. (?!)
2. Installed NetBeans and after I tried to install phonegap and cordove through nodeJS it failed, again.
My question is:
Which one I should install and how to do it in Ubuntu, using either Eclipse of NetBeans?!
Edit:
OK guys, I just found out how to install nodeJS and PhoneGap on Ubuntu 12.04: http://paste2.org/1OnX6M6F . Still trying to integrate it in some IDE for the real thing, though!
If you want to basically start developing an app, I suggest this for PhoneGap:
These are the steps I used to install PhoneGap on Ubuntu. Take note, this is for PhoneGap version 2.8.1. Personally I was not able to get nodeJS to install the latest. If you need the latest to be installed, check around on google. Referencing This tutorial.
Step 1
Install Java 7 JDK
Step 2
Install ANT
Step 3
Download & Extract PG v2.8.1
Step 4
Download Android SDK
Step 5
Set up environment variables
Step 6
Create base project
./create location/to/put/project package_name project_name
Step 7
Import Project into Eclipse
File->New->Android->Android Project From Existing Code
Browse to where you placed the project and select it
Now you can start developing.
Reminder: This is the way to do it for v2.8.1 of PhoneGap. Different versions(especially 3.*) will be different (nodeJS)
Look at http://docs.phonegap.com. Read the "Overview chapter, then "Platform Guides" and "The Command-Line Interface". Follow the steps and in the end you should be able to build your app. It takes a while but it's worth it.
I havn't integrated cordova/phonegap in my IDE. I just created the app with the command line interface. In netbeans I created a HTML5 project and linked the app-root/www directory into this project. I'm programming with Netbeans and building and running the app with the command line interface. That's all.
In order to have some code completion, I have written an extra class (facade) which encapsulates the phonegap code. It just delegates its calls to the phonegap API. That is especially nice if the phonegap API changes as it only affects my code in that particular facade class.
The last thing I want to share: I found out that the build and run process with the command line interface is pretty slow. Executing cordova prepare android and then running the android project in Eclipse/ADT is a lot faster.
OK, to put it simple:
PhoneGap - The original project developed by volunteers
Cordova - The Apache's version of Phonegap, which has exactly the same documentation and functionality as the original PhoneGap but is integrated in NetBeans 7.4.
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.
Hi I'd like to know how to compile an app source code on an android platform?
I know it's possible because I saw some apps that are doing it...
Thanx ahead!
I think what you are asking for is a way to compile android apps on an android device.
the way an app like this new IDE does.
If so what you would need to do is to take an open source java compiler such as the ejc (the Java compiler used within Eclipse) and use it to compile your java source. You would then need to port the dalvik compiler to be able to run, in order to generate dex from the class files generated by the java compiler.
An interview with he developers of AIDE has a little bit more info on how they did it.
UPDATE:
Actually I just came across an open source project which provides similar functionality but based on using vim and the existing SDK cli tools ported to run on a an android device. The project is hosted here.
UPDATE 2:
I found yet another open source project that also does on device compile/build which I think should provide you with examples of what you are trying to do...
More specifically, if you look in IDE.java, you can see how the individual tools (ejc, dx, aapt) are called/used.
Possible in a number of ways...
There have been apps - proprietary & open source - built for the purpose. I am not sure if these apps will be at least near the production quality. But they work:
It mainly depends on language you are writing - since cross platform app development is also possible on Android.
• Java: Java N-IDE, AIDE
• JavaScript: NativeScript CLI, Appcelerator Titanium CLI, Apache Cordova via CLI. [All these can be installed via node.js package manager (npm) which in turn can be installed via Dory NodeJS, GNURoot Debian or Termux apps..
• Linux CLI utilities can be installed on Android simply with a terminal shell or GNURoot / Termux. You can also Emulate complete PC OS using Limbo PC Emulator / Bochs [Although they should be lightweight]. In theory, by this way you should be able to use almost all Android development utilities. But Storage, memory & performance constraints come to play..
• There are other apps & web services for hobbyists: eg: Sketchware, DroidScript, Appy Pie, Monaca, PhoneGap Build and many others.... But don't expect professional quality apps using them..
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 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).