What is the difference between the following actions in Android Studio and when should I use them?
When do I use each one (after pull, after a change in xml file, after change in java file)
Which is mandatory before Run and can I make Run automatically do whatever is needed for me?
There is no such thing like 'Build project' in Android Studio, there is 'Make project'. I'll cite the documentation here (Android Studio is based on the the IntelliJ IDEA, so don't be surprised by the words 'Intellij IDEA'):
IntelliJ IDEA suggests several ways of compiling and building applications. The corresponding commands are available in the Build menu.
- Make Project. All the source files in the entire project that have been modified since the last compilation are compiled. Dependent source files, if appropriate, are also compiled. Additionally, the tasks tied to the compilation or make process on modified sources are performed. For example, EJB validation is performed if the corresponding option is enabled on the Validation page.
- Rebuild Project. All the source files in the project are recompiled. This may be necessary when the classpath entries have changed, for example, SDKs or libraries being used added, removed or altered.
Clean
is Gradle-related task, it clears the intermediate files in build
directories. Essentially, Rebuild Project
does Clean
, followed by the full build of entire project - compiles your .java
files, converts them into dex
format, and so on.
Synchronize
is also Gradle-related task, it's used to refresh dependencies after you've changed the content of your build files.
In short, if you've changed the content of your build files and/or changed some Java files, and/or changed some resources and want to run the updated version of application on your Android device/emulator, hit Shift+F10 - it'll update ('synchronize') your dependencies, make the project and run it on the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With