Community

  • V/api﹕ error: No internet connection posted

    New to Apnnext
    Using code


     api = new AppnextAPI(this, "My placement id");
        api.setAdListener(new AppnextAPI.AppnextAdListener() {
            @Override
            public void onError(String error) {
                Log.i(">>Ads Error",error);
            }
    
            @Override
            public void onAdsLoaded(ArrayList ads)
            {
                Log.i(">>Ads Loaded",">>>");
    //collect and store the data received
            }
        });
    

    in Log i get Error
    V/api﹕ error: No internet connection

    Reply
  • @fromheart Hi, did you make sure to add the following permissions to your AndroidManifest.xml File ?

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

    Director of Product, Appnext

  • @Carmel-Zimroni2

    Yes ..

     <?xml version="1.0" encoding="utf-8"?> 
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.dbs.brightnessdimmer">
    
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    
    <application
        android:allowBackup="true"
        android:icon="@drawable/npicon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:windowSoftInputMode="adjustPan|stateVisible"
            android:icon="@drawable/npicon"
            android:theme="@style/AppThemeNOActionBar"
            >
    
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
        </activity>
    
        <service android:name="com.appnext.appnextsdk.API.DownloadService"/>
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <activity
            android:name=".PrintDialogActivity"
            android:label="@string/app_name"
           />
    
        <activity
            android:name=".MainActivity2"
            android:label="@string/app_name"
            />
    </application>
    

    </manifest>

    also
    build.gradle

      dependency
      {
       complile files('libs/appnextAPI.jar')
      }
    Reply
Loading ...