diff --git a/LoginForm/.gitignore b/LoginForm/.gitignore new file mode 100644 index 0000000..2b75303 --- /dev/null +++ b/LoginForm/.gitignore @@ -0,0 +1,13 @@ +*.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 diff --git a/LoginForm/.idea/encodings.xml b/LoginForm/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/LoginForm/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/LoginForm/.idea/gradle.xml b/LoginForm/.idea/gradle.xml new file mode 100644 index 0000000..2996d53 --- /dev/null +++ b/LoginForm/.idea/gradle.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/LoginForm/.idea/misc.xml b/LoginForm/.idea/misc.xml new file mode 100644 index 0000000..37a7509 --- /dev/null +++ b/LoginForm/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/LoginForm/.idea/runConfigurations.xml b/LoginForm/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/LoginForm/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/LoginForm/.idea/vcs.xml b/LoginForm/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/LoginForm/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LoginForm/app/.gitignore b/LoginForm/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/LoginForm/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/LoginForm/app/build.gradle b/LoginForm/app/build.gradle new file mode 100644 index 0000000..eedbb25 --- /dev/null +++ b/LoginForm/app/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.0" + defaultConfig { + applicationId "com.example.loginform" + minSdkVersion 17 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/LoginForm/app/proguard-rules.pro b/LoginForm/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/LoginForm/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 diff --git a/LoginForm/app/src/androidTest/java/com/example/loginform/ExampleInstrumentedTest.java b/LoginForm/app/src/androidTest/java/com/example/loginform/ExampleInstrumentedTest.java new file mode 100644 index 0000000..975bf86 --- /dev/null +++ b/LoginForm/app/src/androidTest/java/com/example/loginform/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.example.loginform; + +import android.content.Context; + +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.example.loginform", appContext.getPackageName()); + } +} diff --git a/LoginForm/app/src/main/AndroidManifest.xml b/LoginForm/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f58020c --- /dev/null +++ b/LoginForm/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LoginForm/app/src/main/java/com/example/loginform/MainActivity.java b/LoginForm/app/src/main/java/com/example/loginform/MainActivity.java new file mode 100644 index 0000000..66e0ace --- /dev/null +++ b/LoginForm/app/src/main/java/com/example/loginform/MainActivity.java @@ -0,0 +1,43 @@ +package com.example.loginform; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +public class MainActivity extends AppCompatActivity { + Button login; + EditText username,password; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + login=findViewById(R.id.btnlogin); + username=findViewById(R.id.txtuser); + password=findViewById(R.id.txtpass); + login.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + login(); + + } + }); + + } + + public void login(){ + String user=username.getText().toString().trim(); + String pass=password.getText().toString().trim(); + if(user.equals("rahul")&& pass.equals("rahul")){ + Toast.makeText(this,"username and password match",Toast.LENGTH_LONG).show(); + } + else{ + Toast.makeText(this,"username and password do not match",Toast.LENGTH_LONG).show(); + } + + } +} diff --git a/LoginForm/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/LoginForm/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/LoginForm/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/LoginForm/app/src/main/res/drawable/ic_launcher_background.xml b/LoginForm/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/LoginForm/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LoginForm/app/src/main/res/layout/activity_main.xml b/LoginForm/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..7bca547 --- /dev/null +++ b/LoginForm/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,40 @@ + + + + + + + + + +