SWADroid/SWADroid/src/main/java/es/ugr/swad/swadroid/Constants.java
Javier Bueno López ab0898c571 Indoor Location new module (#287)
* Adding icons and text for manage location

* Adding manage location to main menu

* Adding class to manage location

* Adding view layout to manage location

* Share location switch created

* Basic listener added to switch

* Moving manage location to users menu

* Adding icons and text for manage location

* Adding manage location to main menu

* Adding class to manage location

* Adding view layout to manage location

* Share location switch created

* Basic listener added to switch

* Moving manage location to users menu

* Adding elements to indoor_location view

* Improving indoor_location with default text

* Logic to calculate distance

* Trying to connect to the API.

* Adding model to location distance

* Changing textview to listview

* Making request to MacStore API to get location of Mac

* Search user menu

* New designs manage location activity

* Connecting to swad api

* Connection to swad api working

* Location history showing up in activity

* Adding button and user code to find user

* Sorting locations and saving only one

* Implementing GetLastLocation API method

* Adding location preferences translations

* Adding translations to location menu toast

* Return without error from searching user

* Removing warning

* Adding translations

* Changing permissions

* Changing module name

* Making location serializable

* Changing deprecated implementation

* Cleaning code and refactoring deprecated classes

* Changing location name in menu

* Scanning all wifi networks

* Hiding white activities

* Showing more information in each location

* Fixing bug when searching user

* Fixing available networks sort

* Using roomCode instead of institutionCode

* Changes scheduling tasks

* Deleting dependencies

* Deleting useless import

* Getting correct mac

* Requesting permissions to user

* LocationTimeStamp inherits from Location

* Using new variable to soap object

* Setting const defaultValue

* Extracting common lines on update location click

* Extracting common lines on activity result

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Using functions to reduce code

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/GetLastLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/model/UserFilter.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/GetLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/GetLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/GetLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/IndoorLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Constant moved to class level

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/SendCurrentLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/SendCurrentLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/indoorlocation/SendCurrentLocation.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/modules/messages/SearchUsers.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values-es/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/values/strings.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Adding dependency to preferences

* Changing indoor location title text

* Showing text when no location is found

* Allow always location option

* Adding new button to show mac

* Find mac button added and working

* Stopping scheduler when user can't be located

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/model/LocationTimeStamp.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/model/LocationTimeStamp.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/java/es/ugr/swad/swadroid/model/LocationTimeStamp.java

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update SWADroid/src/main/res/xml/preferences.xml

Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>

* Update material version to 1.2.1

* Updating plugin

* Fixing API permissions

* Update gradle/wrapper/gradle-wrapper.properties

* Minor code style improvements

* Fix IndexOutOfBoundsException

* Add default locale to SimpleDateFormat

* Use complete Gradle distribution

* Update authors

* Update CHANGELOG

* Remove unused import

* Minor code style improvements

Co-authored-by: javibl8@correo.ugr.es <javier.bueno@jitkey.com>
Co-authored-by: Juan Miguel Boyero Corral <juanmi1982@gmail.com>
2020-10-14 19:50:20 +02:00

362 lines
10 KiB
Java

/*
* This file is part of SWADroid.
*
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*
* SWADroid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SWADroid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
*/
package es.ugr.swad.swadroid;
import android.os.Environment;
import java.io.File;
/**
* Constants of application.
*
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
* @author Antonio Aguilera Malagon <aguilerin@gmail.com>
* @author Helena Rodriguez Gijon <hrgijon@gmail.com>
* @author Jose Antonio Guerrero Aviles <cany20@gmail.com>
*/
public class Constants {
/**
* URL of SWAD UGR Server
*/
public static final String SWAD_UGR_SERVER = "swad.ugr.es";
/**
* URL of OpenSWAD Server
*/
public static final String OPENSWAD_SERVER = "openswad.org";
/**
* Server URL
*/
public static final String DEFAULT_SERVER = SWAD_UGR_SERVER;
/**
* Account type
*/
public static final String ACCOUNT_TYPE = "es.ugr.swad.swadroid";
/**
* Synchronization authority
*/
public static final String AUTHORITY = "es.ugr.swad.swadroid.content";
/**
* Default synchronization time for notifications (in minutes)
*/
public static final long DEFAULT_SYNC_TIME = 60;
/**
* Connection timeout (in milliseconds)
*/
public static final int CONNECTION_TIMEOUT = 60000;
/**
* Threshold for clean old notifications (in seconds)
*/
public static final int CLEAN_NOTIFICATIONS_THRESHOLD = 2592000; // 30 days
/**
* Null value returned by webservices when a field is empty
*/
public static final String NULL_VALUE = "anyType{}";
/**
* Request code for Login module.
*/
public static final int LOGIN_REQUEST_CODE = 1;
/**
* Request code for Courses module.
*/
public static final int COURSES_REQUEST_CODE = 2;
/**
* Request code for Notifications module.
*/
public static final int NOTIFICATIONS_REQUEST_CODE = 3;
/**
* Request code for Tests module.
*/
public static final int TESTS_REQUEST_CODE = 4;
/**
* Request code for Tests module.
*/
public static final int TESTS_CONFIG_DOWNLOAD_REQUEST_CODE = 5;
/**
* Request code for Tests module.
*/
public static final int TESTS_QUESTIONS_DOWNLOAD_REQUEST_CODE = 6;
/**
* Request code for Tests module.
*/
public static final int TESTS_MAKE_REQUEST_CODE = 7;
/**
* Request code for Tests module.
*/
public static final int MESSAGES_REQUEST_CODE = 8;
/**
* Request code for Notice module
*/
public static final int NOTICES_REQUEST_CODE = 9;
/**
* Request code for Rollcall module.
*/
public static final int ROLLCALL_REQUEST_CODE = 10;
/**
* Request code for Scan QR module.
*/
public static final int SCAN_QR_REQUEST_CODE = 12;
/**
* Request code for Directory Tree Download module
*/
public static final int DIRECTORY_TREE_REQUEST_CODE = 13;
/**
* Request code for Directory Tree Download module
*/
public static final int GROUPS_REQUEST_CODE = 14;
/**
* Request code for Rollcall EventsDownload Download module.
*/
public static final int ROLLCALL_EVENTS_DOWNLOAD_REQUEST_CODE = 15;
/**
* Request code for Rollcall EventsSend Download module.
*/
public static final int ROLLCALL_EVENTS_SEND_REQUEST_CODE = 16;
/**
* Request code for Rollcall UsersDownload module.
*/
public static final int ROLLCALL_USERS_DOWNLOAD_REQUEST_CODE = 17;
/**
* Request code for Rollcall UsersSend module.
*/
public static final int ROLLCALL_USERS_SEND_REQUEST_CODE = 18;
/**
* Request code for Downloads Manager
*/
public static final int DOWNLOADSMANAGER_REQUEST_CODE = 19;
/**
* Request code for Notify Download
*/
public static final int NOTIFYDOWNLOAD_REQUEST_CODE = 20;
/**
* Request code for MyGroups Manager
*/
public static final int MYGROUPSMANAGER_REQUEST_CODE = 21;
/**
* Request code for Group Types module
*/
public static final int GROUPTYPES_REQUEST_CODE = 22;
/**
* Request code for SendMyGroups
*/
public static final int SENDMYGROUPS_REQUEST_CODE = 23;
/**
* Request code for GetFile Manager
*/
public static final int GETFILE_REQUEST_CODE = 24;
/**
* Request code for Generate QR
*/
public static final int GENERATE_QR_REQUEST_CODE = 25;
/**
* Request code for Information
*/
public static final int INFORMATION_REQUEST_CODE = 26;
/**
* Request code for Introduction
*/
public static final int INTRODUCTION_REQUEST_CODE = 27;
/**
* Request code for FAQs
*/
public static final int FAQS_REQUEST_CODE = 28;
/**
* Request code for Bibliography
*/
public static final int BIBLIOGRAPHY_REQUEST_CODE = 29;
/**
* Request code for Practices Program
*/
public static final int SYLLABUSPRACTICALS_REQUEST_CODE = 30;
/**
* Request code for Theory Program
*/
public static final int SYLLABUSLECTURES_REQUEST_CODE = 31;
/**
* Request code for Links
*/
public static final int LINKS_REQUEST_CODE = 32;
/**
* Request code for Teaching Guide
*/
public static final int TEACHINGGUIDE_REQUEST_CODE = 33;
/**
* Request code for NotificationMarkAsRead module
*/
public static final int NOTIFMARKALLASREAD_REQUEST_CODE = 34;
/**
* Request code for Assessment
*/
public static final int ASSESSMENT_REQUEST_CODE = 35;
/**
* Request code for recover Password
*/
public static final int RECOVER_PASSWORD_REQUEST_CODE = 36;
/**
* Request code for get marks
*/
public static final int GETMARKS_REQUEST_CODE = 37;
/**
* Request code for show marks
*/
public static final int MARKS_REQUEST_CODE = 38;
/**
* Request code for create a new account
*/
public static final int CREATE_ACCOUNT_REQUEST_CODE = 39;
/**
* Request code for search users
*/
public static final int SEARCH_USERS_REQUEST_CODE = 40;
/**
* Request code for Manage Location
*/
public static final int MANAGE_LOCATION = 41;
/**
* Request code for Find User
*/
public static final int FIND_USER = 42;
/**
* Request code for Get Location
*/
public static final int GET_LOCATION = 43;
/**
* Request code for Get Last Location
*/
public static final int GET_LAST_LOCATION = 44;
/**
* Request code for Send Current Location
*/
public static final int SEND_CURRENT_LOCATION = 45;
/**
* Request code for Get Available Roles
*/
public static final int GET_AVAILABLE_ROLES = 46;
/**
* Request code for CAMERA permission
*/
public static final int PERMISSIONS_REQUEST_CAMERA = 100;
/**
* Request code for WRITE_EXTERNAL_STORAGE permission
*/
public static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 101;
/**
* Request code for PERMISSION_MULTIPLE permissions
*/
public static final int PERMISSION_MULTIPLE = 102;
/**
* Prefix tag name for Logcat
*/
public static final String APP_TAG = "SWADroid";
/**
* Student userRole for getUsers web service.
*/
public static final int STUDENT_TYPE_CODE = 2;
/**
* Teacher userTypeCode for getUsers web service.
*/
public static final int TEACHER_TYPE_CODE = 3;
/**
* Code to access to the documents in documents area
*/
public static final int DOCUMENTS_AREA_CODE = 1;
/**
* Code to access to the documents in share area
*/
public static final int SHARE_AREA_CODE = 2;
/**
* Code to access to the marks area
*/
public static final int MARKS_AREA_CODE = 3;
/**
* Group position inside the main menu for Course group
*/
public static final int COURSE_GROUP = 0;
/**
* Group position inside the main menu for Evaluation group
*/
public static final int EVALUATION_GROUP = 1;
/**
* Group position inside the main menu for User group
*/
public static final int USERS_GROUP = 2;
/**
* Group position inside the main menu for Messages group
*/
public static final int MESSAGES_GROUP = 3;
/**
* Group position inside the main menu for Enrollment group
*/
public static final int ENROLLMENT_GROUP = 4;
/**
* Child position inside the messages menu for Notification
*/
public static final int NOTIFICATION_CHILD = 0;
/**
* Child position inside the messages menu for Send message
*/
public static final int SEND_MESSAGES_CHILD = 1;
/**
* Child position inside the messages menu for Publish Note
*/
public static final int PUBLISH_NOTE_CHILD = 2;
/**
* Child position inside the evaluation menu for Tests
*/
public static final int TESTS_CHILD = 0;
/**
* Child position inside the course menu for Documents
*/
public static final int DOCUMENTS_CHILD = 0;
/**
* Child position inside the course menu for Shared area
*/
public static final int SHARED_AREA_CHILD = 1;
/**
* Child position inside the users menu for Groups
*/
public static final int MYGROUPS_CHILD = 0;
/**
* Child position inside the users menu for Generate QR
*/
public static final int GENERATE_QR_CHILD = 1;
/**
* Child position inside the users menu for Rollcall
*/
public static final int ROLLCALL_CHILD = 2;
/**
* Path for downloaded files
*/
public static final String DIRECTORY_SWADROID = "SWADroid";
public static final String DOWNLOADS_PATH =
Environment.DIRECTORY_DOWNLOADS + File.separator + DIRECTORY_SWADROID;
/**
* Username template for messages
*/
public static final String USERNAME_TEMPLATE = "{userName}";
}