Skip to content

Instantly share code, notes, and snippets.

Avatar

Andhie Wong andhie

View GitHub Profile
View activity_main.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
The FAB widget inflates a default style which is available in
/sdk/extras/android/support/design/res/values. As per Material Design
guidelines, the FAB elevation is 6dp instead of the preset 8dp value.
Other default FAB values are correct with respect to the specs.
@andhie
andhie / PermissionUtil.java
Last active Oct 23, 2017
Marshmallow Permission Level
View PermissionUtil.java
public static void printPermissions(Context context) {
PackageInfo android;
try {
android = context.getPackageManager().getPackageInfo("android", PackageManager.GET_PERMISSIONS);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return;
}
PermissionInfo[] permissions = android.permissions;
@andhie
andhie / FirebaseJobDispatcherService.java
Created Feb 1, 2018
Android Priority Job Queue for Firebase JobDispatcher
View FirebaseJobDispatcherService.java
package com.birbit.android.jobqueue.scheduling;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.birbit.android.jobqueue.JobManager;
import com.birbit.android.jobqueue.log.JqLog;
import com.firebase.jobdispatcher.JobParameters;
import com.firebase.jobdispatcher.JobService;