2

So the Pragmatic Programmer recommends using an IDE if you mostly develop on the command line and vice-versa. It would be nice to not only switch, but use those two side-by-side on the same project.

How could this be done?

To be way more specific:

There is a Android ant project vcs'ed by git which would be good to transfer/work side by side in eclipse. The project has a jUnit test suite that uses some Robotium calls.

What would be expected of a workflow is:

The main benefits of eclipse would be debugging and refactoring, but also inspiration of trying new things in emacs.

Community
  • 1
  • 1
serv-inc
  • 35,772
  • 9
  • 166
  • 188
  • 1
    Some use Eclim https://github.com/senny/emacs-eclim See here a good discussion about jdee, malabar and emacs-eclim: http://stackoverflow.com/questions/4654725/emacs-java-mode-malabar-jdee-or-eclim#4751128 – Ehvince Apr 23 '15 at 20:03
  • @Ehvince: emacs-eclim is currently unmaintained as of https://github.com/senny/emacs-eclim which kept me from trying it. In the SO-link, it says that malabar is good only with maven. So the definitive answer seems to be: roll your own until you find something that fits, is it? – serv-inc Apr 24 '15 at 14:54
  • @Ehvince: if your comment had been an answer, that would be definitely worthy of an up-vote ;-) – serv-inc Apr 26 '15 at 11:12
  • 1
    Ok sure ! thanks. You forgot about JDEE which seems to be the 3rd and last solution, or trying what brings ECB. – Ehvince Apr 26 '15 at 14:59

3 Answers3

2

Some people use Eclim (Eclipse features for Vim) with Emacs: https://github.com/senny/emacs-eclim but the project seems unmaintained. They seem to seek better debugging, refactoring, code completion, run unit tests.

There's also a good SO discussion here: Emacs java-mode: malabar, jdee, or eclim?

They discuss Eclim, Malabar and the Java Development Environment for Emacs (JDEE)

  • Eclim (unmaintained)
  • Malabar-mode seems to be good, but for Maven projects only
  • Jdee seems tricky to configure. Does good code completion.
  • Cedet seems to have android support, too.

One also recommends trying the Emacs Code Browser (ECB); it is a plugin that will give you stuff like Eclipse's Project Explorer and Outline views.

ps: feel free to complete this answer !

serv-inc
  • 35,772
  • 9
  • 166
  • 188
Ehvince
  • 17,274
  • 7
  • 58
  • 79
  • how would you recommend this completing to be done: edit both answers, or just one of them, or ask meta, or something else? – serv-inc Apr 28 '15 at 12:48
1

Eclipse

Once the project exists in Eclipse, editing a file in Emacs has Eclipse realize that it has been edited.

External links

There is one pretty complete webpage describing Eclipse for Emacs and Java. You can find the installation procedure (a bit dated, omitting MELPA, f.ex.) at "Installation".

Git repository outside of Eclipse

EGit for eclipse works for the import, though not for the android-specifics. It keeps the files and all in the same place as the project was before (if you created it outside of Eclipse). The installation is eclipse-straightforward:

EGit installation
  1. Help > Install new software
  2. Work with: http://download.eclipse.org/egit/updates/
  3. Select both, Next until Finish
Git project import into Eclipse
  1. File > Import: Git > Projects from Git > Next
  2. Existing local repository > Next
  3. Add your repository via "Add..." > (repositories auto-checkmarked) > Next

(neither of the next steps got me to android-compile the project-though)

TL;DR

The import does not get Eclipse to recognize the project as an Android project out of the box. It seems better to create the project inside Eclipse.

serv-inc
  • 35,772
  • 9
  • 166
  • 188
0

Trying to integrate Emacs with Eclipse might be obsolete, as Android now uses Android Studio as the default IDE.

To integrate Emacs/the command line with Android Studio:

  • Setting up new project is always easier to do in the IDE. While Android Studio can import both git and normal ant repositories, importing from git seems to work only via

    1. do an ant import (this models the gradle structure to create by hand)
    2. modifying the command-line git repository to the new gradle structure
    3. importing the command-line gradle project into the IDE
  • With gradle, building the project should be as easy in the command line as in the IDE.
  • (The point about emacs-eclim is obsolete. While it looked good, this seems to apply only to Eclipse.)
serv-inc
  • 35,772
  • 9
  • 166
  • 188