Android Open Source - groundify-android Utility






From Project

Back to project page groundify-android.

License

The source code is released under:

GNU General Public License

If you think the Android project groundify-android 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 deftsoft.android.iground.utility;
/*from w ww  .  j a  v  a 2  s.  c o  m*/
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import android.widget.Toast;

public class Utility {

  private final String TAG = "Utility";

  private boolean mConnected = false;

  public boolean isOnline(Context context) {
  
    try {
       
      
      Log.i(TAG, "Detect Connection");

      ConnectivityManager connectivityManager = (ConnectivityManager) context

      .getSystemService(Context.CONNECTIVITY_SERVICE);

      NetworkInfo networkInfo = connectivityManager
          .getActiveNetworkInfo();
      
      mConnected = networkInfo != null && networkInfo.isAvailable()
          
          && networkInfo.isConnected();
      
      Log.i(TAG, "mConnected = " + mConnected);

    } catch (Exception e) {

      mConnected = false;
      
      e.printStackTrace();
    }
    
    Log.i(TAG, "mConnected = " + mConnected);

    return mConnected;
  }

  public void toastMessage(Context cont, String message) {

    Toast.makeText(cont, message, Toast.LENGTH_LONG).show();

  }

  public boolean isEmailValid (Context context, String email )
  
  {
  
    String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
   
    CharSequence inputStr = email;
                     
      Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
   
      Matcher matcher = pattern.matcher(inputStr);
  
    if (matcher.matches())
    
    {
      
      return true ;
      
    }
    
    else {

      
      return false ;
    }
    
    
    
  }
  
  
  
}




Java Source Code List

.ConsequenceImageGridActivity.java
custom.adapter.pckg.GridAdapter.java
custom.adapter.pckg.MyAdapter.java
custom.adapter.pckg.MyLazyAdapter.java
custom.adapter.pckg.MySpinnerAdapter.java
deftsoft.android.iground.utility.Base64.java
deftsoft.android.iground.utility.ChildDetail.java
deftsoft.android.iground.utility.DatePickerFragment.java
deftsoft.android.iground.utility.DeleteChildWebResponse.java
deftsoft.android.iground.utility.GetNewCosequence.java
deftsoft.android.iground.utility.HttpUploader.java
deftsoft.android.iground.utility.ImageFilePath.java
deftsoft.android.iground.utility.SetConSeqWebServiceWebResponse.java
deftsoft.android.iground.utility.SignupDetail.java
deftsoft.android.iground.utility.TimePickerFragment.java
deftsoft.android.iground.utility.Utility.java
deftsoft.android.iground.utility.ViewConseqDetail.java
deftsoft.android.iground.utility.WebServiceLinks.java
deftsoft.android.iground.utility.WebServiceResponse.java
deftsoft.android.image.upload.Base64.java
deftsoft.android.image.upload.UploadImageToServer.java
deftsoft.iground.android.AddChildScreen.java
deftsoft.iground.android.AddConsequenceActivity.java
deftsoft.iground.android.BridgeClass.java
deftsoft.iground.android.CopyOfConsequenceImageGridActivity.java
deftsoft.iground.android.DeleteChildScreen.java
deftsoft.iground.android.GrounChild.java
deftsoft.iground.android.HomeScreenActivity.java
deftsoft.iground.android.Home.java
deftsoft.iground.android.LogInScreenActivity.java
deftsoft.iground.android.MyHttpClient.java
deftsoft.iground.android.SignUpScreenActivity.java
deftsoft.iground.android.ThankYouActivity.java
deftsoft.iground.android.UILApplication.java
deftsoft.iground.android.ViewConsequence.java
deftsoft.iground.android.CustomizeListView.AbsListViewBaseActivity.java
deftsoft.iground.android.CustomizeListView.BaseActivity.java
deftsoft.iground.android.CustomizeListView.Constants.java
iground.child.interfaces.Consequnceselected.java