Android Open Source - appboy-android-sdk String Utils

From Project

Back to project page appboy-android-sdk.


The source code is released under:

Copyright (c) 2014 Appboy, Inc. All rights reserved. * Use of source code or binaries contained within Appboy's Android SDK is permitted only to enable use of the Appboy platform by customers of Appb...

If you think the Android project appboy-android-sdk 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

//from   w ww. j ava  2 s .c  o m
import android.content.res.Resources;

public final class StringUtils {
  public static final String EMPTY_STRING = "";

  public static boolean isNullOrEmpty(String reference) {
    return reference == null || reference.length() == 0;

   * Checks if the string is null or only contains whitespace characters
  public static boolean isNullOrBlank(String reference) {
    return reference == null || reference.trim().length() == 0;

  public static String getOptionalStringResource(Resources resources, int stringResourceId, String defaultString) {
    try {
      return resources.getString(stringResourceId);
    } catch (Resources.NotFoundException e) {
      return defaultString;

Java Source Code List