I use TimePicker in my application and it does not behave as expected. In the date and time settings of the Android OS, there is also a TimePicker , and it behaves exemplary. I would like to see the source of the OS settings. Tell me, please, where you can find the source code of the OS and how to find the necessary class there.
- I think you solve the problem in the wrong way. Better explain how your piker behaves and how you want it to behave. - Vladyslav Matviienko
- @metalurgus The problem is described in question.stackoverflow.com/questions/512482 - iramm
1 answer
From online sources for learning the code, it is most convenient to use the GrepCode service, which, in addition to the source code itself, provides linking links for class / method transitions, a class structure tree, and other buns. The disadvantage is the lack of resources.
Android OS sources on GrepCode - here are the source codes of the OS itself. By clicking on the OS version of interest in the project structure tree you can get to the bottom of all viscera. You can also find a specific class through the search, if you know its name exactly.
Sources of standard applications on GrepCode - here you can find all sorts of calendars, SMS clients and other stock Android OS applications
Also, the source is presented on the Google git server and on GitHub, they are not very convenient to study the code, as these are just structured listings (the source code project is in its pure form), but they include all the resources and other related elements, and not just the code :
Android sources on googlesource - here is the complete open source OS of android and stock applications, including all resources and so on.
Same thing on github
I will note right away that it is impossible to simply take, download these sources and put them in IDE so that you can comfortably use it - the project has a very complex structure and connections, so everything will be full of errors.
In addition, you can view all the sources and resources of the Android OS directly in the IDE, for the version of the SDK that you have installed, if you first download the Source section for this SDK in the SDK Manager, this is the most convenient option. You get full navigation, all IDE tools and resources.
SDK Manager:
Android Studio:
- How to view source code in IDE without knowing the class name? Are there resources in the SDK source? - iramm
- oneresources - the res folder in the screenshot from the IDE / If you do not know exactly what you need, then any source source will be equally useful to you. Look in the project tree, applying logic, where there could be what you need, for example, find the application first (say Settings), where the date entry is used, then in it the class where this date is entered and so on. Such that once poked the mouse and got everything here is impossible in principle. You can also use a fuzzy search (for general words that might be used by the classes in the desired class - the
DatePickerin your case). - pavlofff - I do not hope for a single click. The fact is that the source codes from the SDK on my computer are only files with the java extension, distributed into package folders. And this is not a project of Android-Studio, so that it can simply be opened in it. How to watch them in IDE? - iramm
- oneIf you installed the sources through the SDK Manager, then they will be in the IDE without any additional actions, in the class tree map - Project. The truth is most likely that the sources of stock applications are not included in the sources of the SDK. - pavlofff
- one@iramm See screenshots and explanations at the end of the answer. To get the SDK sources, you must first install them in the SDK Manager (for each API separately), then select the display in the ProjectStudio tree in AndroidStudio (by default, the display is "Android" and there are no external libraries displayed). The presence or absence of the SDK sources does not affect the size of the application being developed in any way - they only take up space on your computer and are not included in the .apk assembly - the android device already has everything you need initially, and then the android device: ) - pavlofff

