Android 0 AndroidStudio Install
Android 0 AndroidStudio Install
Tavernes de la Valldigna
Mobile
development
Vicent Selfa
Curs 2020/2021
Android
Studio
Android Studio
● Interesting links
● Android Studio installation
● Linux
● Windows
● A first project
● Android Studio features
● Gradle
● Lint
● Proguard
● Firebase
● GIT
● GITHUB
● Annexes:
● Running the project in a USB connected device
● Installing Java 8
● Changing editor font size, colors ….
● Solving problems
• Version control of notes
Android Studio
● Interesting links
• The best starting point to use Android Studio
Video: www.youtube.com/watch?v=Z98hXV9GmzY
Learn how to get started with Android and Android Studio in this short tutorial.
It demonstrates how to install Android Studio (Google’s official Android IDE)
and create your first Android app.
Android Studio installation:
Linux
Different ways:
● From the Software Manager application
● From the official web page
○ An stable version
● A Canary version:
○ If you want early access to the next version of Android Studio.
○ More info here and here.
Android Studio installation
• From the Software Manager application
Android Studio installation
• Installation for Linux: Download.
• https://developer.android.com/studio
Android Studio installation
• Installation for Linux: How to?
• https://developer.android.com/studio
Android Studio installation
1. Unpack the tar.gz file you downloaded to an appropriate location for your
applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
If you're using a 64-bit version of Linux, make sure you first install the required libraries
for 64-bit machines.
2.To launch Android Studio, open a terminal, navigate to the android-studio/bin/
directory, and execute studio.sh.
3.Select whether you want to import previous Android Studio settings or not, then click
OK.
4.The Android Studio Setup Wizard guides you through the rest of the setup, which
includes downloading Android SDK components that are required for development.
Android Studio installation
• Installation for Linux: How to?
• Completing installation
$ /opt/android-studio/bin/./studio.sh
Android Studio installation: Linux
• Completing installation
Android Studio installation: Linux
• Completing installation
Android Studio installation: Linux
More info
• Android Studio
Android Studio installation: Linux
• Completing installation
android-studio-ide-[num. Version]-windows.exe
Android Studio installation: Windows
• Project structure
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The first project
package selfa.v.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout. activity_main);
}
}
The first project
Toolbar
Attributes
Design
editor
Palette
Component
Tree
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
The first project
• Building an APK
Android Studio features
More information:
•Configuring gradle
•Gradle tutorials
Interesting video about Gradle:
•Deep Dive Into the Gradle Based Android Build System
Android Studio features
• IntelliJ IDEA
○ Designed to maximize developer productivity.
○ Together, intelligent coding assistance and ergonomic
design make development not only productive but also
enjoyable.
○ Instant and clever code completion, on-the-fly code analysis
Android Studio features
What is Firebase?
Firebase is a platform for mobile developers to develop awesome-quality apps,
quickly grow a user base, and monetize apps. It includes a hell lot of features, that
developers can use to fulfill their goals. Let’s discuss some of these features.
Firebase helps developers in development, growth and monetization of your mobile
applications.
It provides the following features for the Development phase
• Integration with Cloud Messaging.
• Robust Authentication for added security.
• Realtime Database for Realtime storage of app data.
• Storage support for files.
• Support for on the fly Remote Configuration.
• Test Lab to deliver high quality apps.
• Crash Reporting to keep your apps stable and free from bugs.
More info
• Starting with Firebase
• The YouTube Firebase channel
Android Studio features
● What is GIT?
Git is a version control system for tracking changes in
computer files and coordinating work on those files among
multiple people. It is primarily used for source code
management in software development, but it can be used to
keep track of changes in any set of files. As a distributed
revision control system it is aimed at speed, data integrity,
and support for distributed, non-linear workflows.
Git was created by Linus Torvalds in 2005 for development of
the Linux kernel, with other kernel developers contributing to
its initial development.
• https://git-scm.com/
Android Studio features
vselfa
[email protected]
GitHub and Android Studio
General aspects:
• Verify that your device is in USB Debugging Mode:
• Settings -> System -> Development options
• If the Development options doesn’t appear click 7 times on:
• Device information -> Compilation number
• Installing Java 8
http://www.oracle.com/technetwork/java/javase/downloads/index.html
buildTypes {
release {
// runProguard false
minifyEnabled false // new version
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Annexes
defaultConfig {
applicationId "com.enriquegilboix.examen2tnumeros"
minSdkVersion 19
}
Annexes
• Solving problems:
http://tools.android.com/knownissues