androidd 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- androidd/cie1/ques1/MainActivity.kt +37 -0
- androidd/cie1/ques1/activity_main.xml +41 -0
- androidd/cie1/ques2/MainActivity.kt +41 -0
- androidd/cie1/ques2/activity_main.xml +66 -0
- androidd/cie1/ques3/AndroidManifest.xml +3 -0
- androidd/cie1/ques3/MainActivity.kt +29 -0
- androidd/cie1/ques3/activity_main.xml +30 -0
- androidd/madbmsj/sharedpref/byJ/MainActivity.kt +34 -0
- androidd/madbmsj/sharedpref/byJ/activity_main.xml +28 -0
- androidd/madbmsj/spinner/MainActivity.kt +30 -0
- androidd/madbmsj/spinner/activity_main.xml +13 -0
- {androidd-0.0.2.dist-info → androidd-0.0.3.dist-info}/METADATA +1 -1
- {androidd-0.0.2.dist-info → androidd-0.0.3.dist-info}/RECORD +15 -4
- {androidd-0.0.2.dist-info → androidd-0.0.3.dist-info}/WHEEL +0 -0
- {androidd-0.0.2.dist-info → androidd-0.0.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
package com.example.labexam_01
|
2
|
+
|
3
|
+
import android.support.v7.app.AppCompatActivity
|
4
|
+
import android.os.Bundle
|
5
|
+
import android.view.View
|
6
|
+
import android.widget.CheckBox
|
7
|
+
import android.widget.TextView
|
8
|
+
import android.widget.Toast
|
9
|
+
|
10
|
+
class MainActivity : AppCompatActivity() {
|
11
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
12
|
+
super.onCreate(savedInstanceState)
|
13
|
+
setContentView(R.layout.activity_main)
|
14
|
+
}
|
15
|
+
|
16
|
+
fun calculateTotal(view: View) {
|
17
|
+
val book1 = findViewById<CheckBox>(R.id.book1)
|
18
|
+
val book2 = findViewById<CheckBox>(R.id.book2)
|
19
|
+
val book3 = findViewById<CheckBox>(R.id.book3)
|
20
|
+
val result = findViewById<TextView>(R.id.tvResult)
|
21
|
+
|
22
|
+
var total = 0
|
23
|
+
|
24
|
+
if (book1.isChecked) total += 120
|
25
|
+
if (book2.isChecked) total += 150
|
26
|
+
if (book3.isChecked) total += 200
|
27
|
+
|
28
|
+
val finalAmount = if (total > 300) total * 0.9 else total.toDouble()
|
29
|
+
|
30
|
+
if (total > 0) {
|
31
|
+
val discountText = if (total > 300) " (10% discount applied)" else ""
|
32
|
+
result.text = "Total: ₹${"%.2f".format(finalAmount)}$discountText"
|
33
|
+
} else {
|
34
|
+
Toast.makeText(this, "Please select at least one book", Toast.LENGTH_SHORT).show()
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
android:layout_width="match_parent"
|
4
|
+
android:layout_height="match_parent"
|
5
|
+
android:orientation="vertical"
|
6
|
+
android:padding="16dp">
|
7
|
+
|
8
|
+
<CheckBox
|
9
|
+
android:id="@+id/book1"
|
10
|
+
android:text="Java - ₹120"
|
11
|
+
android:layout_width="wrap_content"
|
12
|
+
android:layout_height="wrap_content" />
|
13
|
+
|
14
|
+
<CheckBox
|
15
|
+
android:id="@+id/book2"
|
16
|
+
android:text="Kotlin - ₹150"
|
17
|
+
android:layout_width="wrap_content"
|
18
|
+
android:layout_height="wrap_content" />
|
19
|
+
|
20
|
+
<CheckBox
|
21
|
+
android:id="@+id/book3"
|
22
|
+
android:text="Android Dev - ₹200"
|
23
|
+
android:layout_width="wrap_content"
|
24
|
+
android:layout_height="wrap_content" />
|
25
|
+
|
26
|
+
<Button
|
27
|
+
android:id="@+id/btnCalculate"
|
28
|
+
android:text="Calculate Total"
|
29
|
+
android:layout_width="match_parent"
|
30
|
+
android:layout_height="wrap_content"
|
31
|
+
android:onClick="calculateTotal" />
|
32
|
+
|
33
|
+
<TextView
|
34
|
+
android:id="@+id/tvResult"
|
35
|
+
android:text="Total: ₹0"
|
36
|
+
android:textSize="18sp"
|
37
|
+
android:layout_marginTop="20dp"
|
38
|
+
android:layout_width="wrap_content"
|
39
|
+
android:layout_height="wrap_content" />
|
40
|
+
|
41
|
+
</LinearLayout>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
package com.example.labexam_02
|
2
|
+
|
3
|
+
import android.support.v7.app.AppCompatActivity
|
4
|
+
import android.os.Bundle
|
5
|
+
import android.view.View
|
6
|
+
import android.widget.EditText
|
7
|
+
import android.widget.TextView
|
8
|
+
import android.widget.Toast
|
9
|
+
|
10
|
+
class MainActivity : AppCompatActivity() {
|
11
|
+
|
12
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
13
|
+
super.onCreate(savedInstanceState)
|
14
|
+
setContentView(R.layout.activity_main)
|
15
|
+
}
|
16
|
+
|
17
|
+
fun calculate(view: View) {
|
18
|
+
val num1 = findViewById<EditText>(R.id.num1).text.toString().toDoubleOrNull()
|
19
|
+
val num2 = findViewById<EditText>(R.id.num2).text.toString().toDoubleOrNull()
|
20
|
+
val resultView = findViewById<TextView>(R.id.tvResult)
|
21
|
+
|
22
|
+
if (num1 == null || num2 == null) {
|
23
|
+
Toast.makeText(this, "Enter valid numbers", Toast.LENGTH_SHORT).show()
|
24
|
+
return
|
25
|
+
}
|
26
|
+
|
27
|
+
val result = when (view.id) {
|
28
|
+
R.id.btnAdd -> num1 + num2
|
29
|
+
R.id.btnSub -> num1 - num2
|
30
|
+
R.id.btnMul -> num1 * num2
|
31
|
+
R.id.btnDiv -> if (num2 != 0.0) num1 / num2 else {
|
32
|
+
Toast.makeText(this, "Cannot divide by zero", Toast.LENGTH_SHORT).show()
|
33
|
+
return
|
34
|
+
}
|
35
|
+
else -> 0.0
|
36
|
+
}
|
37
|
+
|
38
|
+
resultView.text = "Result: $result"
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
android:layout_width="match_parent"
|
4
|
+
android:layout_height="wrap_content"
|
5
|
+
android:orientation="vertical"
|
6
|
+
android:padding="16dp">
|
7
|
+
|
8
|
+
<EditText
|
9
|
+
android:id="@+id/num1"
|
10
|
+
android:hint="Enter first number"
|
11
|
+
android:inputType="numberDecimal"
|
12
|
+
android:layout_width="match_parent"
|
13
|
+
android:layout_height="wrap_content" />
|
14
|
+
|
15
|
+
<EditText
|
16
|
+
android:id="@+id/num2"
|
17
|
+
android:hint="Enter second number"
|
18
|
+
android:inputType="numberDecimal"
|
19
|
+
android:layout_width="match_parent"
|
20
|
+
android:layout_height="wrap_content" />
|
21
|
+
|
22
|
+
<LinearLayout
|
23
|
+
android:layout_width="match_parent"
|
24
|
+
android:layout_height="wrap_content"
|
25
|
+
android:orientation="horizontal"
|
26
|
+
android:gravity="center"
|
27
|
+
android:layout_marginTop="16dp">
|
28
|
+
|
29
|
+
<Button
|
30
|
+
android:id="@+id/btnAdd"
|
31
|
+
android:text="+"
|
32
|
+
android:onClick="calculate"
|
33
|
+
android:layout_width="wrap_content"
|
34
|
+
android:layout_height="wrap_content" />
|
35
|
+
|
36
|
+
<Button
|
37
|
+
android:id="@+id/btnSub"
|
38
|
+
android:text="-"
|
39
|
+
android:onClick="calculate"
|
40
|
+
android:layout_width="wrap_content"
|
41
|
+
android:layout_height="wrap_content" />
|
42
|
+
|
43
|
+
<Button
|
44
|
+
android:id="@+id/btnMul"
|
45
|
+
android:text="*"
|
46
|
+
android:onClick="calculate"
|
47
|
+
android:layout_width="wrap_content"
|
48
|
+
android:layout_height="wrap_content" />
|
49
|
+
|
50
|
+
<Button
|
51
|
+
android:id="@+id/btnDiv"
|
52
|
+
android:text="/"
|
53
|
+
android:onClick="calculate"
|
54
|
+
android:layout_width="wrap_content"
|
55
|
+
android:layout_height="wrap_content" />
|
56
|
+
</LinearLayout>
|
57
|
+
|
58
|
+
<TextView
|
59
|
+
android:id="@+id/tvResult"
|
60
|
+
android:text="Result:"
|
61
|
+
android:textSize="20sp"
|
62
|
+
android:textColor="#008000"
|
63
|
+
android:layout_marginTop="20dp"
|
64
|
+
android:layout_width="wrap_content"
|
65
|
+
android:layout_height="wrap_content" />
|
66
|
+
</LinearLayout>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
package com.example.labexam_03
|
2
|
+
|
3
|
+
import android.os.Bundle
|
4
|
+
import android.support.v7.app.AppCompatActivity
|
5
|
+
import android.widget.Button
|
6
|
+
import android.widget.TextView
|
7
|
+
import android.widget.Toast
|
8
|
+
|
9
|
+
class MainActivity : AppCompatActivity() {
|
10
|
+
private var count = 0
|
11
|
+
|
12
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
13
|
+
super.onCreate(savedInstanceState)
|
14
|
+
setContentView(R.layout.activity_main)
|
15
|
+
|
16
|
+
val tvCounter = findViewById<TextView>(R.id.tvCounter)
|
17
|
+
val btnIncrement = findViewById<Button>(R.id.btnIncrement)
|
18
|
+
val btnToast = findViewById<Button>(R.id.btnToast)
|
19
|
+
|
20
|
+
btnIncrement.setOnClickListener {
|
21
|
+
count++
|
22
|
+
tvCounter.text = count.toString()
|
23
|
+
}
|
24
|
+
|
25
|
+
btnToast.setOnClickListener {
|
26
|
+
Toast.makeText(this, "Hello from Toast!", Toast.LENGTH_SHORT).show()
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
android:orientation="horizontal"
|
4
|
+
android:layout_width="match_parent"
|
5
|
+
android:layout_height="match_parent"
|
6
|
+
android:gravity="center"
|
7
|
+
android:padding="16dp">
|
8
|
+
|
9
|
+
<TextView
|
10
|
+
android:id="@+id/tvCounter"
|
11
|
+
android:layout_width="wrap_content"
|
12
|
+
android:layout_height="wrap_content"
|
13
|
+
android:text="0"
|
14
|
+
android:textSize="32sp"
|
15
|
+
android:layout_marginEnd="32dp"/>
|
16
|
+
|
17
|
+
<Button
|
18
|
+
android:id="@+id/btnIncrement"
|
19
|
+
android:layout_width="wrap_content"
|
20
|
+
android:layout_height="wrap_content"
|
21
|
+
android:text="Increment"
|
22
|
+
android:layout_marginEnd="16dp"/>
|
23
|
+
|
24
|
+
<Button
|
25
|
+
android:id="@+id/btnToast"
|
26
|
+
android:layout_width="wrap_content"
|
27
|
+
android:layout_height="wrap_content"
|
28
|
+
android:text="Toast"/>
|
29
|
+
|
30
|
+
</LinearLayout>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
package com.example.practice
|
2
|
+
|
3
|
+
import android.os.Bundle
|
4
|
+
import android.support.v7.app.AppCompatActivity
|
5
|
+
import android.widget.*
|
6
|
+
|
7
|
+
class MainActivity : AppCompatActivity() {
|
8
|
+
private val PREFS_NAME = "MyPrefs"
|
9
|
+
private val KEY_NAME = "username"
|
10
|
+
|
11
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
12
|
+
super.onCreate(savedInstanceState)
|
13
|
+
setContentView(R.layout.activity_main)
|
14
|
+
|
15
|
+
val etName = findViewById<EditText>(R.id.etName)
|
16
|
+
val btnSave = findViewById<Button>(R.id.btnSave)
|
17
|
+
val tvDisplay = findViewById<TextView>(R.id.tvDisplay)
|
18
|
+
|
19
|
+
val prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE)
|
20
|
+
val savedName = prefs.getString(KEY_NAME, "No name saved")
|
21
|
+
tvDisplay.text = "Saved Name: $savedName"
|
22
|
+
|
23
|
+
btnSave.setOnClickListener {
|
24
|
+
val name = etName.text.toString()
|
25
|
+
if (name.isNotEmpty()) {
|
26
|
+
prefs.edit().putString(KEY_NAME, name).apply()
|
27
|
+
tvDisplay.text = "Saved Name: $name"
|
28
|
+
Toast.makeText(this, "Name saved", Toast.LENGTH_SHORT).show()
|
29
|
+
} else {
|
30
|
+
Toast.makeText(this, "Please enter a name", Toast.LENGTH_SHORT).show()
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
android:layout_width="match_parent"
|
4
|
+
android:layout_height="match_parent"
|
5
|
+
android:orientation="vertical"
|
6
|
+
android:padding="16dp"
|
7
|
+
android:gravity="center">
|
8
|
+
|
9
|
+
<EditText
|
10
|
+
android:id="@+id/etName"
|
11
|
+
android:layout_width="match_parent"
|
12
|
+
android:layout_height="wrap_content"
|
13
|
+
android:hint="Enter your name" />
|
14
|
+
|
15
|
+
<Button
|
16
|
+
android:id="@+id/btnSave"
|
17
|
+
android:layout_width="wrap_content"
|
18
|
+
android:layout_height="wrap_content"
|
19
|
+
android:text="Save Name"
|
20
|
+
android:layout_marginTop="10dp" />
|
21
|
+
|
22
|
+
<TextView
|
23
|
+
android:id="@+id/tvDisplay"
|
24
|
+
android:layout_width="wrap_content"
|
25
|
+
android:layout_height="wrap_content"
|
26
|
+
android:text="Your name will appear here"
|
27
|
+
android:layout_marginTop="20dp"/>
|
28
|
+
</LinearLayout>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
package com.example.practice
|
2
|
+
|
3
|
+
import android.os.Bundle
|
4
|
+
import android.support.v7.app.AppCompatActivity
|
5
|
+
import android.view.View
|
6
|
+
import android.widget.*
|
7
|
+
|
8
|
+
class MainActivity : AppCompatActivity() {
|
9
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
10
|
+
super.onCreate(savedInstanceState)
|
11
|
+
setContentView(R.layout.activity_main)
|
12
|
+
|
13
|
+
val spinner = findViewById<Spinner>(R.id.spinner)
|
14
|
+
val items = arrayOf("CSE", "ISE", "ECE", "MECH", "CIVIL")
|
15
|
+
|
16
|
+
val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, items)
|
17
|
+
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
18
|
+
spinner.adapter = adapter
|
19
|
+
|
20
|
+
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
21
|
+
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
|
22
|
+
Toast.makeText(applicationContext, "Selected: ${items[position]}", Toast.LENGTH_SHORT).show()
|
23
|
+
}
|
24
|
+
|
25
|
+
override fun onNothingSelected(parent: AdapterView<*>) {
|
26
|
+
// Do nothing
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
android:layout_width="match_parent"
|
4
|
+
android:layout_height="match_parent"
|
5
|
+
android:orientation="vertical"
|
6
|
+
android:padding="16dp"
|
7
|
+
android:gravity="center">
|
8
|
+
|
9
|
+
<Spinner
|
10
|
+
android:id="@+id/spinner"
|
11
|
+
android:layout_width="wrap_content"
|
12
|
+
android:layout_height="wrap_content" />
|
13
|
+
</LinearLayout>
|
@@ -20,6 +20,13 @@ androidd/cie1/datepicker/MainActivity.kt,sha256=fZKRR6IxCmbJOjtJrpKMq2w-qIOXwiz1
|
|
20
20
|
androidd/cie1/datepicker/activity_main.xml,sha256=Xmt3YVtDiv53djRY67Ss0dx4ueQTOSazmUa2Pr1Nebc,704
|
21
21
|
androidd/cie1/progressbar/MainActivity.kt,sha256=KSOTOZ5dgMyBveMX1XImgeseCMlP3B9oSyrkT2gSqe8,847
|
22
22
|
androidd/cie1/progressbar/activity_main.xml,sha256=YXS2cIkkQGSn_I1nvYpCHbK0UItaWx1W-4Hhz_jVel8,717
|
23
|
+
androidd/cie1/ques1/MainActivity.kt,sha256=BwSgRWTzPc0PCPXZ1Bc7OhyJggd4VmQEvU64DKNDvmU,1263
|
24
|
+
androidd/cie1/ques1/activity_main.xml,sha256=RuybG6yqOSt6ZE9mtCgt6-xY47owcLayexDQmzGvWZk,1324
|
25
|
+
androidd/cie1/ques2/MainActivity.kt,sha256=ZrpHwZ5EsSFJPKrClxvvUQZdFK3JUdwW8RlNP1-WhRU,1317
|
26
|
+
androidd/cie1/ques2/activity_main.xml,sha256=KFWsD3ifn6r2xf0oEeme7uBmZJ_oea1DwyA_o2PwSQM,2199
|
27
|
+
androidd/cie1/ques3/AndroidManifest.xml,sha256=6hRte0LyU8U6dxY7I0zGc10bJCqSBJ4yo9OmSPdmTcE,91
|
28
|
+
androidd/cie1/ques3/MainActivity.kt,sha256=mDR2OkpxzPYMbviw4t32mP9WukXqcT0KW9PM5Mp_qYo,887
|
29
|
+
androidd/cie1/ques3/activity_main.xml,sha256=5urLng1II_M75J7vH0bFH0aKXB55r8JLXYlg1W5spps,957
|
23
30
|
androidd/cie1/radiobutton/MainActivity.kt,sha256=Ku-pCkQzdu4t0ThzaTM_gunN8DozulPdcwf0TgNWUTI,921
|
24
31
|
androidd/cie1/radiobutton/activity_main.xml,sha256=oNS70toZD6na4S4gVbGYv8Qr1iUrtqr0BtGDfE7V4jA,1251
|
25
32
|
androidd/cie1/timePicker/MainActivity.kt,sha256=60NDoxyMbhwhsFUMB4ou__16eft6sd5OTa8W4bJa6D0,994
|
@@ -85,11 +92,15 @@ androidd/madbmsj/popMenu/MainActivity.kt,sha256=gvixPDTFKgv40xTHhm0lDne_OPobDldB
|
|
85
92
|
androidd/madbmsj/popMenu/activity_main.xml,sha256=O7PvAR3tRlOT7qDC5P4KGF0u0RzVF5gfGodChsp1gHI,809
|
86
93
|
androidd/madbmsj/popMenu/info.txt,sha256=13_Lvt7x1EgcswAr2y9N5jpzbsQZJvM2OwHIzoUoCTY,70
|
87
94
|
androidd/madbmsj/popMenu/menu_main.xml,sha256=-YAmWskZkbr7DnjFClBKBWdV0Z4Mey5RHpWK1NNx18U,506
|
95
|
+
androidd/madbmsj/sharedpref/byJ/MainActivity.kt,sha256=GDIonpDL40yhHTNXbZfZhYNZ0wIMCx08WAAg5mZofS0,1248
|
96
|
+
androidd/madbmsj/sharedpref/byJ/activity_main.xml,sha256=UZu9E92TPgXV_ZHJ_YyXoWcwPYQaaJ9MTtAydBoKZUQ,952
|
88
97
|
androidd/madbmsj/sharedpref/shared1/activity_main.xml,sha256=zRi__9V9-AdAHaaLr2y8bum7XA_xIp9k4yTU0ZiBUVE,2628
|
89
98
|
androidd/madbmsj/sharedpref/shared1/mainactivity.kt,sha256=5-wO8Ex0qIdNT_XEUyePkbzGM67TShhR8oAAzHbfto8,1658
|
90
99
|
androidd/madbmsj/sharedpref/shared2/activity_main.xml,sha256=cpFIuD5yM1EptNBlEIwa2cLFojRaVvJmEeTqjauTnSM,1504
|
91
100
|
androidd/madbmsj/sharedpref/shared2/mainactivity.kt,sha256=pIh5VjuAz8u58UvMucuaHA4Kjv4GGbr4FXlK6rzWxNA,1727
|
92
|
-
androidd
|
93
|
-
androidd
|
94
|
-
androidd-0.0.
|
95
|
-
androidd-0.0.
|
101
|
+
androidd/madbmsj/spinner/MainActivity.kt,sha256=fOn0iiO7RMBKX6f07GWrqQGIuP-T4F8asmOjHAY5H3w,1153
|
102
|
+
androidd/madbmsj/spinner/activity_main.xml,sha256=8Ekuyc5snHN95mvlfznPde8Q53IkuerFE21pntS6A04,454
|
103
|
+
androidd-0.0.3.dist-info/METADATA,sha256=HpCTKzDzQTcQr03irBD11O28_--VHC9bH1vpybgyXvU,672
|
104
|
+
androidd-0.0.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
105
|
+
androidd-0.0.3.dist-info/top_level.txt,sha256=cpXaB1NHpb4z0T_zqPBwb5B3rW5ZWEyJ6z9bSBi0JTc,9
|
106
|
+
androidd-0.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|