Create UserLogin class - first create the UML, then create the Kotlin class with a main function that tests the class and its constructor and methods, then create an Android app that would allow the a...

1 answer below »
See attached doc


Create UserLogin class - first create the UML, then create the Kotlin class with a main function that tests the class and its constructor and methods, then create an Android app that would allow the a user to login. Your UserLogin should maintain: user real name, username, password, userID (integer, unique) Your UserLogin class should have a toString function that returns a string containing all the information (user's name, username, password, and userID) nicely formatted. Create a main() function that instantiates at least 2 instances of the UserLogin, demonstrating that the userID gets changed. (HINT: see the Kotlin Classes, Constructors, and a Singleton video in the Media and Readings section) Your Android UI should have appropriate layouts, textviews, input fields, and buttons - it does not have to be functional, but your Android widgets (textviews, inputs, buttons) should be named appropriately) (Name your Android class your initials and UserLogin Zip all your materials into one file.  You have 2 weeks for this assignment
Answered 6 days AfterOct 12, 2021

Answer To: Create UserLogin class - first create the UML, then create the Kotlin class with a main function...

Swapnil answered on Oct 19 2021
119 Votes
93597/application/.gitignore
/build
93597/application/app.iml













generateDebugSources





































































































































93597/application/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android
{
compileSdkVersion 25
buildToolsVersion '25.0.1'
defaultConfig
{
applicationId "com.kotlindroider.welcome"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes
{
release
{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories
{
mavenCentral()
}
93597/application/src/main/AndroidManifest.xml











93597/application/src/main/java/com/kotlindroider/welcome/LoginActivity.kt
package com.kotlindroider.welcome
import android.app.Activity
import android.app.ProgressDialog
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
class LoginActivity : AppCompatActivity()
{
var _emailText: EditText? = null
var _passwordText: EditText? = null
var _loginButton: Button? = null
var _signupLink: TextView? = null
public override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
setContentView(com.kotlindroider.welcome.R.layout.activity_login
_loginButton = findViewById(R.id.btn_login) as Button
_signupLink = findViewById(R.id.link_signup) as TextView
_passwordText = findViewById(R.id.input_password) as EditText
_emailText = findViewById(R.id.input_email) as EditText
_loginButton!!.setOnClickListener
{
login()
}
_signupLink!!.setOnClickListener
{
val intent = Intent(applicationContext, SignupActivity::class.java)
startActivityForResult(intent, REQUEST_SIGNUP)
finish()
}
}
fun login()
{
Log.d(TAG, "Login")
if (!validate())
{
onLoginFailed()
return
}
_loginButton!!.isEnabled = false
val progressDialog = ProgressDialog(this@LoginActivity,
com.kotlindroider.welcome.R.style.AppTheme_Dark_Dialog)
progressDialog.isIndeterminate = true
progressDialog.setMessage("Login...")
progressDialog.show()
val email = _emailText!!.text.toString()
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here