I am a brand new Android developer. I have just finished my first app using
Android Studio. It is a very simple app that displays a special clock
created in JavaScript. I used WebView to load and display the HTML/CSS/JS
assets. I learned pretty much all of this on YouTube.
Everything runs fine on emulators and on my personal device. However when I
submitted the app bundle to the Play Store the Pre-launch review indicated
that there was a "Cold start time" for the "Nokia Nokia 1". The biggest
issue is "Slow Frames" at 42.46%.
I read on a help doc that the most common way to fix Cold start times is to
optimize the use of onCreate(). My app is super simple can anyone provide
some insight into how to best optimize the below MainActivity.kt?
package com.clock.ustimezoneclock
import android.os.Bundle
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
import com.clock.ustimezoneclock.R
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val myWebView: WebView = findViewById(R.id.webview)
myWebView.getSettings().setJavaScriptEnabled(true)
myWebView.loadUrl("file:///android_asset/index.html")
}
}
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/1c7fa1f8-399e-443a-9dbc-597785b7c6b3n%40googlegroups.com.