Android Open Source - CakeUI Cake Application






From Project

Back to project page CakeUI.

License

The source code is released under:

GNU General Public License

If you think the Android project CakeUI listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.cakeui.application;
/* w w w.ja v a  2s .c om*/
import android.app.Application;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 
 * @author Mariana Azevedo
 * @email mariana@bsi.ufla.br
 * 
 * @author Sarah Caixeta
 * @email caixeta.sarah@gmail.com
 * 
 * Class that implements a generic Application.
 *
 */

public class CakeApplication extends Application{

  private static CakeApplication instance;
  private ConnectivityManager connectivityManager; 
  
  public CakeApplication(){
    super();
    if (instance == null)
      instance = this;
  }
  
  @Override
  public void onCreate() {
    super.onCreate();
    connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
  }
  
  public boolean isConnectedToNetwork(){
    
    if (connectivityManager == null)
      return false;
    
    NetworkInfo mobileInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    NetworkInfo wifiInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    if ((mobileInfo != null && mobileInfo.getState() == NetworkInfo.State.CONNECTED)
        || (wifiInfo != null && wifiInfo.getState() == NetworkInfo.State.CONNECTED)) {
      return true;

    }
    return false; 
  }
  
}




Java Source Code List

com.cakeui.application.CakeApplication.java
com.cakeui.generic.activity.CakeActivity.java
com.cakeui.generic.adapter.CakeExpandableListViewAdapter.java
com.cakeui.generic.adapter.CakeGridViewAdapter.java
com.cakeui.generic.adapter.CakeListViewAdapter.java
com.cakeui.generic.dialog.CakeDialog.java
com.cakeui.generic.fragment.CakeFragment.java
com.cakeui.generic.service.CakePeriodicService.java
com.cakeui.generic.service.CakeService.java
com.cakeui.utils.CakeAsyncTask.java
com.cakeui.utils.CakeBroadcastReceiver.java
com.cakeui.utils.CakeComparator.java
com.cakeui.utils.CakeDataEncapsulation.java
com.cakeui.utils.CakeMap.java
com.cakeui.utils.enums.AsyncTaskType.java
com.cakeui.utils.enums.DialogType.java
com.cakeui.utils.enums.PagesOpen.java