android filesharing with http
<p>I have two android phones.... On first - there is a server with shared folder through WebService.... Another phone is a client, which sends requests to server to download and upload files from android server with requests as Async tasks... </p>

<p>When client tryes to download server is vibrating... Code is here.. </p>

<pre><code>SharedPreferences settings = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
mPort = settings.getInt("port", DEFAULT_PORT);
try {
  mWebServer = new WebServer(this, settings,
      new CookiesDatabaseOpenHelper(this).getWritableDatabase(), mPort);

  mWebServer
  .setOnTransferStartedListener(new WebServer.TransferStartedListener() {
    public void started(Uri uri) {
    Vibrator v1 = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
      NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      Notification notification = new Notification(R.drawable.folder,
          null, System.currentTimeMillis());
      PendingIntent pendingIntent = PendingIntent.getActivity(
          FileSharingService.this, 0, new Intent(
              FileSharingService.this, FileShare.class), 0);
      notification.setLatestEventInfo(FileSharingService.this,
          "File Share", "Transfer Started", pendingIntent);
     v1.vibrate(1000);
      nm.notify(1, notification);
    }
  });

} catch (IOException e) {
  Log.e(TAG, "Problem creating server socket " + e.toString());
}
mWebServerThread = new Thread() {
  @Override
  public void run() {
    mWebServer.runWebServer();
      }
};
mWebServerThread.start();
Log.i(TAG, "Started webserver");
} 
</code></pre>

<p>But I want server vibrate when downloading or uploading are finished.... How could I do it...?</p>
