This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ConnectivityHelper { | |
public static boolean isConnectedToNetwork(Context context) { | |
ConnectivityManager connectivityManager = | |
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
boolean isConnected = false; | |
if (connectivityManager != null) { | |
NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo(); | |
isConnected = (activeNetwork != null) && (activeNetwork.isConnectedOrConnecting()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
public void rateApp(View rateMeButton) { | |
String packageName = this.getPackageName(); | |
String playStoreAppUri = "market://details?id=" + packageName; | |
String playStoreSiteUri = "https://play.google.com/store/apps/details?id=" + packageName; | |
try { | |
Intent playStoreAppIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreAppUri)); | |
startActivity(playStoreAppIntent); | |
} catch (ActivityNotFoundException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Kotlin | |
public fun rateApp(rateMeButton: View): Unit { | |
val packageName = this.packageName | |
val playStoreAppUri = "market://details?id=$packageName" | |
val playStoreSiteUri = "https://play.google.com/store/apps/details?id=$packageName" | |
try { | |
val playStoreAppIntent = Intent(Intent.ACTION_VIEW, Uri.parse(playStoreAppUri)) | |
startActivity(playStoreAppIntent) | |
} catch (e: ActivityNotFoundException) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
import sys | |
import re | |
import shutil | |
from git import Repo | |
from zipfile import ZipFile | |
def create_backup_zip(directory_to_backup): |