Skip to content

Instantly share code, notes, and snippets.

View kevalpatel2106's full-sized avatar
🚧

Keval Patel kevalpatel2106

🚧
View GitHub Profile
@kevalpatel2106
kevalpatel2106 / MainActivity.java
Created November 5, 2016 04:47
Medium- Prevent Screen Off
public void onScreenMonitoringStart() {
//This callback will receive when eye tracking algorithm is intilized.
}
@Override
public void onScreenMonitoringStop() {
//This callback will receive when eye tracking algorithm is stopped.
}
@Override
@kevalpatel2106
kevalpatel2106 / .travis.yml
Last active November 18, 2016 11:29
Medium Travis
language: android
jdk: oraclejdk8
sudo: false
notifications: #Optional
email:
- [email protected] #Add your email address
env:
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a
global: #Optional
- ADB_INSTALL_TIMEOUT=10 #Time out to 10 mins
android:
update_sdk: true #Check for the updates each time you run the build.
components:
- platform-tools
- tools
- build-tools-25.0.0 #Build tool version
- android-25 #targate api version
# Additional components
- extra-google-google_play_services
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories: #Cache all dirs under .gradle folder
- $HOME/.gradle/daemon #Cache daemon logs
- $HOME/.gradle/native #Cache library downloaded from the gradle dependency
- $HOME/.gradle/wrapper #Cache the gradle
before_script:
- chmod +x gradlew #Grant permissions
- android list targets
- echo no | android create avd --force --name test --target $ANDROID_TARGET --abi $ANDROID_ABI #Create AVD for given api
- emulator -avd test -no-skin -no-audio -no-window & #Start emulator
script:
- echo "Travis branch is $TRAVIS_BRANCH" #Print out which branch it is.
- echo "Travis branch is in pull request $TRAVIS_PULL+REQUEST" #Print out pull request number.
- android-wait-for-emulator #Run wait for the emulator script.
before_install:
- pip install --user codecov #Install codecov
after_success:
- codecov #Run codecov
language: android
jdk: oraclejdk8
sudo: false
notifications:
email:
- [email protected]
env:
matrix:
// UNIVERSAL IMAGE LOADER SETUP
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheOnDisc(true).cacheInMemory(true)
.imageScaleType(ImageScaleType.EXACTLY)
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext())
.defaultDisplayImageOptions(defaultOptions)
.memoryCache(new WeakMemoryCache())
/**
* This class is singleton class for the volley initialization.
* It will initialize volley request queue.
*/
public class VolleySingleton {
private static VolleySingleton instance;
private RequestQueue mRequestQueue;
/**
* Custom request queue.