0% found this document useful (0 votes)
10 views3 pages

Android App Development Assignment 2

This document is an assignment for Android App Development from the Shaheed Zulfikar Ali Bhutto Institute of Science & Technology. It includes code snippets demonstrating the use of Dagger for dependency injection in a Person class. The assignment emphasizes the importance of originality and timely submission.

Uploaded by

2212201
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Android App Development Assignment 2

This document is an assignment for Android App Development from the Shaheed Zulfikar Ali Bhutto Institute of Science & Technology. It includes code snippets demonstrating the use of Dagger for dependency injection in a Person class. The assignment emphasizes the importance of originality and timely submission.

Uploaded by

2212201
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Total Marks: 04

Obtained Marks:

Android App Development


Assignment # 02

Teacher Name: Sir Zubair Ahmad


_____________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Student Name: Muhammad Aziz Niazi


______________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Reg. Number: 2212201

AAD BS(CS)-6-a&b SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

Instructions: Copied or shown assignments will be marked zero. Late submissions are not

Assignment 2

import [Link]
@Retention([Link])
@Qualifier
annotation class FirstName()

package [Link]
import [Link]
@Retention([Link])
@Qualifier
annotation class LastName()

package [Link]

import [Link]
import [Link]

class Person @Inject constructor(@FirstName val firstName: String,@LastName val


lastName: String)
{
}

package [Link]

import [Link]
import [Link]
import [Link]
import [Link]
@Component
interface PersonComponent {
fun getPerson(): Person
@[Link]
interface Factory {
fun create(
@FirstName @BindsInstance FirstName:String,
@LastName @BindsInstance LastName:String
): PersonComponent

}
package [Link]

AAD BS(CS)-6-a&b SZABIST-ISB


Shaheed Zulfikar Ali Bhutto Institute of Science & Technology

COMPUTER SCIENCE DEPARTMENT

import [Link]
import [Link]
import [Link]

@Module

class PersonModule {
@Provides
@Named("FirstName")
fun providesFirstName(): String{
return "Usman"
}
@Provides
@Named("LastName")
fun providesLastName(): String{
return "Masood"
}

package [Link]

import [Link]
import [Link]

fun main() {
val component = [Link]().create("Usman","Masood")
val student = [Link]()
println("${[Link]} ${[Link]}")
}

AAD BS(CS)-6-a&b SZABIST-ISB

You might also like