How to attach source to android.jar

前端 未结 7 721
故里飘歌
故里飘歌 2020-12-04 07:17

I am new to Android. I am working in the Windows OS with the Eclipse IDE. My simple application has a spinner that populates a list from database column. When I click on th

7条回答
  •  爱一瞬间的悲伤
    2020-12-04 07:57

    If adding folder android-sdks/sources/android-17 as external source doesn't work (as in my case) you can try to create folder android-sdks/platforms/android-17/sources/android-17 copy sources to it and restart eclipse (I have eclipse Juno Service Release 1). Only this way works for me.

    Steps to do this for android-17:

    1. Go to the adroid-sdk install folder, for me it's d:\ws\android-sdks\
    2. Copy android-17 sources folder from android-sdks\sources\android-17\ to the android-sdks\platforms\android-17\sources\ (your have to create folder sources here manually) folder so the final path to the sources must be the: android-sdks\platforms\android-17\sources\android-17\
    3. restart the eclipse, it must automatically attach sources for android-17

    UPD: the same solution with symlinks:

    Windows Vista+ (thanks @saleemrashid1 for mentioning mklink in comments):

    1. cd platforms\android-17
    2. mklink /D "sources\android-17" "..\..\..\sources\android-17"
    

    For Unix-base OSes (@Joe comment):

    it works fine to create the directory and symlink "sources/android-XX" to "../../../sources/android-XX":

    mkdir platforms/android-19/sources && 
    ln -s ../../../sources/android-19 platforms/android-19/sources/android-19. 
    

提交回复
热议问题