Skip to content

Instantly share code, notes, and snippets.

@AswinpAshok
Created October 23, 2017 05:55
Show Gist options
  • Save AswinpAshok/6f9ef038a63849f31c0a378a1c7da185 to your computer and use it in GitHub Desktop.
Save AswinpAshok/6f9ef038a63849f31c0a378a1c7da185 to your computer and use it in GitHub Desktop.
School Management Java Application class
package com.sandftechnologies.schoolmanagementStaff.ModelClasses;
import android.app.Application;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.widget.ArrayAdapter;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.sandftechnologies.schoolmanagementStaff.Activities.ViewStudent;
import com.sandftechnologies.schoolmanagementStaff.DataCache;
import com.sandftechnologies.schoolmanagementStaff.HelperClass.DBHelper;
import com.sandftechnologies.schoolmanagementStaff.Internet.GlobalVariables;
import java.util.Map;
/**
* Created by PC4 on 5/6/2017.
*/
public class Global extends Application implements GlobalVariables {
//ClassId,RegDate---, flag=0-->details[Name,id,Roll,attendance[0,1,a,p]]
//flag=1-->+Atd_Id
public static ArrayAdapter<String> CategoryAdapter;
public static int SelectedCategoryPosition;
public static boolean isStudentLoaded=false;
public static StudentCompleteModel student;
public static Map<String,Integer> CategoryMap;
private static Typeface typeface;
private static Typeface typefaceBold;
private static DataCache mDatacache;
private static String userID,firmID;
public static String getUserID(){
return userID;
}
public static String getFirmID(){
return firmID;
}
public static StudentCompleteModel getStudent() {
return student;
}
public static void setStudent(StudentCompleteModel student) {
Global.student = student;
}
public static Typeface getTypeface(){
return typeface;
}
public static Typeface getTypefaceBold(){
return typefaceBold;
}
@Override
public void onCreate() {
super.onCreate();
Fresco.initialize(this);
student=new StudentCompleteModel();
typeface = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf");
typefaceBold=Typeface.createFromAsset(getAssets(), "fonts/Roboto-Regular.ttf");
DBHelper dbHelper= DBHelper.getInstance(this);
mDatacache=DataCache.getInstance();
SharedPreferences shared = getSharedPreferences(Shared_Pref_Name, MODE_PRIVATE);
userID=shared.getString("userID","");
firmID=shared.getString("firmID","");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment