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
@yanqiw
yanqiw / react-native-router-flux-android-back-button.js
Created July 15, 2016 09:31
react-native-router-flux, handle android back button event.
import { BackAndroid } from 'react-native';
import {Reducer} from 'react-native-router-flux';
backButtonPressedOnceToExit = false;
let currentSceneName = null;
const reducerCreate = params=>{
const defaultReducer = Reducer(params);
return (state, action)=>{
console.info("reducerCreate.{state,action}", state, action);
@tatocaster
tatocaster / RealPathUtil.java
Last active December 23, 2024 10:34
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {
@granoeste
granoeste / EachDirectoryPath.md
Last active October 9, 2025 11:36
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories