Skip to content

Instantly share code, notes, and snippets.

View viktor1190's full-sized avatar

Victor J. Valencia Gómez viktor1190

  • Universidad Tecnológica de Pereira
View GitHub Profile
@viktor1190
viktor1190 / DigitaProductoPedidoActivity.java
Created September 1, 2015 21:43
Clase para digitar producto
package com.homeelementsweb.pedidosrecaudosmovilsantander.Controladores.Actividades.Pedido;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@viktor1190
viktor1190 / PedidosActivity.java
Created September 1, 2015 21:48
Pedido Activity
package com.homeelementsweb.pedidosrecaudosmovilsantander.Controladores.Actividades.Pedido;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@viktor1190
viktor1190 / introrx.md
Created August 13, 2016 06:48 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@viktor1190
viktor1190 / estructura_es.txt
Last active October 27, 2016 14:57
Es una simple estructura de comentarios que uso para mantener la legibilidad del codigo en mis proyectos, especialmente para android, la idea con esto es dividir el código en secciones donde puedas ubicar de manera fácil cada componente de la clase y al mismo tiempo mantener una homogeneidad
public class MiClase {
// =============================================================================================
// CONSTANTES
// =============================================================================================
public final String LOG_TAG = getClass().getSimpleName();
private static final int WINDOW_TITLE = R.string.windows_label_mi_clase;
public class MyAndroidFragment {
// =============================================================================================
// CONSTANTS
// =============================================================================================
public final String LOG_TAG = getClass().getSimpleName();
private static final int WINDOW_TITLE = R.string.windows_label_mi_clase;
private static final String BUNDLE_KEY_SOME_INT = "bk_some_int";
@viktor1190
viktor1190 / AssetDatabaseOpenHelper.java
Created January 3, 2017 13:45 — forked from wontondon/AssetDatabaseOpenHelper.java
Copy sqlite database from assets dir - Android
package com.javatarts.basketballgm.data;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
@viktor1190
viktor1190 / gist:526764e15efee9a1b9a193d861d66eb1
Created May 28, 2017 19:36 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@viktor1190
viktor1190 / AccountAuthenticator.java
Created June 29, 2017 13:23 — forked from burgalon/AccountAuthenticator.java
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
@viktor1190
viktor1190 / AllGattCharacteristics.java
Created June 9, 2021 17:17 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");