/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Nonnull @Override protected URL createUrl (final String string) throws IOException { return Analytics.createURL(string); } }
@Nonnull public static URL createURL (final @Nonnull String string) throws IOException { try { final StringBuilder buffer = new StringBuilder(string); buffer.append(string.contains("?") ? "&" : "?"); buffer.append("installId=").append(encode(getInstallId())); buffer.append("&blueBillVersion=").append(encode(getMessage(Analytics.class, "title"))); buffer.append("&osVersion=").append(encode(System.getProperty("os.version"))); buffer.append("&javaVersion=").append(encode(System.getProperty("java.version"))); buffer.append("&userLanguage=").append(encode(System.getProperty("user.language"))); buffer.append("&userRegion=").append(encode(System.getProperty("user.region"))); buffer.append("&board=").append(encode(Build.BOARD)); buffer.append("&brand=").append(encode(Build.BRAND)); buffer.append("&device=").append(encode(Build.DEVICE)); buffer.append("&model=").append(encode(Build.MODEL)); buffer.append("&product=").append(encode(Build.PRODUCT)); buffer.append("&versionIncremental=").append(encode(Build.VERSION.INCREMENTAL)); buffer.append("&versionRelease=").append(encode(Build.VERSION.RELEASE)); buffer.append("&versionSDK=").append(encode(Build.VERSION.SDK)); return new URL(buffer.toString()); } catch (UnsupportedEncodingException e) { throw new MalformedURLException(e.toString()); } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); }
@Override public void run() { try { log.info(">>>> pinging..."); Analytics.createURL("http://bluebill.tidalwave.it/mobile/ping").openStream().close(); } catch (FileNotFoundException e) { pinged = true; log.warn("While pinging: {}", e.toString()); } catch (IOException e) { log.warn("While pinging: {}", e.toString()); } } }.start();
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { return commonOptionsMenuController.onOptionsItemSelected(item); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { switch (item.getItemId()) { case R.id.clearTaxonHistory: controller.clearTaxonHistory(); return true; default: return commonOptionsMenuController.onOptionsItemSelected(item); } }
/******************************************************************************************************************* * * Adapts between the Android options menu callback and the controller. * ******************************************************************************************************************/ @Override public boolean onOptionsItemSelected (final @Nonnull MenuItem item) { switch (item.getItemId()) { case R.id.clearObservations: controller.deleteAllObservations(); return true; case R.id.share: controller.shareObservations(); return true; case R.id.export: controller.exportObservations(); return true; default: return commonOptionsMenuController.onOptionsItemSelected(item); } }