private void startUserInput() {
		(new Thread() {
			public void run() {
				try {
					while (true) {
						String message = AppChatExample.this.getUserInput("Message: ");

						if (message == null || message.equals("")) {
							continue;
						} else if (message.equals("q") || message.equals("quit")) {
							break;
						}

						JSONObject msgObj = new JSONObject();
						msgObj.put("message", message);
						msgObj.put("username", "You");
						AppChatExample.this.router.publishCommand(new WidgetCommand(WIDGET_ID, msgObj));
					}
					AppChatExample.this.closeConnectionAndExit();

				} catch (JSONException e) {
					e.printStackTrace();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}).start();
	}