API Reference

com.kinvey.android.network

Class AndroidNetworkManager<T extends GenericJson>

  • com.kinvey.android.network.AndroidNetworkManager<T>


  • public class AndroidNetworkManager<T extends GenericJson>

    Wraps the NetworkManager public methods in asynchronous functionality using native Android AsyncTask.

    This functionality can be accessed through the com.kinvey.android.Client#appData convenience method. NetworkManager gets and saves entities that extend com.google.api.client.json.GenericJson. A class that extends GenericJson can map class members to KinveyCollection properties using com.google.api.client.util.Key attributes. For example, the following will map a string "city" to a Kinvey collection attributed named "city":

     @Key private String city; 

    The @Key attribute also can take an optional name, which will map the member to a different attribute name in the Kinvey collection.

     @Key("_id") private String customerID; 

    Methods in this API use either com.kinvey.android.callback.KinveyListCallback for retrieving entity sets, com.kinvey.android.callback.KinveyDeleteCallback for deleting appData, or the general-purpose com.kinvey.java.core.KinveyClientCallback used for retrieving single entites or saving Entities.

    Entity Set sample:

     NetworkManager myAppData = kinveyClient.appData("myCollection",EventEntity.class); myAppData.get(appData().query, new KinveyListCallback { public void onFailure(Throwable t) { ... } public void onSuccess(EventEntity[] entities) { ... } });  

    • Constructor Summary

      Constructors 
      Constructor and Description
      AndroidNetworkManager()
      Constructor to instantiate the NetworkManager class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean isOnline()
      Method to check if the current runtime environment has an active connection to the internet, this implementation is tightly coupled with the Android Operating System
    • Constructor Detail

      • AndroidNetworkManager

        public AndroidNetworkManager()

        Constructor to instantiate the NetworkManager class.

    • Method Detail

      • isOnline

        public boolean isOnline()

        Method to check if the current runtime environment has an active connection to the internet, this implementation is tightly coupled with the Android Operating System

        Returns:
        true if the device is connected or connecting