This file contains hidden or 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
| package id.ihwan.aac.network | |
| import id.ihwan.aac.model.MovieResponse | |
| import io.reactivex.android.schedulers.AndroidSchedulers | |
| import io.reactivex.disposables.CompositeDisposable | |
| import io.reactivex.schedulers.Schedulers | |
| class MainRepository { | |
| private val apiService = ApiFactory.create() | |
| private val compositeDisposable = CompositeDisposable() |
This file contains hidden or 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
| package id.ihwan.aac.network | |
| import io.reactivex.Observer | |
| import io.reactivex.disposables.CompositeDisposable | |
| import io.reactivex.disposables.Disposable | |
| abstract class ApiObserver<T> constructor(private val compositeDisposable: CompositeDisposable): Observer<T> { | |
| override fun onComplete() { | |
| } |
This file contains hidden or 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
| interface ApiInterface { | |
| @GET("upcoming?api_key=78adf61cd991fec888c055105c148a44") | |
| fun getMovie(): Observable<MovieResponse> | |
| } |
This file contains hidden or 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
| package id.ihwan.aac.network | |
| import okhttp3.OkHttpClient | |
| import okhttp3.logging.HttpLoggingInterceptor | |
| import retrofit2.Retrofit | |
| import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory | |
| import retrofit2.converter.gson.GsonConverterFactory | |
| object ApiFactory { | |
| fun create(): ApiInterface{ |
This file contains hidden or 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
| apply plugin: 'com.android.application' | |
| apply plugin: 'kotlin-android' | |
| apply plugin: 'kotlin-android-extensions' | |
| apply plugin: 'kotlin-kapt' | |
| android { | |
| compileSdkVersion 28 | |
| defaultConfig { | |
| applicationId "id.ihwan.aac" | |
| minSdkVersion 16 |
This file contains hidden or 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
| #include <stdio.h> | |
| int | |
| main () | |
| { | |
| int a, b; | |
| printf ("Menampilkan deret bilangan n : "); | |
| scanf ("%d", &a); | |
| if (a == 0) |
This file contains hidden or 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
| #include <stdio.h> | |
| int | |
| main () | |
| { | |
| int Luas; | |
| printf ("Pilihan Luas bangun datar (1-3) : "); | |
| scanf ("%d", &Luas); | |
| switch (Luas) |
This file contains hidden or 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
| #include <stdio.h> | |
| int | |
| main () | |
| { | |
| int Luas; | |
| printf ("Pilihan Luas bangun datar (1-3) : "); | |
| scanf ("%d", &Luas); | |
| if (Luas == 1) | |
| { |
This file contains hidden or 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
| #include <stdio.h> | |
| int | |
| main () | |
| { | |
| int kendaraan; | |
| printf | |
| ("Pilih kendaraan untuk menempuh perjalanan dari Yogyakarta menuju surabaya (1-4) : "); | |
| scanf ("%d", &kendaraan); |
This file contains hidden or 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
| #include <stdio.h> | |
| int | |
| main () | |
| { | |
| int kendaraan; | |
| printf | |
| ("Pilih kendaraan untuk menempuh perjalanan dari Yogyakarta menuju surabaya (1-4) : "); | |
| scanf ("%d", &kendaraan); |