How to find right class and method

+1 Bojan Markovic · January 7, 2015
Hello Bucky, first of all I would like to thank you for this great tutorial. 
I'm beginner in world of programming, and I have one question. You are importing a lot of libraries and use difference class and methods in you tutorials. 

How you exactly know where to find that method, which libraries to import? 

Post a Reply


Oldest  Newest  Rating
+1 Seems Legit · January 7, 2015
As you program you will get more familiar with different methods and libraries. You can find a complete list of them in what is called the API (see link). It's not Buckey who replied but I hope this helped something.
+1 Bojan Markovic · January 7, 2015
Thanks for your reply. I know what is API and I'm using this reference

,but it is little confusing for beginners because there is a lot of package.
Can you give me exact example, how to find something? Suppose that I want to layout button to fit to all resolution. How to find appropriate package and class?
You can also use another example, it does not matter, I just want to know how to search and find the appropriate API package.

Thank you again because you're taking the time to help me.
Best regards.
0 Seems Legit · January 7, 2015
The API is there to 'not reinvent the wheel'. Al those packages in the API are indeed a little intimidating, I have the same. I am afraid there is no 'easy way' of finding the right package (atleast not to my knowledge, maybe someone else can help on that). As you continue to learn how to program you not only learn the syntax and thinking proces, also the packages. So you will get familiar with allot of them. What I mostly do (and this could the wrong way of doing it because I am not a pro) is first of all search through the API real quick to see if I can find a keyword for my problem. For example I would like input in my program. I simply open up the API list and press ctrl+f in my browser and search for 'input'. If you are lucky you will find a class that does exactly the job for you, if you're unlucky you don't. Then you can try googling it: 'input in java program' for example. Mostly you will be lead to an API page that works for you. It could also be that you will be lead to some sort of forum (like thenewboston or stackoverflow or something). If you still didn't find the class you are looking for, you can always ask in here if somebody knows the package to import for having input. We are always happy to help. If all that didn't help you finding the right package, wel.. I am afraid you will have to invent the wheel on your own. If you have more questions, just shoot :)
0 Troy Jones · January 8, 2015
A lot of the times if you just code, you can import them later with a shortcut.  I believe it's Alt+Enter.
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator