I have gone through the Android guide for other IDEs, and I've got the basic build and install working fine using ant and a simple Emacs compile command. I'm aware of some of the existing tools for developing Java and XML in Emacs. I've also seen the EmacsWiki page recommending two Emacs packages, EmDroid and android-mode
I'd like to hear what people recommend, in terms of Emacs packages, small functions, or just workflows.
As a side note, I have decent familiarity with Eclipse, and I did setup the ADT plugin. However, emacs is my primary editor, and I'd like to see how I can use it here.
I too use Emacs for my Android development.
Although I do not use any Emacs packages for it.
Simply write in Emacs and then from a terminal use the android-sdk (ant, android, keytool, jarsigner, adb).
You can always use M-x compile from within Emacs, but I usually prefer a plain old bash shell for Android.
Sorry my work flow isn't really exciting.
Currently android-mode.el is in better shape, plus you can easily fork it to add your own submissions to the developers over Github.
Both of the modes are pretty basic however, and just give you a set of functions to call the various Android development tools.
You are probably aware of jde and ant-mode.el - if you're not, I've just mentioned them.
They'll help you with the general Java / Ant support you'll need for Android SDK development.
You can try Android-emacs-toolkit. http://code.google.com/p/android-emacs-toolkit/
Android-emacs-toolkit helps to build android development environment on emacs. It contains a emacs major mode which help to develop android sdk and ndk program.
It provides support for create new avd, launch avd, create new android project, build and rebuild Android sdk project, build and rebuild Android ndk project, install and uninstall apk, run executable ndk project, output emulator log on emacs.
This toolkit tested on WindowsXP/7, Ubuntu11 with android-sdk and android-ndk-r7.
For building Android itself (ie. AOSP, CyanogenMod...), look in the $(TOP)/development/ide/emacs directory. ATM, you'll find android-common.el, android-compile.el and android-host.el.
These can be used to make modules/packages inside Emacs, replacing commands like mm and mmp.
Related
I am new to Android app development. I have a source code and would like to modify some xml/java codes. Can I use the Brackets editor for this? I don't want to use Android studio as it's a bit complicated for me.
If you really want to, you can edit source files in an editor of your choosing and build the app manually via terminal. Actually, this is how it's done on Continuous Integration systems.
Typically Android projects are using Gradle build system, and come with Gradle wrappers. After you are done editing, you can just invoke it to assemble the release APK signed with proper keys as discussed in How to create a release signed apk file using Gradle? thread. Note that it would require you having downloaded Android SDK and configured your paths properly, which would be tricky for a beginner, yet completely automated in a proper IDE.
If you are unlucky, it could be an old Eclipse project, or using some less popular build system, like Ant.
As you are new to Android development, I think you should go the more simple route and just download Android Studio and import your project.
I received a full working project's sourcecode for an app written in java.
to set up my win7 machine I followed these steps:
http://www.javacodegeeks.com/2013/03/setup-your-java-development-environment-in-windows-7.html
i opened eclipse and need to work on this project, but have NO idea how to pull in the project with all its files so I can actually run it and test it.
I need to make changes to this project.
the folder is located in MyDocuments folder called Budget
within Budget I have:
.metadata
dev (see screenshot of what is in this folder)
can some one help me setup everything? I have never done this, I am only familiar with XAMPP
i also looked at
How to open an existing project in Eclipse?
i tried it and get files and filders in the navigation pane, how from here?
What you have installed is JavaSE SDK plus a lot of other stuff for regular Java development. But in your screenshot I can see that your project has a Blackberry and Android versions. To develop in these platforms, your Java SDK install is not enough. You'll need to setup both BB and android development environments in your machine. You'll probably need:
For BlackBerry:
Blackberry Java SDK (check which version was the BB subproject made for)
Eclipse with BlackBerry Java plugin. There used to exist eclipse versions with the BB plugin already installed available for download in Blackberry's site. If you don't have one, this is the one you want. And if you already have an eclipse, resist the temptation to just add the BB plugin to it. The BB plugin messes up with almost every other plugin you might already have. Also each plugin was made to a target eclipse version, so just download the bundled eclipse+plugin from BB and be happy:
http://developer.blackberry.com/bbos/java/download/
Also some simulators for your target platform. I think the eclipse plugin comes with one already installed. They are really slow though, so you might want a real device instead.
For android:
Android SDK
An eclipse with the ADT plugin, if the project was made with eclipse, or the newer Android Studio. This eclipse plugin is better made than BB's so you won't need a dedicated eclipse like in BB's case.
Simulators are made with the ADM tool included in the SDK.
Good luck!
All the people that I work with use Eclipse for creating android apps. However, I recently found out that Android is no longer supporting Eclipse and they are moving to Android Studio. All that apps that I am working on have been complied and created with Eclipse.
I'm thinking if the code and the programming language is the same, then the compiler or the IDE shouldn't matter. Would we be able to still work together and share code if I switched to Android Studio and they stayed in Eclipse? What are some of the potential problems?
No, the two IDEs use different project structures, but Android Studio has a very nice wizard that allows you to move your Eclipse project to AS. I really recommend you and your team to move to AS.
As already stated, everybody would have to make the switch to Android Studio at the same time, and you would need to make some changes to the build system.
Until everyone makes the switch, you should just use the Eclipse/ADT bundle.
You can technically keep the same old folder structure for source files when porting a project to Android Studio (we tried it, it works), but the different build system is the main change that throws a wrench into the works.
Eclipse uses the ANT build system for Android projects.
Android Studio uses the Gradle build system.
We are in the process of planning a switch at my work, and everybody will need to switch at the same time, and the build system will have to be ported from ANT over to Gradle.
See more about Gradle: http://tools.android.com/tech-docs/new-build-system/user-guide
Migrating old projects to Android Studio: http://developer.android.com/sdk/installing/migrate.html
*edited for clarity regarding folder structure
I've been reading up on PhoneGap and really like it. I'd like to see if I can use it with GWT to write Java apps that deploy to many different platforms (web, mobile web, android, iphone, winphone, etc.).
It looks like the PhoneGap SDK comes with different versions of cordova.js for each native platform you want to support. So it looks like the Ant build will have to somehow package the GWT-generated JavaScript to the correct version of cordova.js:
3098DJU39I4F9IF9.html + cordova-android.js
3098DJU39I4F9IF9.html + cordova-iphone.js
3098DJU39I4F9IF9.html + cordova-windows-phone.js
I'm generalizing here, and I know those aren't the correct file names (although, obviously, 3098DJU39I4F9IF9.html is the GWT-generated code).
But then something has to kick-off PhoneGap's ability to take each of those pairings and produce the correct packaged container: an APK, IPA or XAP for each platform respectively.
So I first ask: how does a PhoneGap developer normally go from 3098DJU39I4F9IF9.html + cordova-android.js to having a myapp-android.apk, or from 3098DJU39I4F9IF9.html + cordova-iphone.js to having a myapp-iphone.ipa? Does the PhoneGap SDK have a command-line tool that does this?
Once I understand that much, I'm trying to figure out how to automate this packaging/binding process from an Ant build. Are there any known Ant tasks that already do this? Or do I need to kick off a shell from inside Ant and just run the shell commands? Thanks in advance!
#rooftop is right, you have to build the native app using native SDK even if you are using Phonegap. The benefit lies in creating the UI and behavior of the app using HTML5, CSS and JS.
So, if you are not using any of the native functionality or custom Phonegap plugins, you can just have a bare minimum package structure of native apps for each of the platforms and then simply move the correct files into the concerned folders (in Android it is assets folder) of those package structures using copy task of ant. Thereafter, you can use command line compile and build tools specific to each platform to build and package the app.
Hope this helps.
EDIT: Added more details about other platforms
Basically, all SDKs contains command line tools. In fact I used to compile and build from command line, to automate the process, even for standard Windows apps (Console, Web Apps etc) which are usually performed via Visual Studio's easy to use environment. You can see this for extended tools over standard SDK for Windows phone development.
Similarly iOS is based on UNIX so there we get the power of majority of command line tools for compile, build and automation and XCode provides command line tools for building.
Further for Android, you may find this helpful.
You should really be using Cordova, the renamed version of PG that is an Apache project now. Command line tools were recently released for Cordova. I have not used them so I am not sure if they will help you with building or not. Typically the way you woul create the binary for the device, say an IPA file for iOS would be to actually use Xcode and the native SDK to compile and package your app. This means you need all of the native tools and SDK for each platform. There is also a hosted service from Adobe that will build the native bits for you for a fee. It used to be called phone gap build, not sure if that is still the name. You might want to look at IBM Worklight, as it does many if the things you asked about. The developer edition is free an Eclipse based for the IDE.
I have tried my hands on compiling a Java project with Ant from scratch. Is it possible in Android too? If I have only the source code, can I compile the project? If so, how?
Yes, it is.
Read the android developer website for more details.
There are a few things to keep in mind:
Android supports ant build scripts, the developer website, and the tools provided, show you how to do this easily.
But if you want to support different versions of android with a single set of scripts the best way is to write custom ant scripts (a single set, that will compile for all versions) for this as SDK Tools v5, v6, v7 and v8 all do ant builds differently. This requires some effort and planning.