Android Studio - bounswe/bounswe2024group8 GitHub Wiki
About
Android Studio is an integrated development environment (IDE) for creation of Android applications. It's currently the most use IDE for mobile apps and it is fairly easy to learn. It offers a robust code editor, a debugger, an emulator, a performance analysis tools and much more. Android Studio leverages the power of the Android Software Development Kit (SDK) and supports multiple programming languages such as Java, Kotlin, and C++.
User Interface(UI)
Developers usually use XML files for creating layouts and it might be the best option for Android Studio. Interactable buttons, text boxes, switches etc. can be created easily like html. Here is an example xml code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, World!"
android:textSize="24sp"
android:layout_centerInParent="true"/>
</RelativeLayout>
Programming
For displaying xml files, manipulating xml elements, making http requests, managing mobile storage etc., a programming language must be used. Android Studio offers Java, Kotlin and C++ but developers tend to use Java for practical reasons. Here is an example java code that changes the previous TextView:
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize TextView by finding the view with the specified ID
textView = findViewById(R.id.textView);
// Now you can manipulate the TextView as needed, for example, changing its text
textView.setText("Hello, Android!");
}
}