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
| //: [Previous](@previous) | |
| import UIKit | |
| /* | |
| Depedency diagrams and composition | |
| */ | |
| //typealias FeedLoader = ((([String]) -> Void) -> Void) |
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
| private void ambilUserRoleSetelahLogin(){ // fungsi ini dipanggil setelah login berhasil | |
| FirebaseDatabase database = FirebaseDatabase.getInstance(); | |
| DatabaseReference myRef = database.getReference("User");//Buat reference database dengan node "User" | |
| myRef.addValueEventListener(new ValueEventListener() { |
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
| import UIKit | |
| class Lampcase{ | |
| //What is this blueprint have? | |
| var sleeplamp = Lamp(warnaAwal: "Putih", materialAwal: "Kayu", voltAwal: 10, brightnesAwal: "High") | |
| var biglamp = Lamp(warnaAwal: "Purple", materialAwal: "Plastic", voltAwal: 10, brightnesAwal: "Low") | |
| } | |
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
| import okhttp3.Interceptor | |
| import okhttp3.OkHttpClient | |
| import okhttp3.Response | |
| import okhttp3.logging.HttpLoggingInterceptor | |
| import retrofit2.Retrofit | |
| import retrofit2.converter.gson.GsonConverterFactory | |
| import timber.log.Timber | |
| import java.util.concurrent.TimeUnit | |
| object ApiNetwork { |
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
| 2019-10-24 16:55:55.972 18086-18739/id.web.azammukhtar.multithreading D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /163.172.102.129 (port 3000) from /172.16.0.2 (port 58802) after 10000ms | |
| 2019-10-24 16:55:55.996 18086-18252/id.web.azammukhtar.multithreading W/System.err: java.net.SocketTimeoutException: failed to connect to /163.172.102.129 (port 3000) from /172.16.0.2 (port 58802) after 10000ms | |
| 2019-10-24 16:55:55.997 18086-18252/id.web.azammukhtar.multithreading W/System.err: at libcore.io.IoBridge.connectErrno(IoBridge.java:185) | |
| 2019-10-24 16:55:55.997 18086-18252/id.web.azammukhtar.multithreading W/System.err: at libcore.io.IoBridge.connect(IoBridge.java:129) | |
| 2019-10-24 16:55:55.997 18086-18252/id.web.azammukhtar.multithreading W/System.err: at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137) | |
| 2019-10-24 16:55:55.998 18086-18252/id.web.azammukhtar.multithreading W/System.err: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocke |
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
| 2019-10-24 16:47:46.896 14033-15614/id.web.azammukhtar.multithreading E/Camera_APM :: [APM]APM's Thread is started | |
| 2019-10-24 16:47:46.901 14033-15614/id.web.azammukhtar.multithreading E/Camera_APM :: [APM] This app is forground app | |
| 2019-10-24 16:47:50.890 14033-14033/id.web.azammukhtar.multithreading E/ViewRootImpl: sendUserActionEvent() returned. | |
| 2019-10-24 16:48:01.910 14033-14323/id.web.azammukhtar.multithreading E/Utils: LOG ERROR, Method : startPairingWithoutTest message error : start pair | |
| java.net.SocketTimeoutException: failed to connect to /163.172.102.129 (port 3000) from /172.16.0.2 (port 58754) after 10000ms | |
| at libcore.io.IoBridge.connectErrno(IoBridge.java:185) | |
| at libcore.io.IoBridge.connect(IoBridge.java:129) | |
| at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137) | |
| at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390) | |
| at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230) |
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
| public class ApiNetwork { | |
| private static Retrofit retrofit = null; | |
| private static OkHttpClient okHttpClient; | |
| private static Retrofit getClient() { | |
| if (okHttpClient == null) | |
| initOkHttp(); | |
| if (retrofit == null) { | |
| retrofit = new Retrofit.Builder() |
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
| -----------------------------------com.example.Category.java----------------------------------- | |
| package com.example; | |
| import com.google.gson.annotations.Expose; | |
| import com.google.gson.annotations.SerializedName; | |
| public class Category { | |
| @SerializedName("id") |
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
| { | |
| "error": false, | |
| "status": 200, | |
| "product": { | |
| "current_page": 1, | |
| "data": [ | |
| { | |
| "id": 113, | |
| "code": "11001", | |
| "name": "Polo", |
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
| public class ListKMSAdapter extends RecyclerView.Adapter<ListKMSAdapter.Viewholder> { | |
| private static final String TAG = "ListAnakAdapter"; | |
| private List<DataKMS> mDataKMS = new ArrayList<>(); | |
| private OnItemClick listener; | |
| @NonNull | |
| @Override | |
| public Viewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | |
| View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_data_kms, parent, false); |