Code example for AbstractHttpClient

Methods: execute

0
	 * @throws ClientProtocolException Thrown when the provided URL is invalid 
	 * @throws IOException Thrown when the last version information could not be retrieved 
	 */ 
	private String[] retrieveLatestVersion(AbstractHttpClient httpclient, String url) throws ClientProtocolException,
			IOException { 
		HttpResponse request = httpclient.execute(new HttpGet(url));
		InputStream stream = request.getEntity().getContent();
		String appVersion[] = HttpHelper.convertStreamToString(stream).split("\\|");
		stream.close();
		return appVersion;
	} 
 
	private void newNotification(String ticker, String title, String text, String downloadUrl, int notifyID) {
		PendingIntent pi = PendingIntent.getActivity(this, notifyID,
				new Intent(Intent.ACTION_VIEW, Uri.parse(downloadUrl)), Intent.FLAG_ACTIVITY_NEW_TASK);
		Builder builder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_stat_notification)
				.setTicker(ticker).setContentTitle(title).setContentText(text)
				.setLights(notificationSettings.getDesiredLedColour(), 600, 1000)
				.setSound(notificationSettings.getSound()).setAutoCancel(true).setContentIntent(pi);
		notificationManager.notify(notifyID, builder.build());
Experience pair programming with AI  Get Codota for Java