Day92 of #100DaysOfCode

Day92 of #100DaysOfCode

Unit 4: Internet

// Object declaration
object DataProviderManager {
fun registerDataProvider(provider: DataProvider) {
// ...
}

val allDataProviders: Collection<DataProvider>
get() = // ...
}
// To refer to the object, use its name directly.
DataProviderManager.registerDataProvider(...)
object MarsApi {
}
object MarsApi {
val retrofitService : MarsApiService by lazy {
}
}
object MarsApi {
val retrofitService : MarsApiService by lazy {
retrofit.create(MarsApiService::class.java) }
}
@GET("photos")
suspend fun getPhotos(): String
private fun getMarsPhotos() {

}
private fun getMarsPhotos() {
viewModelScope.launch {
}
}
viewModelScope.launch {
val listResult = MarsApi.retrofitService.getPhotos()
}
val listResult = MarsApi.retrofitService.getPhotos()
_status.value = listResult
--------- beginning of crash
22803-22865/com.example.android.marsphotos E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.example.android.marsphotos, PID: 22803
java.lang.SecurityException: Permission denied (missing INTERNET permission?)
...

That is all for Day92 ✅

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store