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 / 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");
@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 / 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 / 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 / introrx.md
Created August 13, 2016 06:48 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
/*
* 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