Add communication code to sample app.