Use services in android to synchronize with http://www.worldtimeserver.com
<p>Hi I am developing Excel for android, I have created all layout and other stuff now I have to create a service which will synchronize with <a href="http://www.worldtimeserver.com" rel="nofollow">http://www.worldtimeserver.com</a> to get time and it will print that time in first cell of my excel sheet. How can I achieve this? I know basic stuff of service, but how can I get time from that website?</p>

<p>Edit----
I have found solution of that problem, we can read webpage in android by following code</p>

<pre><code>URL url = new URL("http://www.worldtimeserver.com/current_time_in_PK.aspx");

                HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                conn.setConnectTimeout(5000);    // 5 seconds
                conn.setRequestMethod("GET");       
                conn.connect();
                BufferedReader rd  = new BufferedReader(new InputStreamReader(conn.getInputStream()));

                String line;

                while ((line = rd.readLine()) != null) {
//Do what ever you want here ,(HTML code every individual line of website will be read //here) }
</code></pre>
