|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.ugr.swad.swadroid.Global
public class Global
Global data of application.
Field Summary | |
---|---|
private static java.lang.String |
AB
Base string to generate random alphanumeric strings |
private static java.lang.String |
accountType
Account type |
static java.lang.String |
APP_TAG
Prefix tag name for Logcat |
private static java.lang.String |
authority
Synchronization authority |
private static java.lang.String |
BugsenseAPIKey
Bugsense application key |
static int |
COURSES_REQUEST_CODE
Request code for Courses module. |
private static int |
currentUserRole
Role of the logged User in the current selected course |
static java.lang.String |
DB_TABLE_COURSES
Table name for courses |
static java.lang.String |
DB_TABLE_GROUP_TYPES
Table name for group types |
static java.lang.String |
DB_TABLE_GROUPS
Table name for groups |
static java.lang.String |
DB_TABLE_GROUPS_COURSES
Table name for relationship between groups and courses |
static java.lang.String |
DB_TABLE_GROUPS_GROUPTYPES
Table name for relationship between groups and group types |
static java.lang.String |
DB_TABLE_NOTIFICATIONS
Table name for notifications |
static java.lang.String |
DB_TABLE_PRACTICE_SESSIONS
Table name for practice sessions |
static java.lang.String |
DB_TABLE_ROLLCALL
Table name for rollcall |
static java.lang.String |
DB_TABLE_TEST_ANSWERS
Table name for test's answers |
static java.lang.String |
DB_TABLE_TEST_CONFIG
Table name for test's configuration |
static java.lang.String |
DB_TABLE_TEST_QUESTION_ANSWERS
Table name for relationship between test's questions and answers |
static java.lang.String |
DB_TABLE_TEST_QUESTION_TAGS
Table name for relationship between test's questions and tags |
static java.lang.String |
DB_TABLE_TEST_QUESTIONS
Table name for test's questions |
static java.lang.String |
DB_TABLE_TEST_QUESTIONS_COURSE
Table name for relationship between test's questions and courses |
static java.lang.String |
DB_TABLE_TEST_TAGS
Table name for test's tags |
static java.lang.String |
DB_TABLE_USERS
Table name for users |
static java.lang.String |
DB_TABLE_USERS_COURSES
Table name for relationship between users and courses |
private static boolean |
dbCleaned
Indicates if there are changes on db |
private static java.lang.String |
DEFAULT_SERVER
Server URL |
private static long |
DEFAULT_SYNC_TIME
|
static int |
DIRECTORY_TREE_REQUEST_CODE
Request code for Directory Tree Download module |
static int |
DOCUMENTS_AREA_CODE
Code to access to the documents in documents area |
static int |
DOWNLOADSMANAGER_REQUEST_CODE
Request code for Downloads Manager |
static int |
GETFILE_REQUEST_CODE
Request code for GetFile Manager |
static int |
GROUPS_REQUEST_CODE
Request code for Directory Tree Download module |
static int |
GROUPTYPES_REQUEST_CODE
Request code for Group Types module |
private static long |
lastLoginTime
Time of application's last login |
private static boolean |
logged
User logged flag |
private static User |
loggedUser
Logged user |
static int |
LOGIN_REQUEST_CODE
Request code for Login module. |
static int |
MESSAGES_REQUEST_CODE
Request code for Tests module. |
static int |
MYGROUPSMANAGER_REQUEST_CODE
Request code for MyGroups Manager |
static int |
NOTICES_REQUEST_CODE
Request code for Notice module |
static int |
NOTIFICATIONS_REQUEST_CODE
Request code for Notifications module. |
static int |
NOTIFYDOWNLOAD_REQUEST_CODE
Request code for Notify Download |
static java.lang.String |
NULL_VALUE
Null value returned by webservices when a field is empty |
private static boolean |
preferencesChanged
Indicates if there are changes on preferences |
static int |
RELOGIN_TIME
Time to force relogin |
private static java.util.Random |
rnd
Random generator |
static int |
ROLLCALL_CONFIG_DOWNLOAD_REQUEST_CODE
Request code for Rollcall Config Download module. |
static int |
ROLLCALL_HISTORY_REQUEST_CODE
Request code for Rollcall History module. |
static int |
ROLLCALL_REQUEST_CODE
Request code for Rollcall module. |
static int |
SCAN_QR_REQUEST_CODE
Request code for Scan QR module. |
private static long |
selectedCourseCode
Code of the chosen course. |
private static java.lang.String |
selectedCourseFullName
Short name of the full course. |
private static java.lang.String |
selectedCourseShortName
Short name of the chosen course. |
static int |
SENDMYGROUPS_REQUEST_CODE
Request code for SendMyGroups |
static int |
SESSIONS_LIST_REQUEST_CODE
Request code for Sessions List module. |
static int |
SHARE_AREA_CODE
Code to access to the documents in share area |
static int |
STUDENT_TYPE_CODE
Student userRole for getUsers web service. |
static int |
STUDENTS_HISTORY_REQUEST_CODE
Request code for Students History module. |
static int |
STUDENTS_LIST_REQUEST_CODE
Request code for Students List module. |
private static java.lang.String |
SWADAppKey
SWAD application key |
static int |
TEACHER_TYPE_CODE
Teacher userTypeCode for getUsers web service. |
static int |
TESTS_CONFIG_DOWNLOAD_REQUEST_CODE
Request code for Tests module. |
static int |
TESTS_MAKE_REQUEST_CODE
Request code for Tests module. |
static int |
TESTS_QUESTIONS_DOWNLOAD_REQUEST_CODE
Request code for Tests module. |
static int |
TESTS_REQUEST_CODE
Request code for Tests module. |
Constructor Summary | |
---|---|
Global()
|
Method Summary | |
---|---|
static boolean |
connectionAvailable(Context ctx)
Checks if any connection is available |
static java.lang.String |
getAccountType()
Gets the account type for synchronization |
static java.lang.String |
getAuthority()
Gets the authority for synchronization |
static java.lang.String |
getBugsenseAPIKey()
Gets the Bugsense API key |
static int |
getCurrentUserRole()
Gets the role of the logged user in the current selected course |
static java.lang.String |
getDefaultServer()
Gets the server URL |
static long |
getDefaultSyncTime()
Gets the default synchronization interval |
static long |
getLastLoginTime()
Gets start time of application |
static User |
getLoggedUser()
Gets the user logged on SWAD |
static long |
getSelectedCourseCode()
Gets code of current course return -1 if no course chosen; code of current course in other case |
static java.lang.String |
getSelectedCourseFullName()
|
static java.lang.String |
getSelectedCourseShortName()
|
static java.lang.String |
getSWADAppKey()
Gets the SWAD application key |
static boolean |
isDbCleaned()
Indicates if the db was cleaned |
static boolean |
isLogged()
Checks if user is already logged on SWAD |
static boolean |
isPreferencesChanged()
|
static int |
parseBoolInt(boolean b)
Function to parse from Boolean to Integer |
static java.lang.String |
parseBoolString(boolean b)
Function to parse from Boolean to String |
static boolean |
parseIntBool(int n)
Function to parse from Integer to Boolean |
static boolean |
parseStringBool(java.lang.String s)
Function to parse from String to Boolean |
static java.lang.String |
randomString(int len)
Generates a random string of length len |
static void |
setCurrentUserRole(int userRole)
Sets user role in the current selected course |
static void |
setDbCleaned(boolean state)
Set the fact that the db was cleaned |
static void |
setLastLoginTime(long l)
Sets start time of application |
static void |
setLogged(boolean logged)
Sets user logged flag |
static void |
setLoggedUser(User loggedUser)
Sets the user logged on SWAD |
static void |
setPreferencesChanged()
Set the fact that the preferences has changed |
static void |
setPreferencesChanged(boolean newState)
Indicates if the preferences has changed |
static void |
setSelectedCourseCode(long currentCourseCode)
Sets code of current course |
static void |
setSelectedCourseFullName(java.lang.String currentCourseFullName)
|
static void |
setSelectedCourseShortName(java.lang.String currentCourseShortName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String SWADAppKey
private static final java.lang.String BugsenseAPIKey
private static final java.lang.String DEFAULT_SERVER
private static final java.lang.String accountType
private static final java.lang.String authority
private static final long DEFAULT_SYNC_TIME
private static boolean logged
private static User loggedUser
private static long lastLoginTime
private static long selectedCourseCode
private static java.lang.String selectedCourseShortName
private static java.lang.String selectedCourseFullName
private static int currentUserRole
private static boolean preferencesChanged
private static boolean dbCleaned
private static final java.lang.String AB
private static java.util.Random rnd
public static final java.lang.String NULL_VALUE
public static final int RELOGIN_TIME
public static final int LOGIN_REQUEST_CODE
public static final int COURSES_REQUEST_CODE
public static final int NOTIFICATIONS_REQUEST_CODE
public static final int TESTS_REQUEST_CODE
public static final int TESTS_CONFIG_DOWNLOAD_REQUEST_CODE
public static final int TESTS_QUESTIONS_DOWNLOAD_REQUEST_CODE
public static final int TESTS_MAKE_REQUEST_CODE
public static final int MESSAGES_REQUEST_CODE
public static final int NOTICES_REQUEST_CODE
public static final int ROLLCALL_REQUEST_CODE
public static final int SCAN_QR_REQUEST_CODE
public static final int DIRECTORY_TREE_REQUEST_CODE
public static final int GROUPS_REQUEST_CODE
public static final int ROLLCALL_CONFIG_DOWNLOAD_REQUEST_CODE
public static final int ROLLCALL_HISTORY_REQUEST_CODE
public static final int STUDENTS_LIST_REQUEST_CODE
public static final int STUDENTS_HISTORY_REQUEST_CODE
public static final int SESSIONS_LIST_REQUEST_CODE
public static final int DOWNLOADSMANAGER_REQUEST_CODE
public static final int NOTIFYDOWNLOAD_REQUEST_CODE
public static final int MYGROUPSMANAGER_REQUEST_CODE
public static final int GROUPTYPES_REQUEST_CODE
public static final int SENDMYGROUPS_REQUEST_CODE
public static final int GETFILE_REQUEST_CODE
public static final java.lang.String APP_TAG
public static final java.lang.String DB_TABLE_COURSES
public static final java.lang.String DB_TABLE_NOTIFICATIONS
public static final java.lang.String DB_TABLE_TEST_ANSWERS
public static final java.lang.String DB_TABLE_TEST_QUESTIONS
public static final java.lang.String DB_TABLE_TEST_TAGS
public static final java.lang.String DB_TABLE_TEST_CONFIG
public static final java.lang.String DB_TABLE_TEST_QUESTION_TAGS
public static final java.lang.String DB_TABLE_TEST_QUESTIONS_COURSE
public static final java.lang.String DB_TABLE_TEST_QUESTION_ANSWERS
public static final java.lang.String DB_TABLE_USERS
public static final java.lang.String DB_TABLE_USERS_COURSES
public static final java.lang.String DB_TABLE_GROUPS
public static final java.lang.String DB_TABLE_GROUPS_COURSES
public static final java.lang.String DB_TABLE_GROUP_TYPES
public static final java.lang.String DB_TABLE_GROUPS_GROUPTYPES
public static final java.lang.String DB_TABLE_PRACTICE_SESSIONS
public static final java.lang.String DB_TABLE_ROLLCALL
public static final int STUDENT_TYPE_CODE
public static final int TEACHER_TYPE_CODE
public static int DOCUMENTS_AREA_CODE
public static int SHARE_AREA_CODE
Constructor Detail |
---|
public Global()
Method Detail |
---|
public static java.lang.String getSWADAppKey()
public static java.lang.String getBugsenseAPIKey()
public static java.lang.String getDefaultServer()
public static boolean isLogged()
public static void setLogged(boolean logged)
logged
- User logged flag
public static User getLoggedUser()
logged
- User logged flag
public static void setLoggedUser(User loggedUser)
logged
- User logged flag
public static long getLastLoginTime()
public static void setLastLoginTime(long l)
l
- Start time of application
public static boolean parseIntBool(int n)
n
- Integer to be parsed
public static boolean parseStringBool(java.lang.String s)
s
- String to be parsed
public static int parseBoolInt(boolean b)
b
- Boolean to be parsed
public static java.lang.String parseBoolString(boolean b)
b
- Boolean to be parsed
public static long getSelectedCourseCode()
public static void setSelectedCourseCode(long currentCourseCode)
courseCode.
- Code of the chosen course. It should be courseCode>0. Otherwise nothing will
change
public static void setCurrentUserRole(int userRole)
userRole:
- Role of the user: 0- unknown STUDENT_TYPE_CODE - student TEACHER_TYPE_CODE -
teacher
public static boolean isPreferencesChanged()
public static void setPreferencesChanged()
newState
- - true when the preferences has changed
- false after the fact is noticed and handled it
public static void setPreferencesChanged(boolean newState)
newState
- - true when the preferences has changed and it was not handled it
- false if the preferences has not changed
public static void setSelectedCourseShortName(java.lang.String currentCourseShortName)
public static void setSelectedCourseFullName(java.lang.String currentCourseFullName)
public static java.lang.String getSelectedCourseShortName()
public static java.lang.String getSelectedCourseFullName()
public static int getCurrentUserRole()
public static java.lang.String getAccountType()
public static java.lang.String getAuthority()
public static long getDefaultSyncTime()
public static boolean connectionAvailable(Context ctx)
ctx
- Application context
public static void setDbCleaned(boolean state)
newState
- - true when the database was cleaned
- false after the fact is noticed and handled it
public static boolean isDbCleaned()
newState
- - true when the database was cleaned and it was not handled it
- false if the database does not change
public static java.lang.String randomString(int len)
len
- Length of random string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |