commit 5134d78789402e6b72289c2db0d3c2248889204c Author: Sumit Mandal Date: Sat Mar 11 19:03:08 2023 +0530 Init Upload diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..a13f602 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Attendance \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..abd4805 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b1f8730 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..e7cb5a9 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,47 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'com.google.gms.google-services' +} + +android { + namespace 'com.example.attendance' + compileSdk 33 + + defaultConfig { + applicationId "com.example.attendance" + minSdk 24 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.8.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.firebase:firebase-auth-ktx:21.0.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + implementation 'de.hdodenhof:circleimageview:3.1.0' +} \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..596a067 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "867792100747", + "project_id": "attendance-d4dcf", + "storage_bucket": "attendance-d4dcf.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:867792100747:android:9a9e2cd0f00936003da38e", + "android_client_info": { + "package_name": "com.example.attendance" + } + }, + "oauth_client": [ + { + "client_id": "867792100747-gc50cusn2nsol19e2vloujlhltkeitjh.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDTzG3NxUVIZ6G7rTfyj_WCneWpuC6Z1C4" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "867792100747-gc50cusn2nsol19e2vloujlhltkeitjh.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/attendance/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/example/attendance/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..067bed8 --- /dev/null +++ b/app/src/androidTest/java/com/example/attendance/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.attendance + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.attendance", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..4e94c9a --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/attendance/DBHelper.kt b/app/src/main/java/com/example/attendance/DBHelper.kt new file mode 100644 index 0000000..285e3f4 --- /dev/null +++ b/app/src/main/java/com/example/attendance/DBHelper.kt @@ -0,0 +1,100 @@ +package com.example.attendance + +import android.content.ContentValues +import android.content.Context +import android.database.Cursor +import android.database.sqlite.SQLiteDatabase +import android.database.sqlite.SQLiteOpenHelper + +class DBHelper(context: Context, factory: SQLiteDatabase.CursorFactory?) : + SQLiteOpenHelper(context, DATABASE_NAME, factory, DATABASE_VERSION) { + + // below is the method for creating a database by a sqlite query + override fun onCreate(db: SQLiteDatabase) { + // below is a sqlite query, where column names + // along with their data types is given + val query = ("CREATE TABLE " + TABLE_NAME + " (" + + ID_COL + " INTEGER PRIMARY KEY, " + + EMAIL_COl + " TEXT," + + PASSWORD_COL + " TEXT," + + CONPASSWORD_COL + " TEXT" + ")") + + // we are calling sqlite + // method for executing our query + db.execSQL(query) + } + + override fun onUpgrade(db: SQLiteDatabase, p1: Int, p2: Int) { + // this method is to check if table already exists + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME) + onCreate(db) + } + + // This method is for adding data in our database + fun addUser(email : String, password : String, conpassword : String ){ + + // below we are creating + // a content values variable + val values = ContentValues() + + // we are inserting our values + // in the form of key-value pair + values.put(EMAIL_COl, email) + values.put(PASSWORD_COL, password) + values.put(CONPASSWORD_COL, conpassword) + + // here we are creating a + // writable variable of + // our database as we want to + // insert value in our database + val db = this.writableDatabase + + // all values are inserted into database + db.insert(TABLE_NAME, null, values) + + // at last we are + // closing our database + db.close() + } + + // below method is to get + // all data from our database + fun getUser(): Cursor? { + + // here we are creating a readable + // variable of our database + // as we want to read value from it + val db = this.readableDatabase + + // below code returns a cursor to + // read data from the database + return db.rawQuery("SELECT * FROM " + TABLE_NAME, null) + + } + + companion object{ + // here we have defined variables for our database + + // below is variable for database name + private val DATABASE_NAME = "SentientGeeks" + + // below is the variable for database version + private val DATABASE_VERSION = 1 + + // below is the variable for table name + val TABLE_NAME = "gfg_table" + + // below is the variable for id column + val ID_COL = "id" + + // below is the variable for email column + val EMAIL_COl = "email" + + // below is the variable for password column + val PASSWORD_COL = "password" + + val CONPASSWORD_COL = "conpassword" + + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/attendance/HomeActivity.kt b/app/src/main/java/com/example/attendance/HomeActivity.kt new file mode 100644 index 0000000..45740ad --- /dev/null +++ b/app/src/main/java/com/example/attendance/HomeActivity.kt @@ -0,0 +1,11 @@ +package com.example.attendance + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle + +class HomeActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_home) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/attendance/LoginActivity.kt b/app/src/main/java/com/example/attendance/LoginActivity.kt new file mode 100644 index 0000000..10c27f9 --- /dev/null +++ b/app/src/main/java/com/example/attendance/LoginActivity.kt @@ -0,0 +1,81 @@ +package com.example.attendance + +import android.content.Intent +import android.graphics.Color +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.text.Html +import android.widget.Button +import android.widget.EditText +import android.widget.TextView +import android.widget.Toast +import com.google.android.material.textfield.TextInputEditText +import com.google.firebase.auth.FirebaseAuth + +class LoginActivity : AppCompatActivity() { + private lateinit var textView: TextView + private lateinit var edt_email: EditText + private lateinit var edt_pass: TextInputEditText + + lateinit var email: String + lateinit var pass: String + + private lateinit var auth: FirebaseAuth + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_login) + auth = FirebaseAuth.getInstance() + + edt_email =findViewById(R.id.edt_email) + edt_pass = findViewById(R.id.edt_pass) + + textView=findViewById(R.id.textview) + textView.text= Html.fromHtml("Click " + "here " + + " to register") + + val btn_login = findViewById