Pregunta

I have downloaded the Calendar Application From android.googlesource.com and all it dependencies like (datetimepicker, colorpicker...), I am trying to launch the application as if it is an android project, but several errors occurred like the ones in the picture

enter image description here

The Question I am trying to ask and hope it would be clear is:

Is there is a way to debug the apps found in the android source code packages ?

I am trying to integrate parts of the application but first I should understand how it was constructed to pick some code portions and xml designs of it.

¿Fue útil?

Solución

It is possible to compile the app via Eclipse, however, it's complicated because each app requires an ad hawk approach. I prefer to have my entire AOSP build code imported to Eclipse and then debugging the code is much easier.

First, you need to add your entire platform code: You have a full explanation here: http://source.android.com/source/using-eclipse.html

Basically this is what you need:
1) File->New->Project->Java Project
2) Uncheck "Use default location"
3) Choose the location of your entire AOSP build
4) Press Next (this will take several minutes)

Now you want to remote-debug apps in Eclipse: 1) Run->Debug configurations...
2) Click on "Remote Java Application" on the right side
3) Press "New"
4) Pick a name (any name will do)
5) Choose the project: pick your AOSP project
6) Use port 8700
7) Press Apply

Now you can debug any application in your AOSP (including the AOSP itself): 1) in DDMS view press on the Calendar process (for example)
2) Run->Debug Condigurations...-> Choose the new Remote Java Application you created and press apply
3) An error box will appear: "Errors in workspace", but you can ignore it (press "Proceed")
4) Go to Debug view and add any breakpoints you need

That's it... If you need to debug the app during its onCreate phase then you need to go to:
Settings app-> Developer Options-> Select debug app (choose your app) and check "Waiit for debugger"

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top