Skip to content

Instantly share code, notes, and snippets.

View anncode1's full-sized avatar

Anahí Salgado anncode1

View GitHub Profile
dependencies {
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
}
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
dependencies {
def hilt_version = "2.28-alpha"
// Dagger Hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
fun main() {
val type = createType()
val contacts = createContacts()
val agenda = Agenda(type, contacts)
}
fun createType(): String = "Friends"
fun createContacts(): List<Contacts> =
listOf(
package com.example.hilttest.domain.agenda.model
/**
* Created by anahi.salgado on 27/07/2020
*/
class Agenda {
lateinit var type: String
lateinit var contacts: List<Contact>
package com.example.hilttest.domain.agenda.model
/**
* Created by anahi.salgado on 27/07/2020
*/
class Agenda {
lateinit var type: String
lateinit var contacts: List<Contact>
package com.example.hilttest.domain.agenda.model
/**
* Created by anahi.salgado on 27/07/2020
*/
data class Contact(
val name: String,
val phone: String
)
package com.ann.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
Android Manifest
<activity
android:name="SplashScreenActivity"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Ejemplo de código JavaScript en el propio documento</title>
<script type="text/javascript"> alert("Un mensaje de prueba");
</script>
</head>
<body>
<p>Un párrafo de texto.</p> </body>
</html>