Varsity college
Changes in Code
Code changes for dynamic behavior occur in the
MainActivity.kt
file.Design layout and appearance adjustments are made in XML files.
Understanding Packages
Packages contain predefined sets of code built into Android Studio.
Example: Using math functions (addition, division) from the math package without rewriting the code.
Standard packages are essential for Android app functionality, linking to SDKs and Gradle.
Main Activity File
MainActivity.kt
file name matches the class name (class MainActivity).Automatically generated files during project creation are critical for app functionality.
New imports should be added below existing imports in the file.
Emulator and Device Management
Pixel phones are developed by Google and use Android.
You can switch emulators in Android Studio if one device isn't functioning.
App designs adjust automatically to fit the specifications of a different emulator device.
Gradle and Running the App
Gradle files play an important role in app performance.
Use the run button (big green arrow) to execute the app and see its appearance.
Debugging
The debugging tool identifies and helps fix errors in your code.
When referencing multiple screens, code must correctly link classes and naming conventions.
Cross-Referencing Files
MainActivity.kt
must correctly reference its corresponding designer file,activity_main.xml
.Avoid modifying auto-generated files; doing so can break the app's backend functionality.
Importance of Naming Conventions
Ensure that XML and Kotlin files have matching names to enable proper communication.
Proper referencing is crucial; mismatches can lead to non-functional apps.