Skip to content

Instantly share code, notes, and snippets.

Elcio Abrahão elcioabrahao

Block or report user

Report or block elcioabrahao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ElapsedTimeIdlingResource.java
package br.com.trainning.pdv_2016;
import android.support.test.espresso.IdlingResource;
/**
* Created by elcio on 27/03/16.
*/
public class ElapsedTimeIdlingResource implements IdlingResource {
private final long startTime;
private final long waitingTime;
View EspressoTest.java
package br.com.trainning.pdv_2016;
/**
* Created by elcio on 27/03/16.
*/
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.IdlingPolicies;
import android.support.test.espresso.IdlingResource;
View MysqlConnect.java
import com.mysql.jdbc.Connection;
import java.sql.*;
import java.sql.DriverManager;
/**
* @desc A singleton database access class for MySQL
* @author Ramindu
*/
public final class MysqlConnect {
public Connection conn;
private Statement statement;
View list_item.xml
<?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="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="8dp">
<TextView
android:id="@+id/item_label"
@elcioabrahao
elcioabrahao / Exemplo.java
Created Mar 12, 2016
Exemplo de código para solicitar permissões no Android M (6.0 Marchmellow)
View Exemplo.java
// Exemplo de chamada:
requestPermissions();
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
switch (requestCode){
case REQUEST_CODE_PERMISSION:
if(grantResults[0] == PackageManager.PERMISSION_GRANTED){
@elcioabrahao
elcioabrahao / MainActiity.java
Created Dec 8, 2015
MainActivity do projeto PDV com a implementação do código para leitura do REST com a APIClient.java
View MainActiity.java
package br.com.trainning.pdv.ui.activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
@elcioabrahao
elcioabrahao / APIClient.java
Created Dec 8, 2015
Classe que implementa interface de serviço para o RETROFIT
View APIClient.java
package br.com.trainning.pdv.domain.network;
import java.util.List;
import br.com.trainning.pdv.domain.model.ListaProdutos;
import br.com.trainning.pdv.domain.model.Produto;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
import retrofit.http.Field;
@elcioabrahao
elcioabrahao / Base64Util.java
Created Nov 27, 2015
Classe utilitária para conversão de imagem bitmap em base 64 e vice versa.
View Base64Util.java
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayOutputStream;
/**
* Created by elcio on 27/11/15.
*/
View CLog.java
import android.util.Log;
/**
* Custom Log - A Facede for Android orignal Log class
* Created by elcio on 14/05/15.
*/
public class CLog {
private static final boolean DEBUG = BuildConfig.BUILD_TYPE.equalsIgnoreCase("debug");
private static String TAG = "YOUR_PROJECT_NAME";
You can’t perform that action at this time.