Skip to content

Instantly share code, notes, and snippets.

Jaison Fernando jaisonfdo

Block or report user

Report or block jaisonfdo

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
@jaisonfdo
jaisonfdo / FaceDetection.java
Last active Nov 29, 2018
MLKit face detection demo explanation code snippet
View FaceDetection.java
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="face" />
// To initialise the detector
@jaisonfdo
jaisonfdo / BarCodeScannerDemo.java
Last active Nov 9, 2018
MlKit demo sample code snippets
View BarCodeScannerDemo.java
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="barcode" />
// To initialise the detector
@jaisonfdo
jaisonfdo / APIHelper.java
Last active Oct 21, 2018
DemoAppsSampleCode
View APIHelper.java
// Make HTTP Calls
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
// Used to convert Java Objects into their JSON
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
public class UserDetails {
private Details details;
@jaisonfdo
jaisonfdo / RemoteConfigDemo.java
Created Oct 20, 2018
FirebaseRemoteConfig Code snippet
View RemoteConfigDemo.java
// To get the version code from the auto generated file
final int versionCode = BuildConfig.VERSION_CODE;
// Hashmap which contains the default values for all the parameter defined in the remote config server
final HashMap<String, Object> defaultMap = new HashMap<>();
defaultMap.put(FB_RC_KEY_TITLE, "Update Available");
defaultMap.put(FB_RC_KEY_DESCRIPTION, "A new version of the application is available please click below to update the latest version.");
defaultMap.put(FB_RC_KEY_FORCE_UPDATE_VERSION, ""+versionCode);
defaultMap.put(FB_RC_KEY_LATEST_VERSION, ""+versionCode);
@jaisonfdo
jaisonfdo / MainActivity.java
Created May 30, 2017
This gist is used to implement Chrome Custom Tab in your Android app. For further details :
View MainActivity.java
package com.droidmentor.chromecustomtab;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AppCompatActivity;
@jaisonfdo
jaisonfdo / AndroidManifest.xml
Last active Sep 16, 2018
This gist is used to create an implement launcher screen in Android app. For further details : http://droidmentor.com/create-launch-screen/
View AndroidManifest.xml
<activity
android:name=".SplashActivity"
android:theme="@style/splash_theme"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
View bintray.gradle
apply plugin: 'com.jfrog.bintray'
version = libraryVersion
if (project.hasProperty("android")) { // Android libraries
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
@jaisonfdo
jaisonfdo / MixPanelHelper.java
Created Nov 9, 2016
Track events with Mixpanel in Android.For more information, check out my detailed guide here : http://droidmentor.com/track-events-mixpanel-android/
View MixPanelHelper.java
import android.content.Context;
import android.util.Log;
import com.mixpanel.android.mpmetrics.MixpanelAPI;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@jaisonfdo
jaisonfdo / SocialConnection.java
Last active Jan 18, 2019
Connect social media account in a single line of code in Android.For more information, check out my detailed guide here : http://droidmentor.com/connect-social-media-account/
View SocialConnection.java
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.widget.Toast;
/**
@jaisonfdo
jaisonfdo / AlertDialogHelper1.java
Last active Feb 12, 2018
It is the utility class contains set of utility methods to show dialogs and returns their clicks using callback methods.For more information, check out my detailed guide here : http://droidmentor.com/show_alertdialog_android/
View AlertDialogHelper1.java
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Looper;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
/**
You can’t perform that action at this time.