Skip to content

Instantly share code, notes, and snippets.

View DevPicon's full-sized avatar
🎯
Looking for new ways to improve my job

Armando Picón DevPicon

🎯
Looking for new ways to improve my job
View GitHub Profile
package com.devpicon.android.firebasesamples.activities;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@DevPicon
DevPicon / Main3Activity.java
Created June 29, 2016 22:24
Ejemplo de Android + Firebase Authentication
package com.devpicon.android.firebasesamples.activities;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
import com.devpicon.android.firebasesamples.R;
import com.firebase.ui.auth.AuthUI;
import com.google.firebase.auth.FirebaseAuth;
@DevPicon
DevPicon / Android_Certification.md
Created October 2, 2016 18:10 — forked from codejat/Android_Certification.md
Como obtener la certificación Associate Android Developer

Java for Android Technet

Taller: Como obtener la certificación Associate Android Developer

Organizadores: Juan Tomaylla y Juan Handal

Sesión 1

Links de Interes

fun ImageView.loadImage(url: String?){
if(url != null){
Glide.with(this.context)
.load(url)
.fitCenter()
.into(this)
}
}
myImageView.loadImage(“!insert an url here!”)
@DevPicon
DevPicon / Event.kt
Created March 9, 2017 18:59
This gist shows you how to implement Parcelable on Kotlin classes
import android.os.Parcel
import android.os.Parcelable
/**
* Created by armando on 3/9/17.
*/
data class Event(val id: Int, val name: String, val type: String, val venue: Venue? = null ) : Parcelable {
companion object {
@JvmField val CREATOR: Parcelable.Creator<Event> = object : Parcelable.Creator<Event>{
@DevPicon
DevPicon / README-Template.md
Created March 28, 2017 04:04 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@DevPicon
DevPicon / apply.kt
Created May 20, 2017 16:21
Algunos ejemplos de como usar Kotlin de una mejor manera
fun getDataSource(): MysqlDataSource {
val fileInputStream = FileInputStream("myfile.properties")
val properties = Properties()
properties.load(fileInputStream)
val mySqlDataSource = MysqlDataSource()?.apply {
setURL(properties.getProperty("MYSQL_DB_URL"))
user = properties.getProperty("MYSQL_DB_USERNAME")
setPassword(properties.getProperty("MYSQL_DB_PASSWORD"))
@DevPicon
DevPicon / build.gradle
Created July 16, 2017 17:28
Just another build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "pe.devpicon.android.myoxxorequestapp"
minSdkVersion 21
@DevPicon
DevPicon / androidSreenUtils.java
Created January 26, 2018 19:16
Some util methods to work with screen density and screenlayout
private boolean hasSmallDensity() {
int densityDpi = getResources().getDisplayMetrics().densityDpi;
if (densityDpi < DisplayMetrics.DENSITY_MEDIUM) {
return true;
}
return false;
}
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
public class ParseMockJson {
public static String readFromfile(String filename) {
StringBuilder returnString = new StringBuilder();