This file contains hidden or 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
package com.arindam.scheduler | |
import android.os.Handler | |
import android.os.Looper | |
import android.util.Log | |
import java.util.concurrent.CancellationException | |
import java.util.concurrent.CountDownLatch | |
import java.util.concurrent.ExecutionException | |
import java.util.concurrent.Executor | |
import java.util.concurrent.Executors |
This file contains hidden or 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
# Built application files | |
*.apk | |
*.aar | |
*.ap_ | |
*.aab | |
# Files for the ART/Dalvik VM | |
*.dex | |
# Java class files |
This file contains hidden or 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
// List Release Configuration Dependencies | |
tasks.create("dependency-size-all") { | |
configurations.each { | |
if (it.isCanBeResolved()) { | |
listConfigurationDependencies(it) | |
} | |
} | |
} |
This file contains hidden or 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
apply plugin: 'com.android.library' | |
android { | |
compileSdkVersion 28 | |
defaultConfig { | |
minSdkVersion 14 | |
targetSdkVersion 28 | |
versionCode 1 | |
versionName "1.0" |
This file contains hidden or 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
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> |
This file contains hidden or 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
/** | |
* Create ZIP file and returns the Uri for the zip file | |
* | |
* @param context Application Context | |
* @param files File Paths to be Zipped | |
* @param fileName ZIP File Name | |
* | |
* @return Uri for zip file | |
* @throws FileNotFoundException Throws if zip file cannot be found | |
*/ |
This file contains hidden or 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
/** | |
* Writes Json/Gson to a temporary file and returns the Uri for the File | |
* | |
* @param context Application Context | |
* @param any File Content | |
* @param fileName Json File Name | |
* | |
* @return Uri for temp file with json | |
* @throws FileNotFoundException Throws if json file cannot be found | |
*/ |
This file contains hidden or 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
/** | |
* Create a Notification that is shown as a heads-up notification if possible. | |
* | |
* For this project, this is used to show a notification so that you know when different steps | |
* of the background work chain are starting | |
* | |
* @param message Message shown on the notification | |
* @param context Context needed to create Toast | |
* |
This file contains hidden or 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
internal fun getIpAddress(useIPv4: Boolean = true): String { | |
try { | |
val interfaces = Collections.list(getNetworkInterfaces()) | |
for (network in interfaces) { | |
val addresses = Collections.list(network.inetAddresses) | |
for (address in addresses) { | |
if (!address.isLoopbackAddress) { | |
val sAddress = address.hostAddress | |
var isIPv4: Boolean | |
isIPv4 = sAddress.indexOf(':') < 0 |
This file contains hidden or 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
// Copyright (c) 2016 boyw165 | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |