SCHLIESSEN
SCHLIESSEN




Thu 09.07.2020 14:59 von Jeremy

Tipps & Tricks for Android Development #1

 

Enable DOM storage for web views

web_view.settings.domStorageEnabled = true

Avoid firebase version conflicts with the firebase bill of materials

implementation platform('com.google.firebase:firebase-bom:24.6.0')

implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'

Source: https://firebase.google.com/docs/android/setup#firebase-bom

Restart an app without causing a crash notification

val intent = packageManager.getLaunchIntentForPackage(packageName)
finishAffinity()
startActivity(intent)
exitProcess(0)

Enable TLS 1.2 on Android 4

ProviderInstaller.installIfNeeded(context)

Source: https://developer.android.com/training/articles/security-gms-provider

Find the cause of dependency mismatches by creating a dependency tree

./gradlew app:dependencies > tree.txt

Show the "real" share sheet by createing a chooser intent

val intent = Intent(Intent.ACTION_SEND)
intent.putExtra(Intent.EXTRA_TEXT, content)
intent.type = "text/plain"

startActivity(Intent.createChooser(intent, title))

Source: https://developer.android.com/reference/android/content/Intent#createChooser(android.content.Intent,%20java.lang.CharSequence)

Access the google play console and firebase using any language you like

This is particularly useful if you are using someone elses account. Just add the query parameter `hl`. For example: `hl=en`.