I am trying to improve the look to a certain Website by altering the HTML code. I want to change some stuff like the color of a specific text, make a picture a little bit bigger, and things of this nature.
Things I know how to do:
1: Get the HTML code using Jsoup
2: Display the code into a WebView
Things I want to know how to do:
1: Be able to modfiy the look of a Website
2: Do it quickly
For demonstration purposes, let me use this website as an example. If you follow this link you will get a list of users.
stackoverflow.com/users
How can I change the color of the user names to dark red?
https://i.stack.imgur.com/uysWi.png
This is my current code based on the things I know how to do.
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.webkit.WebView;
public class MainActivity extends Activity {
WebView web;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new MyTask().execute();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
private class MyTask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
Document doc;
String htmlcode = "";
try {
doc = Jsoup.connect("http://stackoverflow.com/users").get();
htmlcode = doc.html();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return htmlcode;
}
@Override
protected void onPostExecute(String result) {
web = (WebView) findViewById(R.id.webView1);
web.loadData(result, "text/html", null);
}
}
}
Please show me how this works, I appreciate your time.