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 java.io.BufferedReader; | |
import java.io.FileOutputStream; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.nio.channels.Channels; | |
import java.nio.channels.ReadableByteChannel; | |
public class sample { |
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
/** | |
* Utils which helps work with ip | |
* generate own ip | |
* convert ip to tiny url | |
* convert tiny url to ip | |
* change ip form | |
*/ | |
public class Utils { | |
// Key for encrypt && decrypt decimal ip to tiny url | |
static String key = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
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
from googletrans import Translator | |
from pathlib import Path | |
original_code = open(".../res/values/strings.xml", "r") | |
# locals ex. 'en', 'ru', 'es' | |
locals = open(".../locals.txt", "r") | |
translator = Translator() | |
code = '' | |
for line in original_code.readlines(): |
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
//Sealed class for showing result in progressBar, mainThread | |
sealed class DownloadResult { | |
object Success : DownloadResult() | |
data class Error(val message: String) : DownloadResult() | |
data class Progress(val progress: Int) : DownloadResult() | |
} |
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
/** | |
* Simple Bluetooth repository for android on kotlin | |
* | |
* @author Kirill Martyuk | |
* @version 1.0 | |
*/ | |
class BluetoothRepository(private val context: Context) { | |
/** | |
* Get current connected bluetooth devices |
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
set port=%1 | |
:: Change ip address, which you can see on your android phone in adb settings. Now using a simple ip | |
C:\Users\<UserName>\AppData\Local\Android\Sdk\platform-tools\adb.exe connect 192.168.0.3:%port% |
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
@Composable | |
fun SingleChoiceDialog( | |
title: String, | |
radioOptions: List<String>, | |
indexOfDefault: Int, | |
isDialogVisible: (Boolean) -> Unit, | |
setSelectedItem: (String) -> Unit | |
) { | |
val (selectedItemIndex, setSelectedItemIndex) = remember { | |
mutableStateOf(indexOfDefault) |
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
âPNG | |