Higher-level structures such as Android usually follow the very set of design patterns. It is almost the same as you study the sample at work. A great example is the OnXXXListener interface publisher / subscriber model. If you follow the example set out in the frame, it really comes to you (in my opinion, of course). For example, I created a color picker view. I want View (Activities) users to be able to receive notifications, such as "selected color." I just looked at how the SDK classes will do this, and follow their example (create the OnColorSelectedListener interface using the onColorSelected method, expose this function through setOnColorSelectedListener in my color picker view, etc.).
Based on the .Net background for Android / Java, I really see the differences .. Net has many different design patterns that provide a very good guide for your custom classes. The good news is that the engineers behind the .Net BCL and Android SDK have followed some very common design patterns very well, so there are great examples.
Rich
source share