Plugin sources Android Eclipse

just yesterday I stumbled on a simple and seemingly such an obvious feature in the Eclipse IDE as the connection source from external libraries. Maybe someone will seem too simple and banal, but after interviewing a few friends developers, I have found that not only did I not know about this function because for all fans and professionals, which is engaged in development under Android, I ask under kat, and you will learn how debajit not only your code, but to watch "at the root" — namely, debajit your project "to the ground".



I think this picture fed to any Android-developer (and not only). How disappointing for a long time to find an error, follow the variables and implementation of applications to eventually find out that the error is in place, you are invisible and, therefore, it is absolutely timeless and, most likely, is not clear.

It turns out that the developers of Eclipse and Android has provided a great opportunity to see the source code of our libraries (at them presence, of course) and use to their full potential. This does not apply to cases where the library source code is imported as a separate project. All the reasons mentioned below applies to the case when the library is in a jar file (so connect the library Android API or the JDK).

Well, let's start. Click the right button of the mouse on our project in the Package Explorer and search for the item Propreties (at the bottom).



Open the properties as shown in the picture and click Edit.



In the opened menu, select External folder and look for a folder with source codes of Android (in the folder %android_sdk%/sources/android-%api_version%. If source is not present, run the SDK Manager and download the Sources for Android SDK corresponding to the Target API of your project. In the end, we get such a thing:



Save the settings, again presses the right mouse button on project folder and select Resresh. Now let's try to hold down Ctrl and the left button to click in the text of your program on any Android's class. I victim selected Activity class.



Thus it is possible to connect the sources (and together with them or instead of and Java doc) to any library that provides one or the other in the form of a file or archive. For example, the library ORMLite produces source code and Java doc that connect absolutely analogous.

That's all. As you can see, it is all done very quickly. And from that point, if the behavior of your robot hand becomes mysterious to you, you have a great opportunity to understand the reasons of such behavior, and at the same time to study a bit the source code of the OS, that will only additional advantages.

PS in a similar manner it is possible to connect the sources of the JDK, if you are working purely in Java. For this library rt.jar it is necessary to connect as source file src.zip the root of the folder where your JDK is lined with.

author: I Sincerely hope that this will help many beginners (and not only) it is better to get used to the Android system.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Integration of PostgreSQL with MS SQL Server for those who want faster and deeper

Custom database queries in MODx Revolution

Google Web Mercator: a mixed coordinate system