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 / LoggerUtils.java
Created July 12, 2021 13:06
Android user data logger - log data in file and sent it via email or other app easily - works with android 11 as well
// Note : you must have storage permission before using this utility
// <uses-permission android:name="android.permission.READ_LOGS"
// tools:ignore="ProtectedPermissions" />
// <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
// <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
@abhishekgargx
abhishekgargx / intent.java
Created July 12, 2021 12:58
Convert intent to string Android
public static String convertIntentToString(Intent intent){
try{
if (intent == null || intent.getExtras() == null){
return null;
}
StringBuilder data = new StringBuilder();
data.append("#\n").append("intent : --->>").append(intent.toString());
Set<String> extraSet = intent.getExtras().keySet();
@abhishekgargx
abhishekgargx / AndroidManifest.xml
Created June 28, 2020 14:19 — forked from erkattak/AndroidManifest.xml
Android Application Setup for use with Charles Proxy
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
@abhishekgargx
abhishekgargx / Activate Office 2019 for macOS VoL.md
Created January 15, 2020 16:26 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@abhishekgargx
abhishekgargx / DividerItemDecoration.java
Created December 4, 2019 09:47 — forked from johnwatsondev/DividerItemDecoration.java
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@abhishekgargx
abhishekgargx / RecycleViewWithWrapContent.txt
Created August 20, 2019 10:05
How to use Recycle view with wrap content as height.
> ### **there are two ways i found working well for me. To make recycle view height behave as wrap content **
### **First way**
> Putting recycler view inside in the Nested Scroll view to acheive wrap content functionality
```
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@abhishekgargx
abhishekgargx / babel.rc
Last active November 19, 2019 21:41
Using React native 55.4 build.gradle patch for Android . FIX for duplicate resources found error in react native release or signing app.
{
"presets": ["react-native"]
}
@abhishekgargx
abhishekgargx / MyKeystore.java
Last active January 28, 2019 10:47
How to use Keystore in android for storing and getting sensitive data , minimum support sdk level 19.
package com.abhishek.softneed;
import android.content.Context;
import android.security.KeyPairGeneratorSpec;
import android.util.Base64;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@abhishekgargx
abhishekgargx / BackgroundManager.java
Created December 13, 2018 07:43
Color Blender for android , blend colors like instagram background
/*
* Copyright 2018 Abhishek Garg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@abhishekgargx
abhishekgargx / ScreenSizeHelpers.java
Created December 13, 2018 07:32
Android Mobile Screen Size Helper method
/*
* Copyright 2018 Abhishek Garg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software