Skip to content

Instantly share code, notes, and snippets.

View gpetuhov's full-sized avatar
💭
Working on a project

Gennadiy Petuhov gpetuhov

💭
Working on a project
View GitHub Profile
@gpetuhov
gpetuhov / test_real_devices.txt
Created December 23, 2019 06:56
Test on real devices
Test on real devices
https://www.browserstack.com/app-live
@gpetuhov
gpetuhov / android_phone_number.txt
Last active December 6, 2019 07:45
Android International Phone Number
Android International Phone Number
https://github.com/google/libphonenumber
https://github.com/MichaelRocks/libphonenumber-android
https://github.com/joielechong/CountryCodePicker
https://github.com/AlmogBaku/IntlPhoneInput
https://github.com/hbb20/CountryCodePickerProject
@gpetuhov
gpetuhov / textview_hyperlinks.txt
Last active November 22, 2019 11:16
Android Hyperlinks in TextView
@gpetuhov
gpetuhov / office_analog.txt
Created October 23, 2019 14:32
Office analog for Linux
Office analog for Linux
https://www.wps.com/ru-RU/
@gpetuhov
gpetuhov / android_plurals.txt
Created October 7, 2019 15:21
Android Plurals
Android Plurals
https://developer.android.com/guide/topics/resources/string-resource.html#Plurals
http://developer.alexanderklimov.ru/android/theory/plurals.php
@gpetuhov
gpetuhov / retrofit_download_image.kt
Created September 19, 2019 15:19
Retrofit download image
// Retrofit upload selected image
// https://futurestud.io/tutorials/retrofit-2-how-to-download-files-from-server
// https://viblo.asia/p/android-kotlin-retrofit-2-download-file-63vKjapx52R
// === Retrofit service ===
interface MediaService {
@Streaming
@GET
suspend fun downloadImage(@Url fileUrl: String): ResponseBody
@gpetuhov
gpetuhov / saveToGallery.kt
Created September 19, 2019 13:38
Android save image into gallery
// Android save image into gallery
private fun saveImage(image: File) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
saveImageWithMediaStore(image)
} else {
saveImageDirectly(image)
}
}
@gpetuhov
gpetuhov / retrofit_upload_image.kt
Last active June 22, 2021 19:23
Retrofit upload selected image
// Retrofit upload selected image
// https://futurestud.io/tutorials/retrofit-2-how-to-upload-files-to-server
// === Retrofit service ===
interface MediaService {
@Multipart
@POST("url")
suspend fun upload(
@Part("description") description: RequestBody,
@gpetuhov
gpetuhov / date_inside_message_list.txt
Last active September 11, 2019 10:25
Android RecyclerView show date inside message list
Android RecyclerView show date inside message list
https://stackoverflow.com/questions/32867823/how-to-show-date-in-between-conversation-in-recyclerview-or-in-listview/44843070
https://stackoverflow.com/questions/33226491/how-do-i-display-the-calendar-date-on-the-top-of-chat-messages/33276868
@gpetuhov
gpetuhov / ubuntu_inotify_limit.txt
Created August 30, 2019 05:56
Ubuntu increase inotify limit
Ubuntu increase inotify limit
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
cat /proc/sys/fs/inotify/max_user_watches
(default is 8192)
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p