Well we have finished the most important steps by this lesson. However we are yet to view our AndroidManifest. This file is important because we need to register our components right here as well as add the necessary permissions.

AndroidManifest.xml

This file is mandatory to android development. It is autogenerated by android studio and normally if you don’t add other activities in your project or require any special permission then you don’t have to touch. By default android studio registers the generated MainActivity file.

However in our case we will need to modify this project.

(a). Add Internet Connectivity Permission

You need internet connectivity permission for your app to be able to access internet from the users device.

    <uses-permission android:name="android.permission.INTERNET"/>

(b). Register Activities

Activities are android components and have to be registered like any other android component.

    <activity android:name=".Views.SplashActivity" android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Views.DashboardActivity" android:theme="@style/HomeTheme">
        </activity>
        <activity
            android:name=".Views.ScientistsActivity"
            android:label="Scientists "
            android:parentActivityName=".Views.DashboardActivity" />
        <activity
            android:name=".Views.CRUDActivity"
            android:theme="@style/CRUDTheme"
            android:label="CRUD Page "
            android:parentActivityName=".Views.DashboardActivity" />
        <activity
            android:name=".Views.DetailActivity"
            android:label="Details Page "
            android:parentActivityName=".Views.ScientistsActivity" />

Full Code

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dist="http://schemas.android.com/apk/distribution"
    package="info.camposha.firebasedatabasecrud">

    <uses-permission android:name="android.permission.INTERNET"/>
    <dist:module dist:instant="true" />

    <application
        android:name=".App"
        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=".Views.SplashActivity" android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Views.DashboardActivity" android:theme="@style/HomeTheme">
        </activity>
        <activity
            android:name=".Views.ScientistsActivity"
            android:label="Scientists "
            android:parentActivityName=".Views.DashboardActivity" />
        <activity
            android:name=".Views.CRUDActivity"
            android:theme="@style/CRUDTheme"
            android:label="CRUD Page "
            android:parentActivityName=".Views.DashboardActivity" />
        <activity
            android:name=".Views.DetailActivity"
            android:label="Details Page "
            android:parentActivityName=".Views.ScientistsActivity" />
    </application>

</manifest>