This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check whether Google Play Services are available. | |
* | |
* If not, then display dialog allowing user to update Google Play Services | |
* | |
* @return true if available, or false if not | |
*/ | |
private boolean checkGooglePlayServicesAvailable() | |
{ | |
final int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE module PUBLIC | |
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
<!-- This is a checkstyle configuration file. For descriptions of | |
what the following rules do, please see the checkstyle configuration | |
page at http://checkstyle.sourceforge.net/config.html --> | |
<module name="Checker"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: pratamawijaya/gitlab-ci-android | |
stages: | |
- check | |
- build | |
- deploy | |
before_script: | |
- export GRADLE_USER_HOME=/cache/.gradle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.Manifest; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.location.Location; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v4.content.ContextCompat; | |
import com.google.android.gms.common.ConnectionResult; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nl.remcomokveld.firebaseloaders; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.v4.content.Loader; | |
import com.google.firebase.database.DataSnapshot; | |
import com.google.firebase.database.DatabaseError; | |
import com.google.firebase.database.DatabaseReference; | |
import com.google.firebase.database.ValueEventListener; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setColor(TextView view, String fulltext, String subtext, int color) { | |
view.setText(fulltext, TextView.BufferType.SPANNABLE); | |
Spannable str = (Spannable) view.getText(); | |
int i = fulltext.indexOf(subtext); | |
str.setSpan(new ForegroundColorSpan(color), i, i + subtext.length(), | |
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.pm.PackageInfo; | |
import android.content.pm.PackageManager; | |
import android.content.pm.PackageManager.NameNotFoundException; | |
import android.content.pm.Signature; | |
public class TamperCheck { | |
//we store the hash of the signture for a little more protection | |
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<templateSet group="AndroidLog"> | |
<template name="time" value="Timber.e("$METHOD_NAME$() : $content$ %s",$exception$);" description="Timber.e(Method,Exc)" toReformat="true" toShortenFQNames="true"> | |
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="exception" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="timd" value="Timber.d("$METHOD_NAME$() : $content$ %s",$exception$);" description="Timber.d(Method,exc)" toReformat="true" toShortenFQNames="true"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.2" | |
defaultConfig{ | |
minSdkVersion 14 | |
targetSdkVersion 21 | |
versionCode 101 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="#000" | |
tools:context="com.pratama.examplelayouting.MainActivity" | |
> | |
<LinearLayout |