我导入bootstrap文件:
public String makeHttpRequestJsonString(String path, int requestType, Map<String, String> params){
String json = "";
InputStream responseStream = null;
try {
startTime = System.currentTimeMillis();
StringBuilder postData = new StringBuilder();
for(Map.Entry<String, String> param : params.entrySet()){
if(postData.length() != 0) postData.append('&');
postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
postData.append('=');
postData.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
}
byte[] postDataBytes = postData.toString().getBytes("UTF-8");
URL url = makeURL(path, requestType);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setUseCaches(false);
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("Cache-Control", "no-cache");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
DataOutputStream request = new DataOutputStream(conn.getOutputStream());
request.write(postDataBytes);
request.flush();
//Some people have reported issues when closing the the request before reading the
request.close();
//Check the response code of the server -
Integer replyCode = conn.getResponseCode();
//System.out.println("Reply Code: " + replyCode.toString());
responseStream = new BufferedInputStream(conn.getInputStream());
BufferedReader responseStreamReader = new BufferedReader(new InputStreamReader(responseStream));
String line = "";
StringBuilder stringBuilder = new StringBuilder();
while ((line = responseStreamReader.readLine()) != null) {
stringBuilder.append(line).append("\n");
}
responseStreamReader.close();
json = stringBuilder.toString();
}
catch (UnsupportedEncodingException e) {
} catch (IOException e) {
Log.e(TAG, "makeHttpRequestJsonString --- " + e.getMessage());
}
return json;
}
为链接添加html
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
并且有那个