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
@DevPicon
DevPicon / MainActivity.java
Created November 14, 2015 15:51
Observemos estos tres activities, en un primer momento solo los dos primeros comparten la misma clase padre y cuentan con elementos comunes dentro de su función onCreate()
public class MainActivity extends AppCompatActivity implements PlaceListFragment.Callback {
private boolean mTwoPane = false;
private String LOG_TAG = MainActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (findViewById(R.id.place_detail_container) != null) {
@DevPicon
DevPicon / notas.txt
Created November 14, 2015 21:06
Como configurar la variable ANDROID_HVPROTO
En Windows
Pulsar en Mi PC (o pulsar Windows + Pausa) > Configuraciones Avanzadas de Sistema > Variables de Entorno.
Pulsar en Nuevo.
Como nombre de la variable, escribir: ANDROID_HVPROTO
Como valor valor del campo, escribir: ddm
Pulsar Aceptar
En Mac
@DevPicon
DevPicon / PressMenuItem.java
Created November 15, 2015 06:27
Un ejemplo de cómo testear un item del menu
@Test
public void testActionButtonSettings() {
// Con esta función abrimos el popup menu
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());
// Buscamos el elemento que contenga la cadena que buscamos,
// verificamos el tipo de componente raíz y pulsamos
onData(
hasToString(is(
activityTestRule.getActivity().getString(R.string.action_settings)
@DevPicon
DevPicon / activity_main_2.xml
Created January 20, 2016 05:18
Una pantalla usando LinearLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="200dp"
var CUSTOMER_ID = 2;
var SOURCE_TEMPLATE = "1YsSNl__rJon39zDyEnrmfJezc7JdAtAPPCPWj9iZGXo";
var CUSTOMER_SPREADSHEET = "1X7WDMsqHotSTnobp57wiw4_I7Zcn6RdvOhBVpUX85-M";
var TARGET_FOLDER = "0ByGfFMPl-WggaGw5ejFFTGgxajg";
function getRowAsArray(sheet, row, numRows) {
var dataRange = sheet.getRange(row, 1, numRows, 99);
var data = dataRange.getValues();
var columns = [];
@DevPicon
DevPicon / addAnimations.vb
Last active February 18, 2016 16:33
Code to apply some customizations to Powepoint objects
Sub configure_animations()
Dim oshp As Shape
Dim osld As Slide
Set oshp = ActiveWindow.Selection.ShapeRange(1)
Set osld = Application.ActiveWindow.View.Slide
' Add entering effect to shape oshp
osld.TimeLine.MainSequence.AddEffect oshp, msoAnimEffectFade, , msoAnimTriggerOnPageClick
' Apply the same effect but set Exiting flag on TRUE
@DevPicon
DevPicon / build.gradle
Created April 9, 2016 18:07
El archivo gradle tras la ejecución del plugin
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "pe.androidperu.kotlinproyectobase"
minSdkVersion 19
@DevPicon
DevPicon / activity_main.xml
Last active June 17, 2016 04:38
Ejemplo de Android + Firebase 101
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".activities.MainActivity">
package com.devpicon.android.firebasesamples.activities;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
@DevPicon
DevPicon / activity_main2.xml
Created June 25, 2016 15:47
Ejemplo de Android + Firebase parte 2
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".activities.Main2Activity">