PROGRAMMING FOR MOBILE PLATFORMS
10. AndroidManifest.xml (Declaring Activities)
5. AndroidManifest.xml (Declaring Activities)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.simpleapp">
<application
android:allowBackup="true"
android:theme="@style/Theme.AppCompat.Light"
android:label="SimpleApp"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".SecondActivity"/>
</application>
</manifest>
What this does:
- Declares MainActivity as the launcher activity.
- Declares SecondActivity as another activity in the app.
How to Run This App
- Open Android Studio and create a new project.
- Copy & Paste the above files into your project.
- Run the app on an emulator or a real device.
Expected Behavior:
- The app launches with a "Welcome to My Simple App" message.
- Clicking the button navigates to the second screen, which displays "This is the Second Screen!".