get localhost and the android device on the same wireless subnet
example
laptop 192.168.1.158
phone 192.168.1.166
start the webserver on laptop where wwwroot is root
use preferred http package for android ( okhttp , volley, httpurlconnection ... )
in the 'whenDone' or std Callback slot , just create a JSON obj from the http.response.readStream ....
JsonNode root = new ObjectMapper().readValue(new ByteArrayInputStream(response), JsonNode.class);
roleUserMp = new HashMap<String, ArrayList<String>>();
String mRoleId, mRoleName;
ArrayNode array = (ArrayNode) root.path("results");
for(JsonNode node : array){
// if(Trace.debug)Log.d(TAG, "getListRole " +node.path("name").getTextValue() );
role_arr.add(node.path("name").getTextValue());
mRoleName = node.path("name").getTextValue();
mRoleId = node.path("objectId").getTextValue();
getUserRelations(mRoleId, mRoleName); //mapEntry "roleNm" :[userid, us2, us3...]
}