Search code examples
androidandroid-library

Libraries and api's in android


It been while since I began studying android development. I am able to make small apps. I have two questions
1. How are libraries used to build project. what is gradle and java build path. I tried to google it but only got confused. Can anyone explain me with workflow.
2. In some projects I get error that minimum api required is greater than what i use. So how can I make it compatible for lower api's too.
And sorry for my language.


Solution

    1. What is gradle?

    Gradle is one type of build tool that build the source code of the program. So it's an important part of Android Studio, and needs to be installed before starting developing your application. We do not have to install it separately, because the Android Studio does it for us, when we make our first project in the Android Studio.

    What is Gradle in Android Studio?

    The java build path is used for building your application. It contains all of your source files and all Java libraries that are required to compile the application.

    How to set java_home on Windows 7

    1. In some projects I get error that minimum api required is greater than what i use.

    As stated by maxim in their answer here:

    Methods from higher API are invisible and inaccessible because project's target SDK is lower than SDK which methods are going to be used. For example: if you want to use methods from API 14 Android project target SDK should be at least 14 or even better the latest (currently 16). That is kind of obvious but I missed it. After that the solution Sam gave a reference to is in use.

    Calling API from higher API level than the minimum requirement