ANDROID DEVELOPMENT FULL NOTES (PART 1–3)
PART 1 – Android OS, Studio, SDK, Emulator, Manifest
1. Android OS
- Open■source mobile OS by Google.
- Runs on phones, tablets, TVs, cars.
- Linux■based, supports multitasking, sensors, camera, GPS, WiFi.
Example:
Using Camera API:
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(cameraIntent);
2. Android Studio
- Official IDE.
- Provides code editor, XML layout editor, logcat, debugger.
Example project creation steps:
New Project → Empty Activity → Java → Finish.
3. Android SDK
- Contains APIs, libraries, build tools, platform tools.
Example:
MediaStore.ACTION_IMAGE_CAPTURE is from SDK.
4. Emulator
- Virtual device to test apps.
- Supports GPS, RAM, CPU, calls, SMS.
5. Project Structure
app/java → Java files
app/res/layout → XML UI
app/res/values → strings, colors
[Link] → app config
6. Manifest Example:
PART 2 – UI, Layouts, XML, Buttons, Toast, Strings
1. UI XML
UI elements: TextView, EditText, Button, ImageView.
2. Layouts
LinearLayout example:
RelativeLayout example:
ConstraintLayout example:
FrameLayout example:
3. XML Properties
android:padding="10dp"
android:layout_margin="8dp"
android:textSize="20sp"
4. Button Click Java:
[Link](new [Link]() {
public void onClick(View v){
[Link]([Link],"Clicked",Toast.LENGTH_SHORT).show();
});
5. Toast:
[Link](this,"Login Successful",Toast.LENGTH_LONG).show();
6. Strings:
Click Me
7. Change App Icon:
android:icon="@mipmap/ic_launcher"
PART 3 – Calculator App (XML + JAVA)
XML Layout Example:
Java Logic Example:
[Link](v -> {
double a = [Link]([Link]().toString());
double b = [Link]([Link]().toString());
double result = a + b;
[Link]([Link](result));
});