Android ping programmatically example. You should use constructor with Context as param.