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
# refrence from https://stackoverflow.com/questions/76439814/android-using-new-version-catalog-to-add-local-modules | |
# settings.gradle | |
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") | |
rootProject.name = "MyApplication" | |
include(":app") | |
include(":library_module") | |
# build.gradle of project where you add |
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
// https://medium.com/@mirzahssn/create-aar-file-in-android-e1ff009ba899 | |
To create AAR | |
you need to Rebuild Project using android studio OR | |
just type command in terminal | |
./gradlew build | |
./gradlew assemble |
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
// Original Thread | |
// https://medium.com/@simon.gerges/solving-android-multiple-clicks-problem-kotlin-b99c06135da0 | |
import android.os.SystemClock | |
import android.view.View | |
fun View.setSafeOnClickListener(onSafeClick: (View) -> Unit) { | |
val safeClickListener = SafeClickListener { | |
onSafeClick(it) |
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
https://stackoverflow.com/a/77778973/829034 | |
Preferences | |
--> search for kotlin compiler | |
--> update kotlin compiler version to desired versoin | |
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
android { | |
buildFeatures { | |
buildConfig true | |
} | |
} |
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
private fun getAdsId() { | |
CoroutineScope(Dispatchers.IO).launch { | |
var idInfo: AdvertisingIdClient.Info? = null | |
try { | |
idInfo = AdvertisingIdClient.getAdvertisingIdInfo(applicationContext) | |
} catch (e: GooglePlayServicesNotAvailableException) { | |
e.printStackTrace() | |
} catch (e: GooglePlayServicesRepairableException) { | |
e.printStackTrace() |
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
// https://stackoverflow.com/questions/66280961/contentresolver-query-method-throws-invalid-token-limit-error | |
// https://stackoverflow.com/questions/58601599/illegalargumentexception-invalid-column-distinct-bucket-display-name | |
// https://stackoverflow.com/questions/10390577/limiting-number-of-rows-in-a-contentresolver-query-function | |
// https://code.luasoftware.com/tutorials/android/android-find-albums-in-photo-gallery | |
// Cursor with limit call | |
import android.content.ContentResolver | |
import android.content.ContentUris |
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
// Remove font/typeface padding from drawn text in canvas | |
Paint.FontMetricsInt fontMetricsInt = new Paint.FontMetricsInt(); | |
textPaint.getFontMetricsInt(fontMetricsInt); | |
canvas.translate(0, fontMetricsInt.top - fontMetricsInt.ascent); |
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
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader | |
== Shell |
NewerOlder