Build gvim + eclim to develop Android applications

Source: Internet
Author: User

I have been using Vim to write code before. I don't want to replace it with eclipse because it is easy to use. I am not used to the eclipse completion method and the memory CPU occupied by eclipse is relatively large. Although eclipse has the VI plug-in, it does not feel like it is used, so I searched the internet for some methods for gvim + eclim to develop the android program. I will share the following with you.
This is a Reference URL:
Vim reference configuration (you can configure Vim as IDE)
Http://blog.csdn.net/wooin/article/details/1858917
Gvim + eclim Configuration
Http://blog.csdn.net/dadoneo/article/details/6044058
Eclim reference
Http://eclim.org/gettingstarted.html

After configuration, the development procedure is as follows:
1. Create the helloworkd directory
$ Mkdir helloworld
2. Create an android Project
$ Android Create project -- Target 4 -- path./helloworld/-- activity helloworld -- package com. ediosn. helloworld
Or
$ Android Create Project-T 4-P./helloworld-A helloworld-P com. ediosn. helloworld
3. Create an eclim project in VIM
: Projectcreate helloworld-N Java
4. Open the simulator
$ Emulator-AVD android2.3.3
(View the existing AVD In the android list AVD)
5. Execute ant install in the helloworld directory to install the software on the simulator.
$ Ant install
6. If the project is created by ECLIPSE, you can update it to generate the build. xml file.
$ Android update project-P./helloworld-T 4

There are two problems after the configuration is completed:
Question 1:
Android. Jar cannot be recognized during package export
Cause and Solution
The reason is that the default path of eclim does not contain Android. Jar. Add this sentence to the. classpath file in the project directory.
<Classpathentry exported = "true" kind = "lib"
Path = "/opt/android-sdk-linux_86/platforms/Android-4/Android. Jar"/>
// This path is your absolute path of my android. jar file.

Question 2:
R cannot be resolved to a variable
Cause and Solution
R. Java is automatically generated by Android and does not require import, but eclim does not know it, so eclim imports it.
Add the following statement to Java. Vim in the ftplugin directory of VIM so that eclim does not import the android. r package.
Let B: eclimlocationlistfilter = [
\ "R cannot be resolved to a variable ",
\]

TIPS:
1. Check logcat on the terminal:
$ ADB logcat
2. view system. out:
$ ADB logcat | grep system. Out

3. directly using the android command in the terminal requires adding the android-sdk-linux_86/tools and android-sdk-linux_86/platform-tools paths to the path.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.