{"id":56994,"date":"2024-01-08T20:22:39","date_gmt":"2024-01-08T14:52:39","guid":{"rendered":"https:\/\/www.oneclickitsolution.com\/blog\/?p=56994"},"modified":"2025-03-18T10:54:42","modified_gmt":"2025-03-18T05:24:42","slug":"call-apis-with-kotlin-coroutines","status":"publish","type":"post","link":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines","title":{"rendered":"How to Call API&#8217;s With Kotlin Coroutines In Right Way"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-introduction\">Introduction<\/h2>\n\n\n\n<p>API calls are a crucial part of any Android application development, and understanding how they work is essential. API, which stands for Application Programming Interface, connects application services to users, improving their experience. The API is responsible for handling significant changes, making it easy to modify the product. There are various ways to call an <a href=\"https:\/\/www.oneclickitsolution.com\/travel\/travel-api-integration\/\" target=\"_blank\" rel=\"noreferrer noopener\">API<\/a> and transfer data between applications in Android development. Asynchronous API calling is the most efficient method, and there are several ways to perform parallel work, including AsyncTask, RxJava, and Coroutine. Coroutine is the best option for efficient parallel work because it is highly recommended by the Kotlin language and Android development community. In this blog, we will discuss how to use Call API&#8217;s with Kotlin Coroutines.<\/p>\n\n\n\n<p>Before moving forward, if you are seeking to grasp the fundamentals of Coroutine, then you must check out this blog first:&nbsp;<\/p>\n\n\n\n<p><a href=\"https:\/\/www.oneclickitsolution.com\/blog\/Kotlin-Coroutines-in-android\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kotlin Coroutines in Android<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-let-s-start-learning-api-calling-with-the-help-of-kotlin-coroutine\">Let\u2019s start learning API calling with the help of Kotlin Coroutine<\/h2>\n\n\n\n<p>We are creating one demo application for the purpose of calling the imdb API to retrieve the movie data. The API information is provided in the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.oneclickitsolution.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"275\" src=\"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2021\/12\/Android-Custom-Library-CTA2.png\" alt=\"Android Custom Library CTA2\" class=\"wp-image-54440\" srcset=\"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2021\/12\/Android-Custom-Library-CTA2.png 1200w, https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2021\/12\/Android-Custom-Library-CTA2-768x176.png 768w, https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2021\/12\/Android-Custom-Library-CTA2-20x5.png 20w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-api-link-sign-up\">API Link (Sign-UP)<\/h3>\n\n\n\n<p>https:\/\/imdb-API.com\/&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">API (Use purpose) <\/h3>\n\n\n\n<p>https:\/\/imdb-API.com\/API\/SearchMovie\/{API_key}\/{expression}<\/p>\n\n\n\n<p>When you sign up in this given API, then the API site will give you an API key, it is necessary to call the API.&nbsp;<\/p>\n\n\n\n<p>Good to have knowledge for this demo :&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Normal API calling and it\u2019s fundamentals&nbsp;<\/li>\n\n\n\n<li>Android development fundamentals&nbsp;<\/li>\n\n\n\n<li>Dependency Injection normal information<\/li>\n<\/ul>\n\n\n\n<p>Reference : <a href=\"https:\/\/www.oneclickitsolution.com\/blog\/use-dagger-hilt-in-android\/\" target=\"_blank\" rel=\"noreferrer noopener\">Dagger Hilt in Android Step by Step Guidance<\/a><\/p>\n\n\n\n<p>This much knowledge is enough.<\/p>\n\n\n\n<p>Let\u2019s start by creating a project, first take all dependencies which are important for our project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\/\/gradle(app level)<\/h2>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">plugins {\n   id 'com.android.application'\n   id 'org.jetbrains.Kotlin.android'\n   id 'Kotlin-kapt'\n   id 'dagger.hilt.android.plugin'\n}\n\nandroid {\n   namespace 'com.example.asyncAPIcalling'\n   compileSdk 32\n\n   defaultConfig {\n       applicationId \"com.example.asyncAPIcalling\"\n       minSdk 22\n       targetSdk 32\n       versionCode 1\n       versionName \"1.0\"\n\n       testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n   }\n\n   buildFeatures {\n       dataBinding true\n   }\n\n   buildTypes {\n       release {\n           minifyEnabled false\n           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'\n       }\n   }\n   compileOptions {\n       sourceCompatibility JavaVersion.VERSION_1_8\n       targetCompatibility JavaVersion.VERSION_1_8\n   }\n   KotlinOptions {\n       jvmTarget = '1.8'\n   }\n}\n\ndependencies {\n\n   implementation 'androidx.core:core-ktx:1.7.0'\n   implementation 'androidx.appcompat:appcompat:1.5.1'\n   implementation 'com.google.android.material:material:1.7.0'\n   implementation 'androidx.constraintlayout:constraintlayout:2.1.4'\n   implementation 'com.google.android.gms:play-services-dtdi:16.0.0-beta01'\n   testImplementation 'junit:junit:4.13.2'\n   androidTestImplementation 'androidx.test.ext:junit:1.1.4'\n   androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'\n\n\n   \/\/retrofit\n   implementation \"com.squareup.retrofit2:retrofit:2.9.0\"\n   implementation \"com.squareup.okhttp3:okhttp:4.7.2\"\n   implementation \"com.squareup.okhttp3:logging-interceptor:4.7.2\"\n   implementation \"com.squareup.retrofit2:converter-gson:2.9.0\"\n\n   \/\/Coroutine\n   implementation 'org.jetbrains.Kotlinx:Kotlinx-Coroutines-core:1.4.2'\n   implementation 'org.jetbrains.Kotlinx:Kotlinx-Coroutines-android:1.4.1'\n\n   \/\/Coroutine Lifecycle Scope\n   implementation \"org.jetbrains.Kotlinx:Kotlinx-Coroutines-android:1.4.1\"\n   implementation \"org.jetbrains.Kotlinx:Kotlinx-Coroutines-core:1.4.2\"\n   implementation \"androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1\"\n\n   \/\/sdp-ssp\n   implementation 'com.intuit.sdp:sdp-android:1.1.0'\n   implementation 'com.intuit.ssp:ssp-android:1.1.0'\n\n   \/\/dagger-hilt\n   implementation \"com.google.dagger:hilt-android:2.44\"\n   kapt \"com.google.dagger:hilt-compiler:2.44\"\n\n   \/\/ok-http\n   implementation \"com.squareup.okhttp3:okhttp-bom:4.10.0\"\n\n   \/\/glide\n   implementation 'com.github.bumptech.glide:glide:4.14.2'\n\n}\n\n\/\/allow references to generated code\nkapt{\n   correctErrorTypes = true\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\/\/gradle (project level)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">\/\/ Top-level build file where you can add configuration options common to all sub-projects\/modules.\nplugins {\n   id 'com.android.application' version '7.3.1' apply false\n   id 'com.android.library' version '7.3.1' apply false\n   id 'org.jetbrains.Kotlin.android' version '1.7.20' apply false\n   id 'com.google.dagger.hilt.android' version '2.44' apply false\n}\n<\/code><\/pre>\n\n\n\n<p>After applying all dependencies in the both gradle, take a minute and see the code structure of our project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1366\" height=\"768\" src=\"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/code-structure.webp\" alt=\"code structure using kotlin coroutine\" class=\"wp-image-63026\" srcset=\"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/code-structure.webp 1366w, https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/code-structure-768x432.webp 768w, https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/code-structure-390x220.webp 390w, https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/code-structure-150x84.webp 150w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/figure>\n\n\n\n<p>Create one activity_main.xml file for design purpose :<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layout file for main activity :<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">activity_main.xml<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;layout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n   xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n   xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;\n\n   &lt;data&gt;\n       &lt;variable\n           name=\"mainviewmodel\"\n           type=\"com.example.asyncAPIcalling.ui.viewmodels.MainViewModel\" \/&gt;\n   &lt;\/data&gt;\n\n   &lt;androidx.constraintlayout.widget.ConstraintLayout\n       android:layout_width=\"match_parent\"\n       android:layout_height=\"match_parent\"\n       tools:context=\".ui.activities.MainActivity\"&gt;\n\n       &lt;TextView\n           android:id=\"@+id\/validation_text_for_search\"\n           android:layout_width=\"wrap_content\"\n           android:layout_height=\"wrap_content\"\n           app:layout_constraintTop_toTopOf=\"parent\"\n           app:layout_constraintEnd_toEndOf=\"parent\"\n           app:layout_constraintStart_toStartOf=\"parent\"\n           app:layout_constraintBottom_toBottomOf=\"parent\"\n           android:text=\"@string\/search_something_text\"\n           android:textSize=\"@dimen\/_12sdp\"\n           android:textColor=\"@android:color\/holo_green_dark\"\n           \/&gt;\n\n       &lt;androidx.appcompat.widget.Toolbar\n           android:id=\"@+id\/title_toolbar\"\n           android:layout_width=\"match_parent\"\n           android:layout_height=\"60dp\"\n           android:background=\"#3EB489\"\n           android:textAlignment=\"center\"\n           app:layout_constraintTop_toTopOf=\"parent\"\n           app:navigationIcon=\"@drawable\/ic_movie\"\n           app:subtitle=\"cartoon category\"\n           app:subtitleTextColor=\"@color\/white\"\n           app:title=\"Movies\"\n           app:titleTextColor=\"@color\/white\"&gt;\n\n       &lt;\/androidx.appcompat.widget.Toolbar&gt;\n\n       &lt;EditText\n           android:id=\"@+id\/the_search_bar\"\n           android:layout_width=\"0dp\"\n           android:layout_height=\"wrap_content\"\n           android:background=\"@drawable\/curved_background\"\n           android:padding=\"@dimen\/_5sdp\"\n           android:text=\"@={mainviewmodel.expressionToSearch}\"\n           android:layout_marginTop=\"@dimen\/_5sdp\"\n           android:layout_marginStart=\"@dimen\/_5sdp\"\n           app:layout_constraintStart_toStartOf=\"parent\"\n           app:layout_constraintEnd_toStartOf=\"@+id\/the_search_button\"\n           app:layout_constraintTop_toBottomOf=\"@id\/title_toolbar\"\n           \/&gt;\n\n       &lt;androidx.constraintlayout.utils.widget.ImageFilterView\n           android:id=\"@+id\/the_search_button\"\n           android:layout_width=\"@dimen\/_30sdp\"\n           android:layout_height=\"@dimen\/_30sdp\"\n           android:src=\"@drawable\/ic_search\"\n           app:layout_constraintTop_toTopOf=\"@id\/the_search_bar\"\n           app:layout_constraintEnd_toEndOf=\"parent\"\n           android:layout_marginEnd=\"@dimen\/_5sdp\"\n           android:padding=\"@dimen\/_5sdp\"\n           android:paddingEnd=\"@dimen\/_10sdp\"\n           android:background=\"@drawable\/curved_background_right\"\n           \/&gt;\n\n       &lt;ProgressBar\n           android:id=\"@+id\/main_progress_bar\"\n           android:layout_width=\"wrap_content\"\n           android:layout_height=\"wrap_content\"\n           android:visibility=\"gone\"\n           app:layout_constraintBottom_toBottomOf=\"parent\"\n           app:layout_constraintEnd_toEndOf=\"parent\"\n           app:layout_constraintStart_toStartOf=\"parent\"\n           app:layout_constraintTop_toTopOf=\"parent\"\n           tools:visibility=\"visible\" \/&gt;\n\n       &lt;androidx.recyclerview.widget.RecyclerView\n           android:id=\"@+id\/movie_recycler_view\"\n           android:layout_width=\"match_parent\"\n           android:layout_height=\"0dp\"\n           android:layout_marginTop=\"@dimen\/_5sdp\"\ntools:listitem=\"@layout\/raw_movies_item_layout\"\n           app:layout_constraintBottom_toBottomOf=\"parent\"\n           app:layout_constraintTop_toBottomOf=\"@id\/the_search_bar\" \/&gt;\n\n   &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;\n&lt;\/layout&gt;<\/code><\/pre>\n\n\n\n<p>Then after we will complete the raw item file for our recyclerview, It will show us how our single item will look like this.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layout File for items<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">raw_movies_item_layout.xml<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;layout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n   xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n   xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"&gt;\n\n   &lt;data&gt;\n\n   &lt;\/data&gt;\n\n   &lt;RelativeLayout\n       android:layout_width=\"match_parent\"\n       android:layout_height=\"wrap_content\"&gt;\n\n       &lt;androidx.constraintlayout.widget.ConstraintLayout\n           android:layout_width=\"match_parent\"\n           android:layout_height=\"match_parent\"&gt;\n\n           &lt;ImageView\n               android:id=\"@+id\/image_of_movies\"\n               android:layout_width=\"match_parent\"\n               android:layout_height=\"@dimen\/_125sdp\"\n               tools:src=\"@mipmap\/ic_launcher\"\n               android:scaleType=\"centerCrop\"\n               app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n           &lt;TextView\n               android:id=\"@+id\/title_of_movie\"\n               android:layout_width=\"wrap_content\"\n               android:layout_height=\"wrap_content\"\n               tools:text=\"Inception\"\n               android:textSize=\"@dimen\/_18ssp\"\n               android:textStyle=\"bold\"\n               android:textColor=\"@color\/black\"\n               app:layout_constraintTop_toBottomOf=\"@id\/image_of_movies\"\n               app:layout_constraintStart_toStartOf=\"parent\" \/&gt;\n\n           &lt;TextView\n               android:id=\"@+id\/description_of_movie\"\n               android:layout_width=\"wrap_content\"\n               android:layout_height=\"wrap_content\"\n               tools:text=\"this is the best movie ever i watched\"\n               android:textSize=\"@dimen\/_15ssp\"\n               app:layout_constraintStart_toStartOf=\"parent\"\n               app:layout_constraintTop_toBottomOf=\"@+id\/title_of_movie\" \/&gt;\n\n\n       &lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;\n\n   &lt;\/RelativeLayout&gt;\n&lt;\/layout&gt;\n\n\nCompleting this, Then after see our manifest file: \n\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n   xmlns:tools=\"http:\/\/schemas.android.com\/tools\"&gt;\n\n   &lt;uses-permission android:name=\"android.permission.INTERNET\"\/&gt;\n\n   &lt;application\n       android:name=\".base.MyApplication\"\n       android:allowBackup=\"true\"\n       android:dataExtractionRules=\"@xml\/data_extraction_rules\"\n       android:fullBackupContent=\"@xml\/backup_rules\"\n       android:icon=\"@mipmap\/ic_launcher\"\n       android:label=\"@string\/app_name\"\n       android:roundIcon=\"@mipmap\/ic_launcher_round\"\n       android:supportsRtl=\"true\"\n       android:theme=\"@style\/Theme.AsyncAPICalling\"\n       android:usesCleartextTraffic=\"true\"\n       tools:targetAPI=\"31\"&gt;\n       &lt;activity\n           android:name=\".ui.activities.MainActivity\"\n           android:exported=\"true\"&gt;\n           &lt;intent-filter&gt;\n               &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\n\n               &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\n           &lt;\/intent-filter&gt;\n\n           &lt;meta-data\n               android:name=\"android.app.lib_name\"\n               android:value=\"\" \/&gt;\n       &lt;\/activity&gt;\n   &lt;\/application&gt;\n\n&lt;\/manifest&gt;<\/code><\/pre>\n\n\n\n<p>After finishing the manifest and its permissions, We will start the coding for dagger-hilt.<\/p>\n\n\n\n<p>For Dagger-hilt first we have to declare one application class and then this class should be put in the manifest file like above. Put the application class package name in the \u201cname\u201d parameter of application tag as shown in the above code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Application class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">MyApplication.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.base\n\nimport android.app.Application\nimport dagger.hilt.android.HiltAndroidApp\n\n@HiltAndroidApp\nclass MyApplication : Application() {\n\n}\n<\/code><\/pre>\n\n\n\n<p>By using that annotation @HiltAndroidApp we can notify the hilt that this is the application class for our dependency injection operations. And This class will be put in the base package only.&nbsp;<\/p>\n\n\n\n<p>Then after coming in the injection package, here you have to put the module class which can create the function that helps to put the instance of needed variable and data.<\/p>\n\n\n\n<p>So create one class of module which declares the function of the retrofit instance.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Module class <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">RetrofitInstanceModuel.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.injection\n\nimport com.example.asyncAPIcalling.network.APIService\nimport dagger.Module\nimport dagger.Provides\nimport dagger.hilt.InstallIn\nimport dagger.hilt.components.SingletonComponent\nimport retrofit2.Retrofit\nimport retrofit2.converter.gson.GsonConverterFactory\nimport retrofit2.create\nimport javax.inject.Singleton\n\nconst val BASE_URL = \"https:\/\/imdb-API.com\/\"\n\n@Module\n@InstallIn(SingletonComponent::class)\nclass RetrofitInstanceModule {\n\n   @Provides\n   @Singleton\n   fun theRetrofitInstance() : APIService {\n       val API : APIService by lazy {\n           Retrofit.Builder()\n               .baseUrl(BASE_URL)\n               .addConverterFactory(GsonConverterFactory.create())\n               .build()\n               .create(APIService::class.java)\n       }\n       return API\n   }\n\n}\n<\/code><\/pre>\n\n\n\n<p>You can see here that there are some annotations which are used to perform dependency injection.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">@Module&nbsp;<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">@InstallIn<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">@Proivdes&nbsp;<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">@Singleton&nbsp;<\/h4>\n\n\n\n<p><strong>@Module<\/strong> annotation will be used to notify the dagger-hilt that this is the module class of our project which can use the function declaration of needed instance class.<\/p>\n\n\n\n<p>And <strong>@Proivdes<\/strong> annotation will be used to notify that this function will be put where you want by @Inject.<\/p>\n\n\n\n<p>In this theRetrofitInstance() function, we build the retrofit instance for generating API calling. We have to pass the base url of the API.<\/p>\n\n\n\n<p>For Creating the retrofit instance you first create one interface class of the API calling function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">API service class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">APIService.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.network\n\nimport com.example.asyncAPIcalling.network.model.IMDB\nimport retrofit2.Response\nimport retrofit2.http.GET\nimport retrofit2.http.Path\n\ninterface APIService {\n@GET(\"\/API\/SearchMovie\/{API_key}\/{expression}\")\n  suspend fun imdbFunction(\n       @Path(\"API_key\") APIKey : String,\n       @Path(\"expression\") searchExpression : String,\n   ) : Response&lt;IMDB&gt;\n\n}\n<\/code><\/pre>\n\n\n\n<p>So, We will create one interface class which will be used for declaration of all API calling functions.<\/p>\n\n\n\n<p>You can see above code there is one imdbFunction() function which is a suspend function, whenever you have to use Coroutine function then you must have to declare it as suspend function.&nbsp;<\/p>\n\n\n\n<p>In the above function @GET annotation is used for retrieving the data from API, this annotation changes according to its operation type.&nbsp;<\/p>\n\n\n\n<p>Like : <strong>@PATCH<\/strong>, <strong>@GET<\/strong>,<strong> @POST<\/strong> etc\u2026<\/p>\n\n\n\n<p>And after that the return type of function is IMDB class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Model class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">IMDB.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.network.model\n\nimport com.google.gson.annotations.SerializedName\n\n\n\ndata class IMDB(\n   @SerializedName(\"searchType\") var searchType: String? = null,\n   @SerializedName(\"expression\") var expression: String? = null,\n   @SerializedName(\"results\") var results: ArrayList&lt;Results&gt; = arrayListOf(),\n   @SerializedName(\"errorMessage\") var errorMessage: String? = null,\n)\n\ndata class Results(\n   @SerializedName(\"id\") var id: String? = null,\n   @SerializedName(\"resultType\") var resultType: String? = null,\n   @SerializedName(\"image\") var image: String? = null,\n   @SerializedName(\"title\") var title: String? = null,\n   @SerializedName(\"description\") var description: String? = null,\n)\n<\/code><\/pre>\n\n\n\n<p>We use the Data class for containing the data which is provided by the server. So we can easily fetch data and communicate with them.&nbsp;<\/p>\n\n\n\n<p>You see there is one annotation like <strong>@SerializedName<\/strong>, This is a normal annotation but creates a great impact to our operation of doing API calling. It will hand-me-down the serialize field with another name rather than its actual name. If API give me the \u201creal_name\u201d field but i have to use \u201cunreal_name\u201d so i will put down the \u201creal_name\u201d in @SearializedName(\u201creal_name\u201d) and then declare that \u201cunreal_name\u201d, then i will able to use that \u201cunreal_name\u201d all over the project and it will work like \u201creal_name\u201d.<\/p>\n\n\n\n<p>After creating all functions, let\u2019s go to the adapters package and quickly create the adapter class for our recycler view. In our adapter class of recyclerview we will use the DiffUtil method to create efficient work from recyclerview. It is the more optimized and structured way to create one adapter class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adapter class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">MoviesRecyclerAdapter.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.ui.adapters\n\nimport android.view.LayoutInflater\nimport android.view.ViewGroup\nimport androidx.recyclerview.widget.AsyncListDiffer\nimport androidx.recyclerview.widget.DiffUtil\nimport androidx.recyclerview.widget.RecyclerView\nimport com.bumptech.glide.Glide\nimport com.example.asyncAPIcalling.R\nimport com.example.asyncAPIcalling.databinding.RawMoviesItemLayoutBinding\nimport com.example.asyncAPIcalling.network.model.Results\n\nclass MoviesRecyclerAdapter : RecyclerView.Adapter&lt;MoviesRecyclerAdapter.MoviesViewHolder&gt;() {\n\n   inner class MoviesViewHolder(private val rawMoviesItemLayoutBinding: RawMoviesItemLayoutBinding) :\n       RecyclerView.ViewHolder(rawMoviesItemLayoutBinding.root) {\n\n           fun bind(results: Results){\n\n               rawMoviesItemLayoutBinding.apply {\n                   Glide.with(root.context)\n                       .load(results.image)\n                       .placeholder(R.drawable.placeholder)\n                       .into(imageOfMovies)\n\n                   titleOfMovie.text = results.title\n                   descriptionOfMovie.text = results.description\n               }\n\n           }\n\n   }\n\n   private val diffCallback = object : DiffUtil.ItemCallback&lt;Results&gt;()\n   {\n       override fun areItemsTheSame(oldItem: Results, newItem: Results): Boolean {\n           return oldItem.id == newItem.id\n       }\n\n       override fun areContentsTheSame(oldItem: Results, newItem: Results): Boolean {\n           return oldItem == newItem\n       }\n   }\n\n   private val differ = AsyncListDiffer(this, diffCallback)\n\n   var result : List&lt;Results&gt;\n   get() = differ.currentList\n   set(value){\n       differ.submitList(value)\n   }\n\n   override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MoviesViewHolder {\n       return MoviesViewHolder(RawMoviesItemLayoutBinding.inflate(LayoutInflater.from(parent.context),\n           parent,\n           false))\n   }\n\n   override fun onBindViewHolder(holder: MoviesViewHolder, position: Int) {\n       holder.bind(result[position])\n   }\n\n   override fun getItemCount() = result.size\n\n}\n<\/code><\/pre>\n\n\n\n<p>First we will extend the reyclerview class and adapter. Then after creating one inner class called ViewHolder class.&nbsp;<\/p>\n\n\n\n<p>We are using the dataBinding that\u2019s why we put that one Binding variable. So we can access the view\u2019s id easily. In the inner class we create one function class called bind(). In this apply all data and initialize with the view.&nbsp;<\/p>\n\n\n\n<p>Succeeding the bind method let\u2019s create an ItemCallback of diffUtils. This will compare the old list and new list, Then maintain the recyclerview in a good way.&nbsp;<\/p>\n\n\n\n<p>Create one result variable which can contain a list of result class. For that we have to use the getter-setter method in Kotlin.&nbsp;<\/p>\n\n\n\n<p>Finishing the all processes in this adapter, Import all three methods of adapter class and initialize all things like above code.<\/p>\n\n\n\n<p>Jump to the viewmodel package and start the creating viewmodel class for the main activity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ViewModel Class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">MainViewModel.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.ui.viewmodels\n\nimport androidx.lifecycle.MutableLiveData\nimport androidx.lifecycle.ViewModel\nimport androidx.lifecycle.viewModelScope\nimport com.example.asyncAPIcalling.network.APIService\nimport com.example.asyncAPIcalling.network.model.IMDB\nimport com.example.asyncAPIcalling.utils.Const.Companion.API_KEY\nimport dagger.hilt.android.lifecycle.HiltViewModel\nimport Kotlinx.Coroutines.*\nimport javax.inject.Inject\n\n@HiltViewModel\nclass MainViewModel @Inject constructor(private val retrofitInstance: APIService) : ViewModel() {\n\n   val responseContainer = MutableLiveData&lt;IMDB&gt;()\n   val errorMessage = MutableLiveData&lt;String&gt;()\n   val isShowProgress = MutableLiveData&lt;Boolean&gt;()\n   val expressionToSearch = MutableLiveData(\"\")\n\n   var job: Job? = null\n   val exceptionHandler = CoroutineExceptionHandler { _, throwable -&gt;\n       onError(\"Exception handled : ${throwable.localizedMessage}\")\n   }\n\n   fun getMoviesFromAPI(expression : String) {\n       isShowProgress.value = true\n       job = viewModelScope.launch {\n           val response = retrofitInstance.imdbFunction(API_KEY, expression)\n           withContext(Dispatchers.Main) {\n               if (response.isSuccessful) {\n                   responseContainer.postValue(response.body())\n                   isShowProgress.value = false\n               } else {\n                   onError(\"Error : ${response.message()}\")\n               }\n           }\n       }\n\n\n   }\n\n   private fun onError(message: String) {\n       errorMessage.value = message\n       isShowProgress.value = false\n   }\n\n   override fun onCleared() {\n       super.onCleared()\n       job?.cancel()\n   }\n\n}\n<\/code><\/pre>\n\n\n\n<p>In this class we have to use the annotation of hilt called as <strong>@HiltViewModel.<\/strong> By help of this annotation we are able to notify the hilt that this is the view model class. Declare the variables which are observable to the main class. And then create one function for API calling, it is called getMoviesFromAPI(), it has one parameter to give the expression for search. In this use job variable cause job will help to create cancelable Coroutine. Start viewmodel scope and in this initialize one variable to call the interface class\u2019s API function. For that we have to inject one variable instance of retrofit into a constructor of the viewmodel class by help of <strong>@Inject<\/strong> annotation. In this put the API key to that API function and that API key will create in the cons class of Util package.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Util class of constants<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Const.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.utils\n\nclass Const  {\n\n   companion object{\n       const val API_KEY = \"kindly_put_your_API_key_here\"\n   }\n\n}\n<\/code><\/pre>\n\n\n\n<p>Come back to the viewmodel class, And simply put this API_KEY variable in that parameters of function.&nbsp; Make one condition that if the response is successful then put all data to the mutable live variable which can be observable by the main activity. And set the isShowProgress false. This condition will false then put the message to the onError() function.&nbsp;<\/p>\n\n\n\n<p>The onError function simply works to put the message of the server to the errorMessage mutable live data.<\/p>\n\n\n\n<p>Then after override the onCleared() method and candle the created job. If we can not use the job then it will be ok cause it will use the viewmodelscope so when the viewmodel is destroyed it will be automatically canceled by itself. But for knowledge purposes we can use this job\u2019s variable. Also for the knowledge purpose you can see here that one exceptional handling variable is used to help with the Coroutine. It will throw an exception.<\/p>\n\n\n\n<p>Quickly set all the values to the main activity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Main class<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">MainActivity.kt<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"kotlin\" class=\"language-kotlin\">package com.example.asyncAPIcalling.ui.activities\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\nimport android.view.View\nimport android.widget.Toast\nimport androidx.lifecycle.Observer\nimport androidx.lifecycle.ViewModelProvider\nimport androidx.recyclerview.widget.LinearLayoutManager\nimport com.example.asyncAPIcalling.databinding.ActivityMainBinding\nimport com.example.asyncAPIcalling.network.model.Results\nimport com.example.asyncAPIcalling.ui.adapters.MoviesRecyclerAdapter\nimport com.example.asyncAPIcalling.ui.viewmodels.MainViewModel\nimport dagger.hilt.android.AndroidEntryPoint\n\n@AndroidEntryPoint\nclass MainActivity : AppCompatActivity() {\n\n   private lateinit var activityMainBinding: ActivityMainBinding\n   private lateinit var moviesAdapter : MoviesRecyclerAdapter\n   private lateinit var mainViewModel: MainViewModel\n\n   override fun onCreate(savedInstanceState: Bundle?) {\n       super.onCreate(savedInstanceState)\n       activityMainBinding = ActivityMainBinding.inflate(layoutInflater)\n       setContentView(activityMainBinding.root)\n\n       setUpViewModel()\n\n       setUpRecyclerView()\n\n       mainViewModel.responseContainer.observe(this, Observer {\n           if (it != null){\n\n               moviesAdapter.result = it.results\n               activityMainBinding.validationTextForSearch.visibility = View.GONE\n\n           }else{\n               Toast.makeText(this, \"There is some error!\", Toast.LENGTH_SHORT).show()\n           }\n       })\n\n       mainViewModel.isShowProgress.observe(this, Observer {\n           if (it){\n               activityMainBinding.mainProgressBar.visibility = View.VISIBLE\n               activityMainBinding.validationTextForSearch.visibility = View.GONE\n           }\n           else{\n               activityMainBinding.mainProgressBar.visibility = View.GONE\n               activityMainBinding.validationTextForSearch.visibility = View.GONE\n           }\n       })\n\n\n       mainViewModel.errorMessage.observe(this, Observer {\n           Toast.makeText(this, it, Toast.LENGTH_SHORT).show()\n       })\n\n       activityMainBinding.theSearchButton.setOnClickListener { it-&gt;\n           if(activityMainBinding.theSearchBar.text.isEmpty()){\n               Toast.makeText(this, \"Please Enter movie type\", Toast.LENGTH_SHORT).show()\n           }\n           else{\n               val searchText = activityMainBinding.theSearchBar.text\n\n               mainViewModel.getMoviesFromAPI(searchText.toString())\n\n           }\n\n       }\n\n   }\n\n   private fun setUpRecyclerView() = activityMainBinding.movieRecyclerView.apply {\n       moviesAdapter = MoviesRecyclerAdapter()\n       adapter = moviesAdapter\n       layoutManager = LinearLayoutManager(this@MainActivity)\n   }\n\n   private fun setUpViewModel(){\n       mainViewModel = ViewModelProvider(this)[MainViewModel::class.java]\n   }\n\n}\n<\/code><\/pre>\n\n\n\n<p>Use the annotation for hilt notify, <strong>@AndoridEntryPoint<\/strong> which gives the idea about main activity to the dagger-hilt.<\/p>\n\n\n\n<p>First we have to declare the binding variable of the xml file of the main activity. Then after declaring the adapter and viewmodel.<\/p>\n\n\n\n<p>Set that binding variable to use and access the view\u2019s id. Then simply create two functions for set-up the recycler view and viewmodel.&nbsp;<\/p>\n\n\n\n<p>Simply observe the mutable live variable and attach it with the adapter and views of the main activity. By the help of the viewmodel instance.&nbsp;<\/p>\n\n\n\n<p>In conclusion, we can say that at present time, Kotlin is becoming one of the most popular programming languages for <a href=\"https:\/\/www.oneclickitsolution.com\/services\/android-app-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">android application development<\/a> and therefore every developer should learn it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction API calls are a crucial part of any Android application development, and understanding how they work is essential. API, which stands for Application Programming Interface, connects application services to users, improving their experience. The API is responsible for handling significant changes, making it easy to modify the product. There are various ways to call &hellip;<\/p>\n","protected":false},"author":77,"featured_media":63024,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[516],"tags":[901,915,798,1205],"class_list":["post-56994","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobile-apps","tag-android","tag-app-development","tag-best-mobile-application-development","tag-call-apis-with-kotlin-coroutines"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.2.1 (Yoast SEO v24.8.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Call API&#039;s With Kotlin Coroutines In Right Way<\/title>\n<meta name=\"description\" content=\"Learn the correct way to call API&#039;s with Kotlin coroutines in this comprehensive guide and improve your app&#039;s performance and efficiency.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Call API&#039;s With Kotlin Coroutines In Right Way\" \/>\n<meta property=\"og:description\" content=\"Learn the correct way to call API&#039;s with Kotlin coroutines in this comprehensive guide and improve your app&#039;s performance and efficiency.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines\" \/>\n<meta property=\"og:site_name\" content=\"OneClick IT Consultancy\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/oneclickconsultancy\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-08T14:52:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-18T05:24:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Abhishek Oza\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@OneclickIT\" \/>\n<meta name=\"twitter:site\" content=\"@OneclickIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhishek Oza\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Call API's With Kotlin Coroutines In Right Way","description":"Learn the correct way to call API's with Kotlin coroutines in this comprehensive guide and improve your app's performance and efficiency.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines","og_locale":"en_US","og_type":"article","og_title":"How to Call API's With Kotlin Coroutines In Right Way","og_description":"Learn the correct way to call API's with Kotlin coroutines in this comprehensive guide and improve your app's performance and efficiency.","og_url":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines","og_site_name":"OneClick IT Consultancy","article_publisher":"https:\/\/www.facebook.com\/oneclickconsultancy","article_published_time":"2024-01-08T14:52:39+00:00","article_modified_time":"2025-03-18T05:24:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp","type":"image\/webp"}],"author":"Abhishek Oza","twitter_card":"summary_large_image","twitter_creator":"@OneclickIT","twitter_site":"@OneclickIT","twitter_misc":{"Written by":"Abhishek Oza","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#article","isPartOf":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines"},"author":{"name":"Abhishek Oza","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#\/schema\/person\/71a995b022f9894449a29f9ab4ec66e9"},"headline":"How to Call API&#8217;s With Kotlin Coroutines In Right Way","datePublished":"2024-01-08T14:52:39+00:00","dateModified":"2025-03-18T05:24:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines"},"wordCount":1500,"publisher":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#primaryimage"},"thumbnailUrl":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp","keywords":["Android","App Development","Best Mobile Application Development","Call API&#039;s With Kotlin Coroutines"],"articleSection":["Mobile Application"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines","url":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines","name":"How to Call API's With Kotlin Coroutines In Right Way","isPartOf":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#primaryimage"},"image":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#primaryimage"},"thumbnailUrl":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp","datePublished":"2024-01-08T14:52:39+00:00","dateModified":"2025-03-18T05:24:42+00:00","description":"Learn the correct way to call API's with Kotlin coroutines in this comprehensive guide and improve your app's performance and efficiency.","breadcrumb":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#primaryimage","url":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp","contentUrl":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2024\/01\/call-apis-with-kotlin-coroutines.webp","width":1200,"height":628,"caption":"call APIs with kotlin coroutines in right way"},{"@type":"BreadcrumbList","@id":"https:\/\/www.oneclickitsolution.com\/blog\/call-apis-with-kotlin-coroutines#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.oneclickitsolution.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Call API&#8217;s With Kotlin Coroutines In Right Way"}]},{"@type":"WebSite","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#website","url":"https:\/\/www.oneclickitsolution.com\/blog\/","name":"OneClick IT Consultancy","description":"We Build Brands from Ideas","publisher":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/#organization"},"alternateName":"OneClick IT Solution","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.oneclickitsolution.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#organization","name":"OneClick IT Consultancy","alternateName":"OneClick IT Solution","url":"https:\/\/www.oneclickitsolution.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2022\/10\/oneclick-official-logo.png","contentUrl":"https:\/\/www.oneclickitsolution.com\/blog\/wp-content\/uploads\/2022\/10\/oneclick-official-logo.png","width":100,"height":100,"caption":"OneClick IT Consultancy"},"image":{"@id":"https:\/\/www.oneclickitsolution.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/oneclickconsultancy","https:\/\/x.com\/OneclickIT","https:\/\/www.instagram.com\/oneclick.it.consultancy\/","https:\/\/www.linkedin.com\/company\/one-click-it-consultancy\/","https:\/\/www.pinterest.com\/oneclickitconsultancy\/","https:\/\/www.youtube.com\/channel\/UCsEG6aiwOwvYrcZxMoP5xjg","https:\/\/oneclickit.tumblr.com\/","https:\/\/dribbble.com\/oneclickitconsultancy"]},{"@type":"Person","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#\/schema\/person\/71a995b022f9894449a29f9ab4ec66e9","name":"Abhishek Oza","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.oneclickitsolution.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a918bc5f9e0daecc14e1076369bed383?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a918bc5f9e0daecc14e1076369bed383?s=96&d=mm&r=g","caption":"Abhishek Oza"},"description":"I am a Fresher Android Developer with a proven track record of working at OneClick IT Consultancy. I have knowledge of mobile app development and I am pursuing the 2nd Year of my Btech Degree at SVBIT (Shankersinh Vaghela Bapu Institute of Technology). I want to explore more in Android and other Hybrid Languages.","sameAs":["https:\/\/www.linkedin.com\/in\/abhishek-oza-071019227\/"],"url":"https:\/\/www.oneclickitsolution.com\/blog\/author\/abhishekoza"}]}},"_links":{"self":[{"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/posts\/56994"}],"collection":[{"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/comments?post=56994"}],"version-history":[{"count":1,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/posts\/56994\/revisions"}],"predecessor-version":[{"id":63027,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/posts\/56994\/revisions\/63027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/media\/63024"}],"wp:attachment":[{"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/media?parent=56994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/categories?post=56994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oneclickitsolution.com\/blog\/wp-json\/wp\/v2\/tags?post=56994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}