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
#Dagger2 Links | |
https://github.com/google/dagger | |
#installers | |
def dagger_version = 2.29 | |
api "com.google.dagger:dagger:$dagger_version" | |
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" | |
api "com.google.dagger:dagger-android:$dagger_version" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<network-security-config> | |
<base-config cleartextTrafficPermitted="true" /> | |
</network-security-config> |
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
//bindings | |
implementation 'com.jakewharton:butterknife:10.2.1' | |
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' | |
//checking internet connection | |
implementation 'com.novoda:merlin:1.2.0' | |
//re design logger | |
implementation 'com.orhanobut:logger:2.2.0' | |
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
import tensorflow as tf | |
#store .h5 file in your .py folder | |
#load h5 module | |
model=tf.keras.models.load_model('sample_file.h5') | |
tflite_converter = tf.lite.TFLiteConverter.from_keras_model(model) | |
#convert | |
tflite_model = tflite_converter.convert() | |
open("tf_lite_model.tflite", "wb").write(tflite_model) |
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
import Foundation | |
extension Array{ | |
func gridData(into size: Int)->[[Element]]{ | |
return stride(from: 0, to: count, by: size).map{ | |
Array(self[$0 ..< Swift.min($0 + size, count)]) | |
} | |
} | |
} |
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 CommonFileManagement(){ | |
//delete folder in android | |
public static void deleteFolderWithContent(String dirName){ | |
File dir = new File(Environment.getExternalStorageDirectory().toString() + "/"+dirName); | |
if (dir.isDirectory()) | |
{ | |
String[] children = dir.list(); | |
for (int i = 0; i < children.length; i++) | |
{ | |
new File(dir, children[i]).delete(); |
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
//for greater than android O | |
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ | |
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT); | |
channel.setDescription(CHANNEL_DESC); | |
NotificationManager manager = getSystemService(NotificationManager.class); | |
manager.createNotificationChannel(channel); | |
} | |
// to make notification details | |
NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this,CHANNEL_ID) | |
.setSmallIcon(R.drawable.ic_notifications) |