and Kotlin • UI Screens are defined in XML • IDE Android Studio ( base on Intellij ) ◦ Android SDK ◦ Android Monitor • Terminal Commands (adb) • Apps run in a Virtual Marchine • Android Kernel is the Linex Kernel • Build tool is Gradle • App format = .apk
for Beginners and Android MicroDegree) • Android Arsenal ( Android developer portal with tools, libraries, and apps) • CodeLab: https://codelabs.developers.google.com/?cat=Android • Vocab : https://developers.google.com/android/for-all/vocab-words/
by JetBrains. 100% interoperable with Java A language that have Null Safety var b: String? = "abc" b = null // ok val l = b.length // error WHY? variable 'b' can be null var a: String = "abc" a = null // compilation error val l = a.length //ok
'applETS' or 'applETS.mobileapp' is null the function is not called: applETS?.mobileapp?.android = creationOfAndroidMobileApp() val a = "Kotlin" val b: String? = null println(b?.length) println(a?.length) Safe Call can be chains Elvis Operator, witten ?: val l = b?.length ?: -1 In Java int l = b != null ? b.length : -1
for the activity instance var gameState: String? = null override fun onCreate(savedInstanceState: Bundle?) { // call the super class onCreate to complete the creation of activity like // the view hierarchy super.onCreate(savedInstanceState) // recovering the instance state gameState = savedInstanceState?.getString(GAME_STATE_KEY) // set the user interface layout for this activity // the layout file is defined in the project res/layout/main_activity.xml file setContentView(R.layout.activity_main) }
state in onCreate(), while we can optionally restore // other state here, possibly usable after onStart() has completed. // The savedInstanceState Bundle is same as the one used in onCreate(). override fun onRestoreInstanceState(savedInstanceState: Bundle?) { textView.text = savedInstanceState?.getString(TEXT_VIEW_KEY) } // invoked when the activity may be temporarily destroyed (onStop), save the instance state here override fun onSaveInstanceState(outState: Bundle?) { outState?.run { putString(GAME_STATE_KEY, gameState) putString(TEXT_VIEW_KEY, textView.text.toString()) } // call superclass to save any view hierarchy super.onSaveInstanceState(outState) }