how to setup eclim with android developer tool (eclipse 4.2) - android

I have the Android Developer Tool which shows eclipse version 4.2 (juno).
According to Eclim site required version of Eclim is as
Eclipse 4.3.x (Kepler) (Eclim 2.2.x), Eclipse 3.7.x (Indigo) (Eclim 1.7.x), or Eclipse 3.8 (Eclim 1.7.13 or greater)
I thought eclim 1.7.18 will work with eclipse 4.2. I also tried 2.3 but none are compatible with eclipse 4.2 which comes bundled in ADT.
So which version of Eclim should I use?

I got ADT bundle with eclipse 4.2 and installed eclim 2.2.6 which doesn't complain about eclipse's version.
I hope it works for you too.

For other readers not satisfied I'll tell my story, before you read you must know I'm that type of developers who love using the CLI and thinks that keyboard shurtcuts are faster than using a mouse, if you don't agree may be this setup is not for you:
Install main tools
I've downloaded Eclipse Luna (4.4.0) from the eclipse project website.
Download the Android SDK.
Later install the ADT Plugin (through Help > Install New Software).
After installing the ADT Plugin will ask for the path to the Android SDK.
Later on installed Eclim (2.4.0), it will ask for the eclipse installation folder as well for the .vim folder.
Start the Eclim daemon service. (In debian you can use update-rc.d to make it always run, or search a solution for your system, you can setup to start at system start, let the ideas come out!)
Setting up the Android Development Vim Studio
Check Eclim is up by typing in vim :PingEclim you should see the version of Eclim as well of Eclipse.
I suggest installing the NeoComplCache Vim plugin it integrates nicely with Eclim autocomplete, in the Eclim doc web site it says what you need to add to integrate it.
Eclim will detect the android-sdk path based on the setup you made on eclipse but if not you can define the android-sdk path (see Eclim docs).
How to create projects and install on device
With my NERDTreee I automagically CD in the selected root dir and use :ProjectCreate %/MyProjectFolder -n android, it will ask for some configs.
Later in order to you can build and install the app to your phone you need first to generate the build files (eclipse doesn't share these build files), use :!android project update --path %/MyProjectFolder (note you can omit '/MyProjectFolder' if you're already inside that folder). You can add --target and --name flags if you want to update these values.
At this point you can work in your project without any issues, code completion works excellent, if you need import something use :JavaImport but you know you can map it.
Wenever you want to test the app in your device (I use a physical device) use :Ant debug install and if build succeeds use :!adb shell am start -n your.package.name/.YourMainActivity this will fire the app in your device just like eclipse does.
You can combine the build and install command with :!ant debug install && adb shell am start -n your.package.name/.YourMainActivity. Also remember to keep a terminal open for your logcat adb logcat or if you declare a tag (I suggest doing it) adb logcat -s "MyTag"
Why to use eclim?
I was in a pain after updating my eclipse juno only errors was shown, I was tired of downloading, installing, updating eclipse, even the bundled ADT was bugy, Android Studio looks very ugly on linux by the swing font rendering, many hours were wasted at the end I just search for integrate my vim (I use it for web dev) and never looked back, used Eclim because I had the buggied eclipse on my system (is still here can't use that slow bugy crap, I HATE ECLIPSE).
Does it worth it?
If you don't have eclipse I suggest you try another Android Development Vim Studio without eclim, but if you already have Eclipse, go for eclim. And yes I'm happier to code this way in Vim rather than in eclipse, the only miss is the GUI Layout Designer. As some people say If you want something done well, better do it your self
Looks like a lot of work
Yes, for sure I'll start building a vimscript for this.

Related

How to use Android Studio with WSL (bash) as your shell Terminal?

Is it possible to use Android Studio and configure Windows Subsystem for Linux as a Terminal? I really don't like to work with Windows cmd.exe, but when I try to switch to bash.exe, which seems to work, it cannot build the project because there are missing e.g. Android/sdk/build-tools/27.0.3/aidl'.
This file is there, but it is with .exe suffix as it was downloaded for Windows. Any workaround to use *unix like bash for Terminal in Android Studio while being on Windows 10?
Yes, it is possible. I'm doing it right now. I have an Ubuntu app as WSL and figured out that it's accessible at C:\Windows\System32\bash.exe
So, open Android Studio and navigate to File -> Settings -> Tools -> Terminal. There fill Shell paht with C:\Windows\System32\bash.exe and voilĂ !
Now, when you open a new terminal it will use the WSL you have installed in your machine.
I'm using Android Studio 4.0.1.
I'm setting this up right now and hit your question from Google looking for advice. So with that caveat, let me explain what I did to get it running and if you have follow up questions we may need to experiment together to find the answers.
First, I installed VcXserv: https://sourceforge.net/projects/vcxsrv/. This X Server for windows allows you to run graphical linux applications in WSL. You'll just need to export the display variable in your ~/.bashrc since that isn't done normally in WSL:
$ echo "export DISPLAY=:0" >> ~/.bashrc
Then you have to run XLaunch from the start menu. It takes you through the config dialogs (just choose the defaults) and it puts an icon in the notification area you can check to make sure it's running.
Then, you want to download the Linux version of Android Studio 3.1. Extract it into the WSL filesystem somewhere (I used ~/apps). Then from your bash shell you can run android-studio/bin/studio.sh and the window will appear and begin the unboxing dialogs.
This is as far as I've gotten, right now it's downloading the SDK. I still am not sure how adb over usb is going to work or tested the emulator. I'll update this if I learn more.
Update unfortunately, VcXserv is crashing when the main Android Studio window launches. I'm going to file a bug report on it and try some other X servers if I have time later.

Is GUI for Android SDK manager gone?

I rarely do something for Android so I'm a bit confused. While back there were two type of installations - Android Studio and just Android SDK. I have IDEA so I don't need Studio. Typically I download SDK that have UI tool to download its components.
I just got https://dl.google.com/android/repository/tools_r25.2.3-linux.zip and I can't see UI SDK Manager in it. There is bin/sdkmanager shell script. But it's kinda inconvenient for my purpose because going through output of --list, copy-pasting packages names and running sdkmanager would take too much time.
What's the way of installing this quickly now ?
PS. I'm on Ubuntu 16.10 in case it matters.
PS2. I just tried sdkmanager "platforms;android-25" as per documentation but it gave no output after me agreeing to terms. Where did it install SDK files? Did it even install it? Amazing.
Looks like I'm not the only one who had to deal with this idiocy. The way to install it
Unpack zip to some /parent folder so it has /parent/tools. I extracted content of zip's tools to /androidsdk and it was mistake. Script couldn't find it.
Set ANDROID_HOME to /parent folder.
Run /parent/tools/android sdk to see SDK Manager's GUI.
Google, was it hard to leave script that does the above in installation zip so people don't need to waste 40 minutes googling around ?
Officially GUI is gone, but pleasant people saved the last of it for us:
installer_r24.4.1-windows.exe
According for this announcment Google doesn't intend to support ADT pluging for Eclipse since June 2015, and so as GUI for ADT at all. They explain the decision with an entire switching to Android Studio. There are no links on official Android sources where to download last GUI version, because they find it as having potential security bugs.
So you have chance to download the last saved version, till the link will not be changed. If it already happened try to search by tag.
Thank to Losin' Me for links:
Windows (No installer): dl.google.com/android/android-sdk_r24.4.1-windows.zip
Mac OS X: dl.google.com/android/android-sdk_r24.4.1-macosx.zip
Linux: dl.google.com/android/android-sdk_r24.4.1-linux.tgz
Found on web.archive.org
Late to the party, but you can download v24.4 installer like the good old day here. It will update itself to v25.x and everything works as expected. Also a big ef'u Google.
Update 2021-07 : This tool does not offer build tools version >= 30 and won't show newer packages anymore
Since Android released build tools 25.3.0, they removed android CLI command and replaced it with avdmanager and sdkmanager located inside your $ANDROID_HOME/bin/tools
Run this command to get a list of available packages in sdk-style path:
sdkmanager --list
Run this command to install a specific image: sdkmanager --verbose "system-images;android-19;google_apis;x86"
From the command line, just type
tools/android sdk
and the usual GUI for the Android SDK will be prompted.
Hope this helps
If You have Android Studio, you can point your sdk manager in Android Studio to where you just installed your SDK. You can manage it from there. That's what I had to do. The command line was so tough for me as I didn't get the full package names when running sdkmanager --list command
Here is the link for download android sdk with GUI for windows, linux and mac:
Uncompressing and put the folder named tools inside androidsdk directory, search for android.bat: it's open GUI in windows.
Download packages and develop apps.
For using with Xamarin, The official Xamarin SDK Manager is now available for Visual Studio 2017 and above. It can be installed from under "Cross Platform Mobile" workload in the Visual Studio Installer. It replaces Google's standalone SDK Manager (which was deprecated in version 25.2.3 of the Android SDK Tools package).
I am sorry for bumping a necropost. But I have just released a simple Android SDK GUI. Maybe this little weekend project could save some people from headache of using sdkmanager command line or downloading android-tools twice.
You could check my project at AndroidGUI.
Fork as you please or better yet send me PR. Any help would be very much appreciated.
PS: It would be very useful if somebody could point me to the latest sdklib-*.jar source code. So that I could interface with Android SDK directly.
In the tools directory search for ' android.bat ' file and run it , GUI for SDK manager will open .
For all Windows users: I just made a "porting" of the old GUI executables...
although porting is a big word, I just changed the executable so it would read andoid_gui.bat instead of android.bat, and added that file and some required libs (although I think only archquery.jar is needed, I also put sdkmanager.jar, sdkstats.jar and sdkuilib.jar; it seems to work even without them so let me know if they are not needed)
Just extract it in the SDK directory
Download here

Unable to Download Packages via Android SDK Manager

I have recently installed Android SDK on my computer running Windows 7 x64.
I then installed the Eclipse ADT plugin. I am running Eclipse Juno JEE.
When I attempt to run the SDK Manager through Eclipse, I receive the following errors:
Nothing I have tried has allowed me to download/install/update Android SDK and its packages.
I have tried https and forcing http
I have tried running calling program as administrator.
I have added Eclipse, SDK Manager to Firewall exceptions.
I have turned off my antivirus.
I have turned off my firewall.
I have tried various combinations of the above.
I can navigate my browser to both URLs (using Firefox). That should negate "Failed to read..." options 1 and 2. Option 3 seems to be the likely candidate as the XML files do not, in fact, include the <'xsd:schema'> tag. However, I don't know how, if, or where I might be able to point SDK Manager to a local, modified copy of these XML files, or if that would even solve anything.
Any help would be greatly appreciated.
Note: I have installed Android SDK/ Eclipse ADT Plugin on the same machine in the past. This is a fresh install after a recent reimage.
I am not sure if this answer's your question exactly to the point but yet I hope this helps you.
As u wrote it looks like you have downloaded eclipse from its website and android sdk separately from Android website. Why don't you download the Android SDK ADT package with pre-eclipse setup.
That will make your job way lot easier.
The file name would be something like this:
adt-bundle-windows-x86_64-20130729.zip

How to configure Eclipse to use Phonegap on Ubuntu?

Definition
Phonegap = tool to make things such as HTML5/Javascript games into
phones. It is pretty cool because desktop versions should work in
phones without extensive redoing things for other platforms.
I can find the general instructions but everything about Eclipse and things like that. I cannot find a word about Ubuntu such as here unless a lot of google -spam with a massive amount of confusing threads about different platforms where people are more-or-less bullying one another like here with red-herrings such as google. I wish there was some nice make -files to do things but no, the README is instruction to read the more-or-less ambiguous Get-Started. So:
Problems
Where can I find step-by-step instructions on Ubuntu to set up Phonegap?
I hope some outlining over different platforms.
ADT Plugin is not getting installed in Eclipse. Why?
Android Eclipse ADT -problem
I can find here the instructions
but cannot move forward for some odd reason, no instructions or help
-text to proceed. You can see in the photo that it does not allow me to click OK although I am following the instructions. I wish I could do this on console!
Definitions
AVP = Android virtual phone (you do not need all phones to test your code, use emulator)
ADB = application to push application from command-line to the phone
ADT -plugin in Eclipse = adding some buttons to Eclipse for things such as to add AVPs
ADT = Android Development Tools (not sure what they are actually, perhaps emulation-related things containing things such as linux
kernels, APIs etc)
I am trying to provide instructions for console -power-users, hopefully helping to get things fast set-up instead of wasting time a lot with the cumbersome instructions.
1. set up the development environment such as the Android SDK here.
$ wget http://dl.google.com/android/android-sdk_r18-linux.tgz
$ tar -xvzf *.tgz
$ ...follow README or some tutorial there...
I. Now go back to the Android SDK site where you can find the ADT Plugin for Eclipse
here. The
unclikable button becomes clickable if you search now with the
search-bar for Android something. The ADT stands for Android
Development Tools so install everything you get there under something
tools or related.
II. Fix the #override -problem (shortly requires 1.6 compiler -compliance-level), more here.
III. Test your Android installation work by loading an Android Sample -file and then plugging in your phone (with USB -debugging enabled: Settings > Development > click) or use Android Virtual Phone (=AVP)
$ adb devices # Shows your physics devices such
# as phones with USB -debugging enabled.
$ adb install ~/workspace/yourChosenSampleDemo/bin/*.apk
# Your first Android -app emerges to your phone, have FuN!
2. Set up the Phonegap with the below:
Some general instructions apparently here.
iOS: you need Xcode so somewhat limited.
Perhaps useful, source -code
here and general download
here.
The instructions are extremely inaccesible with Eclipse's click-click-something, poor! After wasting time with Eclipse's symlinks, I swiched to the console:
$ tree|less
$ search for the files needed, mark them done or use find -command directly ^C
$ copy the files to some dir such as ~/Android/Public so easier to do ^C
$ things at once ^C
$ pwd
/home/xyz/workspace/HelloCordova/res
$ cp ~/Android/phonegap-phonegap-475bfd2/lib/android/xml/* .
$ cp ~/Android/Public/cordova-1.7.0.js assets/www/
$ cp ~/Android/Public/cordova-1.7.0.jar libs/

Android ADT Plugin doesn't show up in Eclipse

I'm using Windows 7 and installed the 64 bit version of Eclipse 3.5.2. I then installed the Android ADT plugin, but when I try to configure it in the Windows > Preferences dialog, the Android Plugin doesn't show up in the left pane. Instead I see DDMS. This prevents me from specifying the location of the Android SDK (unless there is another way) to give me the appropriate templates and such.
Someone posted a fix to this that includes setting the permissions of Eclipse, but that didn't work for me. I tried installing the Android Plugin from both online installation (thru the URL install) and the offline Archive method.
If you're running Windows Vista or 7, make sure you right-click Eclipse and RUN AS ADMINISTRATOR. I literally spent six hours figuring this out, and this was what fixed it.
Dear people from the future:
I had roughly the same problem in linux, except that i didn't see anything at all but vanilla eclipse after installing. by combining both previous answers i got it to work:
start eclipse with sudo eclipse -clean, install the plugins and restart eclipse. the plugins showed up including the welcome screen that's supposed to be there.
after that it should work when running as regular user as well.
works for both the android sdk and the gwt sdk. (and probably other eclipse plugins)
Remove the plugin, then restart as follows:
eclipse -clean
Now try reinstalling the ADT from the online installation
For users having similar problem and not luck with other solutions:
I have windows XP but had same problem. I realized that I had JDK5/bin folder in my PATH environment variable (though my JDK_HOME was pointing to JDK6), as soon as I modified the PATH to replace bin of JDK5 with JDK6, the Android buttons on eclipse (after restart with -clean) along with Android option in Preferences & New Project showed up. (Weird eh!)
Also, consider to install the bundle android installation having eclipse with pre-configured Android SDK if a new eclipse installation doesn't matter to you
http://developer.android.com/sdk/installing/bundle.html
The above answers do not confront the heart of the problem. There is a feature in Windows 7 that prevents downloaded files from direct access of local files. All of the state is perfectly maintained in the Eclipse workspace instance. The problem is easily resolved by doing the following:
Find the "Eclipse" executable
Right-click on it.
Click "Properties".
Select the "General" tab.
Look for -> Security: "This file came from another computer and might be blocked..."
Click Unblock.
This is a much better solution than uninstalling and reinstalling the ADT or Eclipse which can be a pain.

Categories

Resources