I have been working on a project and using the fast android networking api. I have added the below dependency - ( implementation 'com.amitshekhar.android:android-networking:1.0.2') in the gradle module file and also added the internet permission in Android Manifesto File. Still Android Studio is not able to fetch the "AndroidNetworking" Class and it's giving it as red underlined.
Gradle module
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.apirequestusingfastandroidnetworking'
compileSdk 33
defaultConfig {
applicationId "com.example.apirequestusingfastandroidnetworking"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
package com.example.apirequestusingfastandroidnetworking;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String url= "https://jsonplaceholder.typicode.com/users"; //using get api
AndroidNetworking.initialize(this);
AndroidNetworking.get(url);
}
}
Can somebody tell me that what could be issue bcoz of which android id not fetching the "AndroidNetworking".