Skip to content

Instantly share code, notes, and snippets.

@eyal-lezmy
eyal-lezmy / build-hasDevicesPlugged.gradle
Last active February 18, 2016 14:40
Check connected devices before adding genymotion configuration
/**
This Gist shows how to check the presence of connected devices before applying another .gradle file.
It has been tested with Android Gradle Plugin from 1.2.0 to 1.5.0.
*/
apply plugin: 'com.android.application'
android {
Your app config...
}
@eyal-lezmy
eyal-lezmy / Android.mk
Last active February 14, 2017 12:30
Avoid adding Android Packages and apps to your AOSP build
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := \
android-common \
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
@eyal-lezmy
eyal-lezmy / TouchService.java
Last active August 29, 2015 14:04
Detect the touch on screen silently
package overlaytouch.eyal.fr.overlaytouch;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.IBinder;
import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;