Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Eduardo José Medina Alfaro emedinaa

🏠
Working from home
View GitHub Profile
View gist:052589e92c14d8773e407f0506ed30ec
class MainActivity : AppCompatActivity() {
private val html = "<html><ul>Message".plus(
"<li> Prueba 1</li>"
).plus(
"<li> Prueba 2</li>"
).plus(
"<li> Prueba 3</li>"
).plus(
"</ul></html>"
)
View gist:c8e015bffe94d5cc98dc54dc6d545bec
edmedina@BLX-PE-edmedina-2 AppDemo % ./gradlew tasks
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------
Android tasks
View Load file from RAW
package com.emedinaa.rawdemo
import android.net.Uri
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import java.io.*
class MainActivity : AppCompatActivity() {
View onBindViewHolder
@Override
public void onBindViewHolder(@NonNull RecyclerAdapter.CharacterViewHolder holder, int position) {
Character character = characterList.get(position);
holder.tvName.setText(character.getName());
holder.tvHouse.setText(character.getHouse());
holder.tvPatronous.setText(character.getPatronus());
holder.tvSpecies.setText(character.getBloodStatus());
holder.tvSpecies.setText(character.getSpecies());
View gist:aa3b68bd3580c588e09f289f789bbb3d
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier = 'sources'
}
artifacts {
archives sourcesJar
}
View gist:5c6fa5cbe3207a8fd892e88d51d4ebe0
Android developers resources
Getting started in Android development
Android developers
- official website https://developer.android.com/
- Codelabs https://codelabs.developers.google.com/
- Youtube https://www.youtube.com/user/androiddevelopers
- Android developers Blog https://android-developers.googleblog.com/
View gist:4e3fa0baab7bbb20684b8476776ffc80
socketio='1.0.0'//‘io.socket:socket.io-client:1.0.0' https://mvnrepository.com/artifact/io.socket/socket.io-client/1.0.0
implementation "io.socket:socket.io-client:$rootProject.socketio"
package com.emedinaa.kotlinapp.data.socket
import io.socket.client.Ack
import io.socket.emitter.Emitter
import androidx.annotation.Nullable
import io.socket.client.IO
View gist:11757b3a81c037e4628539ea9568cf1e
//build.gradle
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
google()
jcenter()
}
dependencies {
View gist:af253771b223aa2c29a2bd9568a4a90e
//all
private fun loadNotes(){
val notesQuery:Query = mDatabase.child("notes")
val options= FirebaseRecyclerOptions.Builder<NoteEntity>()
.setQuery(notesQuery,NoteEntity::class.java)
.build()
noteAdapter= NoteAdapter(options)
recyclerViewNotes.adapter= noteAdapter
View gist:e93180234bc86e5239bc86dee611ae8f
```
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import com.emedinaa.kotlinapp.R
import com.emedinaa.kotlinapp.fragments.AFragment
import com.emedinaa.kotlinapp.fragments.BFragment
import com.emedinaa.kotlinapp.fragments.CFragment
import kotlinx.android.synthetic.main.activity_bottom_navigation.*