├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── font
│ │ │ │ ├── psb.ttf
│ │ │ │ └── psbi.ttf
│ │ │ ├── drawable
│ │ │ │ ├── lg.jpg
│ │ │ │ ├── qrs.png
│ │ │ │ ├── qrs.png~
│ │ │ │ ├── wall.jpg
│ │ │ │ ├── rocket_logo.png
│ │ │ │ ├── start_logo.png
│ │ │ │ ├── ic_keyboard_arrow_right_blue_24dp.xml
│ │ │ │ ├── ic_keyboard_arrow_right_black_24dp.xml
│ │ │ │ ├── ic_person_white_24dp.xml
│ │ │ │ ├── ic_vpn_key_blue_24dp.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── styles.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── strings.xml
│ │ │ ├── menu
│ │ │ │ └── menu.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_scan__start.xml
│ │ │ │ ├── activity_qrscanner.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── activity_register_info.xml
│ │ │ │ ├── activity_personal_info.xml
│ │ │ │ ├── activity_sign_in.xml
│ │ │ │ └── activity_student_info.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── ic_launcher-web.png
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── app
│ │ │ │ └── attender
│ │ │ │ ├── Constants.java
│ │ │ │ ├── RequestHandler.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── SharedPrefManager.java
│ │ │ │ ├── QRScanner.java
│ │ │ │ ├── PersonalInfo.java
│ │ │ │ ├── SignIn.java
│ │ │ │ ├── StudentInfo.java
│ │ │ │ ├── RegisterInfo.java
│ │ │ │ └── Scan_Start.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── app
│ │ │ └── attender
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── app
│ │ └── attender
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── .gitattributes
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── caches
│ └── build_file_checksums.ser
├── runConfigurations.xml
├── gradle.xml
├── codeStyles
│ └── Project.xml
└── misc.xml
├── .gitignore
├── README.md
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/app/src/main/res/font/psb.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/font/psb.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/psbi.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/font/psbi.ttf
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/lg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/lg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/qrs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/qrs.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/qrs.png~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/qrs.png~
--------------------------------------------------------------------------------
/app/src/main/res/drawable/wall.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/wall.jpg
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rocket_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/rocket_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/start_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/drawable/start_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishsalunkhe/AttendeR/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F9FDFF
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 27 18:10:23 IST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard_arrow_right_blue_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard_arrow_right_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_person_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/Constants.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | public class Constants {
4 | private static final String ROOT_URL = "http://www.pccoerelearning.com/student/attender/v1/";
5 | public static final String URL_REGISTER = ROOT_URL+"registerUser.php";
6 | public static final String URL_LOGIN = ROOT_URL+"userLogin.php";
7 | public static final String URL_AT = ROOT_URL+"scanned.php";
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_vpn_key_blue_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/app/attender/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AttendeR
2 | **Android Application for QR-based attendance**
3 | In this system, the attendance record and maintenance work is done on digital
4 | platform. Initially, the students have to login through the AttendeR app to access the service
5 | from their smartphones. After the lecture, the teacher have to generate a dynamic QR code
6 | with the help of online web based service using their authorized login credentials and has to
7 | project it on screen. Then the students will scan the generated QR code using the camera
8 | through the AttendeR app and their attendance for that particular lecture will be updated into
9 | the database. So there is no need of maintaining or preserving any physical record for
10 | attendance.
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #1769aa
4 | #16629f
5 | #2196f3
6 | #1565c0
7 | #0d47a1
8 | #2196f3
9 | #ffffff
10 | #000000
11 | #c94f4f
12 | #943e3e
13 | #03a9f4
14 |
15 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/app/attender/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.app.attender", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_scan__start.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
23 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 27
5 | defaultConfig {
6 | applicationId "com.example.app.attender"
7 | minSdkVersion 19
8 | targetSdkVersion 27
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'com.android.support:appcompat-v7:27.1.1'
24 | implementation 'com.android.support.constraint:constraint-layout:1.1.2'
25 | testImplementation 'junit:junit:4.12'
26 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
28 | implementation 'com.budiyev.android:code-scanner:1.9.4'
29 | implementation 'com.android.volley:volley:1.1.1'
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/RequestHandler.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Context;
4 |
5 | import com.android.volley.Request;
6 | import com.android.volley.RequestQueue;
7 | import com.android.volley.toolbox.Volley;
8 |
9 | public class RequestHandler {
10 | private static RequestHandler mInstance;
11 | private RequestQueue mRequestQueue;
12 | private static Context mCtx;
13 |
14 | private RequestHandler(Context context) {
15 | mCtx = context;
16 | mRequestQueue = getRequestQueue();
17 | }
18 |
19 | public static synchronized RequestHandler getInstance(Context context) {
20 | if (mInstance == null) {
21 | mInstance = new RequestHandler (context);
22 | }
23 | return mInstance;
24 | }
25 |
26 | public RequestQueue getRequestQueue() {
27 | if (mRequestQueue == null) {
28 | // getApplicationContext() is key, it keeps you from leaking the
29 | // Activity or BroadcastReceiver if someone passes one in.
30 | mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
31 | }
32 | return mRequestQueue;
33 | }
34 |
35 | public void addToRequestQueue(Request req) {
36 | getRequestQueue().add(req);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
28 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.Manifest;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.os.Bundle;
7 | import android.support.v4.app.ActivityCompat;
8 | import android.support.v4.content.ContextCompat;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.view.View;
11 | import android.widget.Button;
12 | import android.widget.Toast;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_main);
20 |
21 | if(SharedPrefManager.getInstance(this).isLoggedIn()){
22 | finish();
23 | Intent i = new Intent(MainActivity.this, QRScanner.class);
24 | startActivity(i);
25 | return;
26 | }
27 |
28 | Button sign_in = findViewById(R.id.SignInButton);
29 | Button register = findViewById(R.id.RegisterButton);
30 |
31 | sign_in.setOnClickListener(new View.OnClickListener() {
32 | @Override
33 | public void onClick(View v) {
34 | Intent i = new Intent(MainActivity.this, SignIn.class);
35 | startActivity(i);
36 | }
37 | });
38 |
39 | register.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | Intent i = new Intent(MainActivity.this, StudentInfo.class);
43 | startActivity(i);
44 | }
45 | });
46 |
47 | }
48 |
49 |
50 |
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/SharedPrefManager.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | import com.android.volley.Request;
7 | import com.android.volley.RequestQueue;
8 | import com.android.volley.toolbox.Volley;
9 |
10 | public class SharedPrefManager {
11 | private static SharedPrefManager mInstance;
12 | private static Context mCtx;
13 |
14 | private static final String SHARED_PREF_NAME = "mysharedpref12";
15 | private static final String KEY_USERNAME = "username";
16 | private static final String KEY_USER_EMAIL = "useremail";
17 |
18 |
19 |
20 | private SharedPrefManager(Context context) {
21 | mCtx = context;
22 | }
23 |
24 | public static synchronized SharedPrefManager getInstance(Context context) {
25 | if (mInstance == null) {
26 | mInstance = new SharedPrefManager(context);
27 | }
28 | return mInstance;
29 | }
30 |
31 | public boolean userLogin(String username, String email){
32 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
33 | SharedPreferences.Editor editor = sharedPreferences.edit();
34 |
35 | editor.putString(KEY_USER_EMAIL, email);
36 | editor.putString(KEY_USERNAME, username);
37 | editor.apply();
38 | return true;
39 | }
40 |
41 | public boolean isLoggedIn(){
42 | SharedPreferences sharedPreferences =mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
43 | if(sharedPreferences.getString(KEY_USERNAME,null) != null){
44 | return true;
45 | }
46 | return false;
47 | }
48 |
49 | public boolean logout(){
50 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
51 | SharedPreferences.Editor editor = sharedPreferences.edit();
52 | editor.clear();
53 | editor.apply();
54 | return true;
55 | }
56 |
57 | public String getName(){
58 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
59 | return sharedPreferences.getString(KEY_USERNAME,null);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/QRScanner.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.Manifest;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.os.Bundle;
7 | import android.support.v4.app.ActivityCompat;
8 | import android.support.v4.content.ContextCompat;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.view.Menu;
11 | import android.view.MenuItem;
12 | import android.view.View;
13 | import android.widget.Button;
14 | import android.widget.TextView;
15 | import android.widget.Toast;
16 |
17 | import org.json.JSONException;
18 | import org.json.JSONObject;
19 |
20 |
21 | public class QRScanner extends AppCompatActivity {
22 |
23 | @Override
24 | public boolean onCreateOptionsMenu(Menu menu) {
25 | getMenuInflater().inflate(R.menu.menu, menu);
26 | return true;
27 | }
28 |
29 | @Override
30 | public boolean onOptionsItemSelected(MenuItem item) {
31 | switch (item.getItemId()){
32 | case R.id.menuLogout:
33 | SharedPrefManager.getInstance(this).logout();
34 | finish();
35 | startActivity(new Intent(this, MainActivity.class));
36 | break;
37 | }
38 | return true;
39 | }
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_qrscanner);
45 |
46 | Button scan = findViewById(R.id.ScanButton);
47 |
48 | if(!SharedPrefManager.getInstance(this).isLoggedIn()){
49 | finish();
50 | Intent i =new Intent(QRScanner.this, SignIn.class);
51 | startActivity(i);
52 | }
53 |
54 | if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
55 | == PackageManager.PERMISSION_DENIED)
56 | {
57 | ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.CAMERA}, 1889);
58 | }
59 |
60 | TextView textViewName = findViewById(R.id.User);
61 | textViewName.setText(SharedPrefManager.getInstance(this).getName());
62 |
63 |
64 | scan.setOnClickListener(new View.OnClickListener() {
65 | @Override
66 | public void onClick(View v) {
67 | Intent i = new Intent(QRScanner.this, Scan_Start.class);
68 | startActivity(i);
69 | }
70 | });
71 |
72 |
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AttendeR
3 | SignIn
4 | Sign In
5 | Register
6 | Student ID
7 | Password
8 | Welcome To AttendeR
9 | Welcome Back
10 | Sign In To Explore More
11 | Student Information
12 | Personal Information
13 | Registration Information
14 | Roll No
15 | Example : 57
16 | Branch
17 | Year
18 | Division
19 | Next
20 | First Name
21 | Last Name
22 | Email
23 | App Logo
24 | Scan QR Code
25 | Scan QR Logo
26 | The Developers Forgot to Fill this Empty Space
27 | Hello !
28 | Hi !
29 | Logout
30 | Step 1
31 | Step 2
32 | Step 3
33 | User
34 | Student ID Example : T31509
35 |
36 |
37 | - FE
38 | - SE
39 | - TE
40 | - BE
41 |
42 |
43 | - FirstYear
44 | - CivilEngineering
45 | - ComputerEngineering
46 | - Electronics&TelecommunicationEngineering
47 | - MechanicalEngineering
48 |
49 |
50 | - A
51 | - B
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/PersonalInfo.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import android.widget.Toast;
10 |
11 | public class PersonalInfo extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_personal_info);
17 |
18 | Intent g = getIntent();
19 | final String Roll = g.getStringExtra("Roll");
20 | final String Branch = g.getStringExtra("Branch");
21 | final String Year = g.getStringExtra("Year");
22 | final String Division = g.getStringExtra("Division");
23 |
24 | final String[] First_name = new String[1];
25 | final String[] Last_name = new String[1];
26 | final String[] Email_Id = new String[1];
27 |
28 | Button Register = findViewById(R.id.Registration_Button);
29 |
30 | final EditText F_name = findViewById(R.id.FirstName);
31 | final EditText L_name = findViewById(R.id.LastName);
32 | final EditText E_id = findViewById(R.id.EmailText);
33 |
34 | Register.setOnClickListener(new View.OnClickListener() {
35 | @Override
36 | public void onClick(View v) {
37 |
38 | First_name[0] = F_name.getText().toString();
39 | Last_name[0] = L_name.getText().toString();
40 | Email_Id[0] = E_id.getText().toString();
41 |
42 | if(First_name[0].equals("") || Last_name[0].equals("") || Email_Id[0].equals("")) {
43 | Toast.makeText(getApplicationContext(),"Fill All Fields First", Toast.LENGTH_SHORT).show();
44 | }
45 | else {
46 | Intent i = new Intent(PersonalInfo.this,RegisterInfo.class);
47 | i.putExtra("Roll",Roll);
48 | i.putExtra("Branch",Branch);
49 | i.putExtra("Year", Year);
50 | i.putExtra("Division", Division);
51 | i.putExtra("First_Name", First_name[0]);
52 | i.putExtra("Last_Name", Last_name[0]);
53 | i.putExtra("Email_ID", Email_Id[0]);
54 | startActivity(i);
55 | }
56 |
57 | }
58 | });
59 |
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_qrscanner.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
27 |
28 |
36 |
48 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
25 |
26 |
35 |
36 |
46 |
47 |
58 |
59 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_register_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
26 |
27 |
38 |
39 |
51 |
52 |
64 |
65 |
78 |
79 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_personal_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
27 |
28 |
40 |
41 |
54 |
55 |
68 |
69 |
81 |
82 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/SignIn.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import android.widget.Toast;
10 |
11 | import com.android.volley.AuthFailureError;
12 | import com.android.volley.Request;
13 | import com.android.volley.Response;
14 | import com.android.volley.VolleyError;
15 | import com.android.volley.toolbox.StringRequest;
16 |
17 | import org.json.JSONException;
18 | import org.json.JSONObject;
19 |
20 | import java.util.HashMap;
21 | import java.util.Map;
22 |
23 | public class SignIn extends AppCompatActivity {
24 | private EditText editTextUsername, editTextPassword;
25 | private Button Sign;
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_sign_in);
30 |
31 | if(SharedPrefManager.getInstance(this).isLoggedIn()){
32 | finish();
33 | Intent i = new Intent(SignIn.this,QRScanner.class);
34 | startActivity(i);
35 | finish();
36 | return;
37 |
38 | }
39 |
40 | editTextUsername = findViewById(R.id.Username);
41 | editTextPassword = findViewById(R.id.Password);
42 | Sign = findViewById(R.id.SignIn_Button);
43 |
44 | Sign.setOnClickListener(new View.OnClickListener() {
45 | @Override
46 | public void onClick(View v) {
47 | userLogin();
48 | }
49 | });
50 | }
51 |
52 | private void userLogin(){
53 | final String username = editTextUsername.getText().toString().trim();
54 | final String password = editTextPassword.getText().toString().trim();
55 |
56 | StringRequest stringRequest = new StringRequest(
57 | Request.Method.POST,
58 | Constants.URL_LOGIN,
59 | new Response.Listener() {
60 | @Override
61 | public void onResponse(String response) {
62 |
63 | try {
64 | JSONObject obj = new JSONObject(response);
65 | if(!obj.getBoolean("error")){
66 | SharedPrefManager.getInstance(getApplicationContext()).userLogin(
67 | obj.getString("Student_ID"),
68 | obj.getString("Email")
69 | );
70 | Intent i = new Intent(getApplicationContext(), QRScanner.class);
71 | startActivity(i);
72 | finish();
73 | }else{
74 | Toast.makeText(getApplicationContext(),obj.getString("message"), Toast.LENGTH_LONG).show();
75 | }
76 | } catch (JSONException e) {
77 | e.printStackTrace();
78 | }
79 |
80 | }
81 | },
82 | new Response.ErrorListener() {
83 | @Override
84 | public void onErrorResponse(VolleyError error) {
85 | Toast.makeText(getApplicationContext(),error.getMessage(),Toast.LENGTH_LONG).show();
86 | }
87 | }
88 | ){
89 | @Override
90 | protected Map getParams() throws AuthFailureError {
91 | Map params = new HashMap<>();
92 | params.put("username", username);
93 | params.put("password", password);
94 | return params;
95 | }
96 | };
97 |
98 | RequestHandler.getInstance(this).addToRequestQueue(stringRequest);
99 | }
100 |
101 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sign_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
28 |
40 |
41 |
61 |
62 |
83 |
84 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/StudentInfo.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.AdapterView;
8 | import android.widget.ArrayAdapter;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 | import android.widget.Spinner;
12 | import android.widget.Toast;
13 |
14 | public class StudentInfo extends AppCompatActivity {
15 |
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_student_info);
20 | final String[] Roll = new String[1];
21 | final String[] year = new String[1];
22 | final String[] branch = new String[1];
23 | final String[] division = new String[1];
24 | final int[] entry = {0,0,0};
25 |
26 | final EditText roll_no = findViewById(R.id.RollNoEdit);
27 |
28 | final Spinner year_Spinner = findViewById(R.id.YearSpinner);
29 | ArrayAdapter year_adapter = ArrayAdapter.createFromResource(this,R.array.year,android.R.layout.simple_spinner_item);
30 |
31 | final Spinner branch_Spinner = findViewById(R.id.BranchSpinner);
32 | final ArrayAdapter branch_adapter = ArrayAdapter.createFromResource(this,R.array.branch,android.R.layout.simple_spinner_item);
33 |
34 | final Spinner division_Spinner = findViewById(R.id.DivisionSpinner);
35 | ArrayAdapter division_adapter = ArrayAdapter.createFromResource(this,R.array.division,android.R.layout.simple_spinner_item);
36 |
37 | year_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
38 | year_Spinner.setAdapter(year_adapter);
39 | branch_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
40 | branch_Spinner.setAdapter(branch_adapter);
41 | division_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
42 | division_Spinner.setAdapter(division_adapter);
43 |
44 | year_Spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
45 | @Override
46 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
47 | year[0] = year_Spinner.getSelectedItem().toString();
48 | entry[0]=1;
49 | }
50 |
51 | @Override
52 | public void onNothingSelected(AdapterView> parent) {
53 | entry[0]=0;
54 | }
55 | });
56 |
57 | branch_Spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
58 | @Override
59 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
60 | branch[0] = branch_Spinner.getSelectedItem().toString();
61 | entry[1]=1;
62 | }
63 |
64 | @Override
65 | public void onNothingSelected(AdapterView> parent) {
66 | entry[1]=0;
67 | }
68 | });
69 |
70 | division_Spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
71 | @Override
72 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
73 | division[0] = division_Spinner.getSelectedItem().toString();
74 | entry[2]=1;
75 | }
76 |
77 | @Override
78 | public void onNothingSelected(AdapterView> parent) {
79 | entry[2]=0;
80 | }
81 |
82 |
83 | });
84 |
85 | Button next = findViewById(R.id.NextButton);
86 |
87 | next.setOnClickListener(new View.OnClickListener() {
88 | @Override
89 | public void onClick(View v) {
90 |
91 | Roll[0] = roll_no.getText().toString();
92 |
93 | if(Roll[0].equals("") ){
94 | Toast.makeText(getApplicationContext(),"Fill All Fields First", Toast.LENGTH_SHORT).show();
95 | }
96 | else{
97 | Intent i = new Intent(StudentInfo.this, PersonalInfo.class);
98 | i.putExtra("Roll", Roll[0]);
99 | i.putExtra("Branch",branch[0]);
100 | i.putExtra("Year",year[0]);
101 | i.putExtra("Division",division[0]);
102 | startActivity(i);
103 | }
104 |
105 | }
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/RegisterInfo.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import android.widget.ProgressBar;
10 | import android.widget.Toast;
11 |
12 | import com.android.volley.AuthFailureError;
13 | import com.android.volley.Request;
14 | import com.android.volley.RequestQueue;
15 | import com.android.volley.Response;
16 | import com.android.volley.VolleyError;
17 | import com.android.volley.toolbox.StringRequest;
18 | import com.android.volley.toolbox.Volley;
19 |
20 | import org.json.JSONException;
21 | import org.json.JSONObject;
22 |
23 | import java.util.HashMap;
24 | import java.util.Map;
25 |
26 |
27 | public class RegisterInfo extends AppCompatActivity {
28 | //private ProgressBar progressBar;
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_register_info);
33 | Intent g = getIntent();
34 | final String Roll = g.getStringExtra("Roll");
35 | final String Year = g.getStringExtra("Year");
36 | final String Branch = g.getStringExtra("Branch");
37 | final String Division = g.getStringExtra("Division");
38 | final String First_Name = g.getStringExtra("First_Name");
39 | final String Last_Name = g.getStringExtra("Last_Name");
40 | final String Email_ID = g.getStringExtra("Email_ID");
41 |
42 |
43 | final String[] Username = new String[1];
44 | final String[] Password = new String[1];
45 |
46 | final EditText username = findViewById(R.id.UsernameBox);
47 | final EditText password = findViewById(R.id.PasswordBox);
48 |
49 | Button Final_Register = findViewById(R.id.Final_Button);
50 | Final_Register.setOnClickListener(new View.OnClickListener() {
51 | @Override
52 | public void onClick(View v) {
53 | Username[0] = username.getText().toString();
54 | Password[0] = password.getText().toString();
55 |
56 | if (Username[0].equals("") || Password[0].equals("")) {
57 | Toast.makeText(getApplicationContext(), "Fill All Fields First", Toast.LENGTH_SHORT).show();
58 | } else {
59 | registerUser(Roll,First_Name,Last_Name,Year,Branch,Division,Username[0],Email_ID,Password[0]);
60 | Intent i = new Intent(RegisterInfo.this, MainActivity.class);
61 | startActivity(i);
62 | finish();
63 | }
64 |
65 | }
66 | });
67 | }
68 | private void registerUser(final String rollno, final String fname, final String lname, final String year, final String branch, final String division, final String username, final String email_ID, final String password){
69 |
70 |
71 | StringRequest stringRequest = new StringRequest(Request.Method.POST, Constants.URL_REGISTER,
72 | new Response.Listener() {
73 | @Override
74 | public void onResponse(String response) {
75 |
76 | try {
77 | JSONObject jsonObject = new JSONObject(response);
78 | Toast.makeText(getApplicationContext(), jsonObject.getString("message"),Toast.LENGTH_LONG).show();
79 | finish();
80 | } catch (JSONException e) {
81 | e.printStackTrace();
82 | }
83 | }
84 | },
85 | new Response.ErrorListener() {
86 | @Override
87 | public void onErrorResponse(VolleyError error) {
88 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
89 | finish();
90 | }
91 | }){
92 | @Override
93 | protected Map getParams() throws AuthFailureError {
94 | Map params = new HashMap<>();
95 | params.put("rollno", rollno);
96 | params.put("fname", fname);
97 | params.put("lname", lname);
98 | params.put("year", year);
99 | params.put("branch", branch);
100 | params.put("division", division);
101 | params.put("username", username);
102 | params.put("email", email_ID);
103 | params.put("password", password);
104 | return params;
105 | }
106 | };
107 |
108 | RequestHandler.getInstance(this).addToRequestQueue(stringRequest);
109 | }
110 |
111 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/app/attender/Scan_Start.java:
--------------------------------------------------------------------------------
1 | package com.example.app.attender;
2 |
3 | import android.content.Intent;
4 | import android.support.annotation.NonNull;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Toast;
9 |
10 | import com.android.volley.AuthFailureError;
11 | import com.android.volley.Request;
12 | import com.android.volley.Response;
13 | import com.android.volley.VolleyError;
14 | import com.android.volley.toolbox.StringRequest;
15 | import com.budiyev.android.codescanner.CodeScanner;
16 | import com.budiyev.android.codescanner.CodeScannerView;
17 | import com.budiyev.android.codescanner.DecodeCallback;
18 | import com.google.zxing.Result;
19 |
20 | import org.json.JSONException;
21 | import org.json.JSONObject;
22 |
23 | import java.util.HashMap;
24 | import java.util.Map;
25 |
26 | public class Scan_Start extends AppCompatActivity {
27 | private CodeScanner mCodeScanner;
28 | String subject,time;
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.activity_scan__start);
33 |
34 | CodeScannerView scannerView = findViewById(R.id.scanner_view);
35 | mCodeScanner = new CodeScanner(this, scannerView);
36 | mCodeScanner.setDecodeCallback(new DecodeCallback() {
37 | @Override
38 | public void onDecoded(@NonNull final Result result) {
39 | Scan_Start.this.runOnUiThread(new Runnable() {
40 | @Override
41 | public void run() {
42 | //Toast.makeText(Scan_Start.this, result.getText(), Toast.LENGTH_SHORT).show();
43 | try {
44 | JSONObject reader = new JSONObject(result.getText());
45 | subject = reader.getString("subject");
46 | time = reader.getString("time");
47 | //Toast.makeText(Scan_Start.this, time, Toast.LENGTH_SHORT).show();
48 | // Toast.makeText(Scan_Start.this, subject, Toast.LENGTH_SHORT).show();
49 | } catch (JSONException e) {
50 | e.printStackTrace();
51 | }
52 |
53 | StringRequest stringRequest = new StringRequest(Request.Method.POST, Constants.URL_AT,
54 | new Response.Listener() {
55 | @Override
56 | public void onResponse(String response) {
57 |
58 | try {
59 | JSONObject jsonObject = new JSONObject(response);
60 | Toast.makeText(getApplicationContext(), jsonObject.getString("message"),Toast.LENGTH_LONG).show();
61 | } catch (JSONException e) {
62 | e.printStackTrace();
63 | }
64 | }
65 | },
66 | new Response.ErrorListener() {
67 | @Override
68 | public void onErrorResponse(VolleyError error) {
69 | Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
70 | }
71 | }){
72 | @Override
73 | protected Map getParams() throws AuthFailureError {
74 | Map params = new HashMap<>();
75 | params.put("username", SharedPrefManager.getInstance(Scan_Start.this).getName());
76 | params.put("subject", subject);
77 | params.put("time", time);
78 | return params;
79 | }
80 | };
81 |
82 | RequestHandler.getInstance(Scan_Start.this).addToRequestQueue(stringRequest);
83 |
84 | Intent i = new Intent(Scan_Start.this,QRScanner.class);
85 | startActivity(i);
86 | finish();
87 |
88 | }
89 | });
90 | }
91 | });
92 | scannerView.setOnClickListener(new View.OnClickListener() {
93 | @Override
94 | public void onClick(View view) {
95 | mCodeScanner.startPreview();
96 | }
97 | });
98 | }
99 |
100 | @Override
101 | protected void onResume() {
102 | super.onResume();
103 | mCodeScanner.startPreview();
104 | }
105 |
106 | @Override
107 | protected void onPause() {
108 | mCodeScanner.releaseResources();
109 | super.onPause();
110 | }
111 | }
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_student_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
27 |
28 |
40 |
41 |
53 |
54 |
65 |
66 |
77 |
78 |
87 |
88 |
99 |
100 |
109 |
110 |
121 |
122 |
131 |
132 |
143 |
144 |
--------------------------------------------------------------------------------