How to find the method I need. The fact is that after reading many tutorials, there was still no understanding of how to apply these or other methods correctly. The examples used in tutorials (and these are always simple examples) are quite simple and understandable, but if you move away from the example and start doing your own, a lot of questions immediately appear. How is it? and where is it from? ahhhh ...? Seriously?

I will give an example code:

mMessagesDatabaseReference = mFirebaseDatabase.getReference().child("messages"); 

And in many cases (not only by the example of the FirebaseDatabase class, etc.). How to understand what exactly this method should be here? After all, the classes have many of them and their eyes diverge.

 .getReference() 

But even if according to the description I can understand (from the documentation) what this method does, what to do next I do not understand.

How do you study the new class and what methods are needed at the moment, how among many methods to understand which is needed and which is the right one?

I will note a couple of examples:

 messageTextView.setVisibility(View.GONE); photoImageView**.setVisibility**(View.VISIBLE); Glide**.with**(photoImageView.getContext()) **.load**(message.getPhotoUrl()) **.into**(photoImageView); 

Thanks for answers.

1 answer 1

Probably just need to be able to program, it comes with experience and knowledge base on the subject.

For the problem itself, you simply read the documentation on the class, see what its methods do, what they get with arguments and what they return as a result. You think you need to solve the problem. You solve it using the available opportunities and / or adding your own (you write your own methods).

You constantly encounter similar situations in your life - for example, send a parcel. If you have never done this, it will be a difficult quest: collect everything in a special box, sign it correctly, take it to the post office, fill in a notice, etc. - all these actions are methods. First, by any means (best off-source, that is, in this case, go to the post office and find out what's what), you learn the sequence of actions, if there are no ready-made patterns of solutions, then you figure out which sequence of actions will lead to , then perform it by performing predefined actions (by performing methods).

That is all trite. The methods that you need will perform the actions you need to solve the problem. Combine these methods or write your own, so that the task is solved correctly and there is an art of programming, which, as you understand, is not accessible to everyone, but the skill can also be developed by practice. There is no miracle advice that all this is solved by some kind of magic sweep and .. fuck !!! you understand where to write - it is decided by a certain mindset, good knowledge of the subject area and practice.

PS: If you do not understand what is happening, you should not grab complex structures (like a database) and method-cheining (what is method-cheining ). Start with a simple one that you can understand or are close to. It is also not worth reading "many tutorials" from this only porridge due to the fragmentation of information. Read books, they will give you a holistic approach to learning. And first on the basics of OOP in general, then on pure Java and then only on Android. Knowledge needs to be accumulated gradually and consistently, and not to be immediately difficult, to read some left-wing articles with examples in the internet and hop! such a super programmer in a week will not be like that.