<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android on Thibault Saunier</title><link>https://blog.thibaultsaunier.com/</link><description>Thibault Saunier's blog: GStreamer, multimedia, open source.</description><language>en</language><lastBuildDate>Mon, 02 Nov 2026 17:51:09 +0000</lastBuildDate><atom:link href="https://blog.thibaultsaunier.com/tags/android/" rel="self" type="application/rss+xml"/><item><title>My vim for android devlopement environment</title><link>https://blog.thibaultsaunier.com/2009/11/my-vim-for-android-devlopement-environment/</link><pubDate>Sun, 22 Nov 2009 00:00:00 +0000</pubDate><guid isPermaLink="false">https://thiblahute.blogspot.com/2009/11/my-vim-for-android-devlopement.html</guid><description>&lt;p&gt;I haven&amp;rsquo;t blogged for a long time, and I would have liked to be able to blog about &lt;a href="http://thiblahute.blogspot.com/2009/08/gsoc-add-google-documents-support-to.html"&gt;my Gnome soc project&lt;/a&gt;, but unfortunately, I have other priorities. As part of my studies, I had to do some development for the android platform, and since the last summer, I can&amp;rsquo;t use other development environment than Vim, I decided to find a way of using it for my android project.&lt;/p&gt;&#10;&lt;p&gt;So here is the description of my Vim environment for android applications development. I use vim 7.2, the version distributed with Ubuntu 9.10, the &lt;a href="http://www.vim.org/scripts/script.php?script_id=1213"&gt;Vjde plugin&lt;/a&gt;, &lt;a href="https://launchpad.net/terminator"&gt;terminator&lt;/a&gt; as a terminal (which by the way is a great terminal emulator!!) and then &lt;a href="http://developer.android.com/sdk/index.html"&gt;last android JDK&lt;/a&gt; in order to develop application for android2.0 (eclaire).&lt;/p&gt;&#10;&lt;p&gt;First I installed the SDK (there are a few bugs on the emulator installation due to &lt;a href="https://bugzilla.gnome.org/show_bug.cgi?id=598734"&gt;this bug&lt;/a&gt; and an &lt;a href="http://groups.google.com/group/android-developers/browse_thread/thread/814e3c898d7b24fc?hl=en#"&gt;this ssl problem.&lt;/a&gt; I fallowed &lt;a href="http://developer.android.com/sdk/index.html"&gt;this guide&lt;/a&gt; to set the sdk. Then, I installed the Vjde plug-in which is a Vim plug-in to get a Java development environment in Vi, this plugin permit to add intelligent completion for methods calls as well as for imports (I only unziped &lt;a href="http://www.vim.org/scripts/download_script.php?src_id=10992"&gt;this&lt;/a&gt; in you ~/.vim directory). Afterward, I created my android project (&lt;a href="http://developer.android.com/guide/developing/other-ide.html"&gt;this&lt;/a&gt; page explains well how to do it). And then I created an vjde project, in vim:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;:Vjdeas filename.prj&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;This is actually a text file which permit to save variables to you project. Then I set it Vjde to look at android class, methods and package, in vim:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;:let g:vjde_lib_path='/path/to/android/sdk/platforms/android-2.0/android.jar:build.classes'&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;And save it&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;:Vjdesave&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Thanks to it, I can have functions/imports completion available with the CTRL-X+CTRL-U key combination (I need to load the project(&lt;span style="font-style: italic;"&gt;:Vjdeload filename.prj)&lt;/span&gt; every time I want to work on it, I think there must be a way of doing it automatically but didn&amp;rsquo;t figure it out yet). It would also be possible to get the documentation integration thanks to the Vjde plugin, but I am used to have it in another window.&lt;/p&gt;&#10;&lt;p&gt;Then to try the program on the android emulator, I lunch the emulator, and in a terminal:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;ant debug &amp;amp;&amp;amp; adb install -r bin/yourAppName-debug.apk&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;You can then launch it in the android emulator menu (I looked for a way of lunching the program directly from the command line, but didn&amp;rsquo;t find :( ). To debug the app, you can launch the &lt;a href="http://developer.android.com/guide/developing/tools/ddms.html"&gt;ddms&lt;/a&gt; tool which is part of the android sdk.&lt;/p&gt;&#10;&lt;p&gt;I hope this could be useful for some people who want to develop for the android platform and don&amp;rsquo;t want to use eclipse or netbeans IDE.&lt;/p&gt;&#10;&lt;p&gt;Edit: I find a good trick to manage the make and install thing, base from &lt;a href="http://www.builderau.com.au/program/java/soa/Configure-vi-for-Java-application-development/0,339024620,320276164,00.htm"&gt;here&lt;/a&gt;. I added the following (executable) file to ~/.local/bin/vimAntAndroid:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;#!/bin/sh&lt;/code&gt;&lt;br&gt;&#10;&lt;code&gt;ant debug -Dbuild.compiler.emacs=true -quiet -find build.xml 2&amp;gt;&amp;amp;1 | grep '\[javac\]'&lt;/code&gt;&lt;br&gt;&#10;&lt;code&gt;echo &amp;quot;Installing...&amp;quot;&lt;/code&gt;&lt;br&gt;&#10;&lt;code&gt;adb install -r ${1} | grep 'null'&lt;/code&gt;&lt;br&gt;&#10;And then in Vim&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;set makeprg=vimAntAndroid&lt;/code&gt;&lt;/p&gt;&#10;</description></item></channel></rss>