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
| class BaseRecyclerViewAdapter<BIND: ViewDataBinding>(val ressource: Int,val variableId: Int) : RecyclerView.Adapter<BaseRecyclerViewAdapter<BIND>.Holder>() { | |
| private var layoutInflater: LayoutInflater? = null | |
| private var items: MutableList<Any> = ArrayList() | |
| private lateinit var callback: (data: Any) -> Unit | |
| constructor(ressource: Int,variableId: Int,items: MutableList<Any>) : this(ressource, variableId){ | |
| this.items = items | |
| } |
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 ApiService { | |
| @GET("api/apk-download/5b84691a312bdc094694cada") | |
| fun download(@Query("access-token") token: String): Observable<Response<ResponseBody>> | |
| } | |
| //initialize api service with retrofit | |
| fun download(service: ApiService,id: String) { | |
| service.download(id) | |
| .subscribeOn(Schedulers.io()) | |
| .observeOn(AndroidSchedulers.mainThread()) |
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
| // None of the tutorals could help me, so I adapted a few codes. | |
| // What I really want is make a full duplex way between NodeJS and Java, using encrypt/decrypt with AES 128 bit | |
| // 1 - you must have to generate the key | |
| openssl enc -aes-128-cbc -k secret -P -md sha1 | |
| // key examples: | |
| // DCDD74627CD60252E35DFBA91A4556AA | |
| // 2CB24CFDB3F2520A5809EB4851168162 | |
| // 468CA14CA44C82B8264F61D42E0E9FA1 |
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 App extends Application { | |
| // Called when the application is starting, before any other application objects have been created. | |
| // Overriding this method is totally optional! | |
| @Override | |
| public void onCreate() { | |
| super.onCreate(); | |
| Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { | |
| public void uncaughtException(Thread paramThread, Throwable paramThrowable) { | |
| Log.e("Error"+Thread.currentThread().getStackTrace()[2],paramThrowable.getLocalizedMessage()); | |
| } |