Advertisement
bmote

AppConstants

Dec 19th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. public class AppConstants {
  2.    
  3.     public static final boolean DEBUG = false;
  4.     public static final String MY_AD_UNIT_ID = "01234b67890123c4"; //com.aydabtudev.broadcastsms
  5.     private static String APPLICATION_VERSION_NAME = "unknown";
  6.     private static int DAY_OF_YEAR = -1;
  7.    
  8.     private AppConstants() {
  9.         // This should not be instantiated.
  10.     }
  11.    
  12.     public static String getAppVerName(Context context) {
  13.         try {
  14.             APPLICATION_VERSION_NAME = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
  15.         } catch (NameNotFoundException e) {
  16.             e.printStackTrace();
  17.         }
  18.         return APPLICATION_VERSION_NAME;
  19.     }
  20.  
  21.     public static int getToday() {
  22.         // Return the Julian date as an integer
  23.         Calendar c = Calendar.getInstance();
  24.         DAY_OF_YEAR = (int) c.get(Calendar.DAY_OF_YEAR);
  25.         return DAY_OF_YEAR;
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement