March 2017 Entries

Capture HTTPS traffic from iOS devices using Charles

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 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 ......

Posted On Friday, March 3, 2017 12:02 PM | Comments (7)

Execute AsyncTask like jquery’s $.ajax in Kotlin on Android

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 ......

Posted On Friday, March 3, 2017 10:16 AM | Comments (4)

Execute AsyncTask like jquery’s $.ajax in Java on Android

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 ......

Posted On Wednesday, March 1, 2017 10:06 PM | Comments (23)

Copyright © Changhong Fu

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski