Skip to content

Instantly share code, notes, and snippets.

View abhishekgargx's full-sized avatar
🏠
Working from home

Abhishek Garg abhishekgargx

🏠
Working from home
View GitHub Profile
@abhishekgargx
abhishekgargx / AndroidManifest.xml
Last active October 22, 2020 08:43
Android Push Notification using Firebase Cloud Messaging ( FCM ) , works in Foreground , background , app killed, dead. includes Notification Actions - Abhishek Garg
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
@abhishekgargx
abhishekgargx / react-native-router-flux-android-back-button-fix.js
Last active January 28, 2019 10:32
React Native | react-native-router-flux | Redux | Android Back button listener ,handle back press on android while using react native.
// below code works with Android + react native + react-native-router-flux
// this is final index.js file code from where control whole app navigation
import { BackHandler, ToastAndroid } from 'react-native';
import React,{Component} from 'react';
import { Router, Scene, Actions } from 'react-native-router-flux';
import { Provider } from 'react-redux';
// as per your compoenents import them accordingly
import Home from './home';
import OtherScreen from './OtherScreen';
//variable
@abhishekgargx
abhishekgargx / .bablerc
Last active January 15, 2019 09:51
React native package.json with redux, react , rnrf , axois and react-navigation. - works and tested for Android , latest react native version 0.55.4
{
"presets": ["react-native"]
}
@abhishekgargx
abhishekgargx / KeystoreAndroid.java
Last active July 9, 2018 05:48
[Android] How to use Keystore in Android, Easily use keystore using only two methods Encrypted and Decrypted , MIN API level 18
package com.your.package.name;
import android.content.Context;
import android.security.KeyPairGeneratorSpec;
import android.util.Base64;
import com.pint.app.preferences.InitManager;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.security.KeyPair;
@abhishekgargx
abhishekgargx / FileManagerAndroid.java
Last active July 9, 2018 05:50
[Android] How to get files in android according to file types or using its extension from internal or external storage.
package com.your.package.name;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;