您的位置:首页 > 移动开发

用eclipse开发android app,自动补齐时很慢很卡的解决办法(转帖)

2011-03-18 10:34 507 查看
After creating a new Android development setup on my computer I noticed a huge delay in the autocomplete in Eclipse, when working with my apps.

When trying to access certain objects functions with a dot, Eclipse freezes for a couple of seconds, before giving me the autocomplete options.

This delay is very annoying, I found the solution, and I would now like to share it!

You need to download some source files spesific to which Android API version you are working with.

The URL is

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=<API version>;sf=tgz

And you have to replace <API version> with one of these:

* gingerbread for API 9 – Android 2.3
* froyo for API 8 – Android 2.2
* eclair for API 7 – Android 2.1
* donut for API 6 – Android 1.6

so the URL becomes for example:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=froyo;sf=tgz

for froyo, or:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=gingerbread;sf=tgz

for Gingerbread. (Thanks Gyuri).

Also, as Al Sutton mentioned in the comments, you can use SDK tags like android-sdk-2.2_r2, which would look like this:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=snapshot;h=android-sdk-2.2_r2;sf=tgz

Thank you Al.

The download is about 100 MB.

After you have downloaded the file, (which comes as .tar.gz by the way), you have to open the archive, and copy the contents of the base directory, into your

<android-SDK>/platforms/android-<API version>/sources

directory. (Create the sources directory if it does not exist)

When you now start Eclipse, you should have autocompletion working fine again!

Please share this article!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐