Skip to content

Instantly share code, notes, and snippets.

View iniyan455's full-sized avatar
🎯
Focusing

Iniyan Murugavel iniyan455

🎯
Focusing
View GitHub Profile
@iniyan455
iniyan455 / gist:e03e98955a41b4847d1ed5e9252ed5cf
Created January 8, 2018 05:20
Network checking call in android
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
ConnectivityReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
@iniyan455
iniyan455 / Node upload
Last active November 7, 2018 13:04
Node upload
upload image folder and save path in db:
________________________________________
//add_contestNew
app.post("/add_contestNew", function (req, res) {
var contest_name = req.query.contest_name;
var date = req.query.date;
var domain = req.query.domain;
var duration = req.query.duration;
@iniyan455
iniyan455 / gist:761efc0c64600e8bc7a9a20cbe0b089c
Created April 11, 2019 10:03
Facebook Hashkey Generation in Java code
public void getHashkey() {
try {
PackageInfo info = getPackageManager().getPackageInfo(getApplicationContext().getPackageName(), PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.i("Base64", Base64.encodeToString(md.digest(), Base64.NO_WRAP));
}
} catch (PackageManager.NameNotFoundException e) {
package Adapter;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
@iniyan455
iniyan455 / Check External Memory Card Available check
Created October 25, 2019 08:33
You can below condition to check whether SDCard is available or not
http://www.androiddeft.com/android-storing-and-accessing-file-from-external-storage-tutorial/
if (android.os.Environment.getExternalStorageState().equals(
android.os.Environment.MEDIA_MOUNTED)) {
//Check for the file
File appFolder = new File(Environment.getExternalStorageDirectory() + File.separator
+ context.getString(R.string.app_name));
boolean exist = appFolder.exists();
push the code
git branch
git checkout branchname
git status
git log -n1
git add class name
git commit
git push origin HEAD:refs/for/q-common
// Need to know about exclude
exclude group:"com.squareup.retrofit2" , module :"retrofit"
exclude group:"com.squareup.retrofit2" , module :"converter-gson"
// Library Creation
https://jitpack.io/com/github/iniyan455/MyTestLibrary/0.1.0/build.log
//Deeplinking
https://github.com/hamidsn/deferred-deeplink/tree/master/app/src/main/java/sample/deeplinking/deferred/receiver
// Need to know about exclude
exclude group:"com.squareup.retrofit2" , module :"retrofit"
exclude group:"com.squareup.retrofit2" , module :"converter-gson"
// Library Creation
https://jitpack.io/com/github/iniyan455/MyTestLibrary/0.1.0/build.log
//Deeplinking
https://github.com/hamidsn/deferred-deeplink/tree/master/app/src/main/java/sample/deeplinking/deferred/receiver
@iniyan455
iniyan455 / Linux & shell adb commands
Last active May 16, 2020 12:18
Linux command and Shell Useful command for android & SSH Key Generation
// Connect device with android studio using usb mode
Connect your phone to your desktop with usb.
make sure your desktop have the adb utility and a suitable driver for your phone is installed.
adb start-server ; adb devices
##make sure device is connected.
adb shell pm list packages|grep -i "keyword"
@iniyan455
iniyan455 / git ignore
Created May 16, 2020 12:12
Proguard rules gitignore
git ignore file
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex