a simple google search on "USGS Elevation Query Service API" pointed to http://ned.usgs.gov/epqs/ (different address from the question you linked. And the API seems extremely straight forward.
Here is an example call to Las Vegas http://nationalmap.gov/epqs/pqs.php?x=36.1251958&y=-115.3150863&output=json&units=Meters
The problem is that as per their website "If unable to find data at the requested point, this service returns -1000000" and I personally couldn't find any location that they have location (tried Las Vegas and San Francisco).
Alternatively, Google have an elevation API, that I can only assume it's pretty damn good considering Google Maps. Here you can see the docs https://developers.google.com/maps/documentation/elevation/start and here is an example query https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034
For the actual call itself, suggest is to use OkHttp (http://square.github.io/okhttp/) or Retrofit (which uses OkHttp) to do threading for you), but a basic code is:
OkHttpClient client = new OkHttpClient();
String getElevation(String url) throws IOException {
Request request = new Request.Builder()
.url(url)
.build();
Response response = client.newCall(request).execute();
return response.body().string();
}
then it's just parse the Json string