Back to project page filmster.
The source code is released under:
Apache License
If you think the Android project filmster listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.doodeec.filmster; /*from ww w .j a v a 2 s . co m*/ import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import com.doodeec.filmster.ApplicationState.AppState; /** * Created by Dusan Doodeec Bartos on 26.10.2014. * * Helper for resource handling */ public class Helper { public static final String EMPTY_STRING = ""; /** * @param stringId string resource id * @return string */ public static String getString(int stringId) { return AppState.getContext().getResources().getString(stringId); } /** * @param colorId color resource id * @return color */ public static int getColor(int colorId) { return AppState.getContext().getResources().getColor(colorId); } /** * Determines if device is connected to network * * @return true if connected */ public static boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) AppState.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); return (netInfo != null && netInfo.isConnectedOrConnecting()); } }