Monday 15 February 2010

java - Search for a string in a htm file -



java - Search for a string in a htm file -

i want school app , hence want automatic notification service. have our school called "deputy plan" (im german.. dont know, if understand mean, doesnt matter) , it's online htm file. in file written courses canceled or represented teacher. want create service recognizes if written in plan concerns user of app.. hence want search string in htm file. possible? or recommend method?

get page's source

url url = new url("http://www.example.com/"); bufferedreader in = new bufferedreader(new inputstreamreader(url.openstream())); string row = ""; string text = ""; while ((row = in.readline()) != null) { text += row; } in.close();

then find string in text

if (text.contains("yourstring")) { system.out.print("found!"); }

you should seek homework way

java android html

No comments:

Post a Comment