March 2017 Entries
This article will show you how to set up Charles and iOS devices so that you can capture HTTPS traffic from iOS devices using Charles. Step 0: Download and install Charles from https://www.charlesproxy.co... 1: Find the IP address of your mac:Ifconfig | grep “inet “ Step 2: Find the port number Charles uses listens on. It should be 8888 if you haven’t change the default value. You can find the number from Settings-->Proxy SettingsStep 3: You need set up the proxy on the iOS device.On the iOS ......
Last time I showed how to execute an AsyncTask in Jquery style. Now I will show how to do it in Kotlin. Kotlin has much better support for functional programming, functions/lambdas are first class member of the language. A parameter of a method can be just typed function rather than having to be interface. So I don’t have to create interface for Func<T> and Action<T>.This is how MyAsyncTask<T> looks like in Kotlin, note the type of task and completionHandler are ()->T or (T)->Unit?.class ......
On Android, if you want to make an async call, AsyncTask is the way to go. Basically you will have to implement something like this:private class LongOperation extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { //execute a long running operation } @Override protected void onPostExecute(String result) { //back to UI thread, can update UI }}Then you can call new LongOperation().execute("");I don’t like having to write so much boilerplate code ......