Manifest permissions

We need to ensure our app has added the permission to access the internet. This is required as we are about to download the image from a specified URL and will have it displayed in our ImageViewer.

We have already covered the manifest permissions required in detail. Let us go ahead and add this permission:

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

The modified XML should look like the one shown here:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.natarajan.imageloader">

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

<application
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=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Now that we are all set with the changes made to XML, the Kotlin Code, build.gradle, and the AndroidManifest file, it is time to launch our app and understand the seamless loading process of the image via Picasso

Once we run the app, we should be able to see our device load the page, display the app name ImageLoader and display the image shown here from the URL:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset