@Test public void getSumoURLForTopic() throws Exception { final String version = BuildConfig.VERSION_NAME; Locale.setDefault(Locale.GERMANY); assertEquals("https: SupportUtils.getSumoURLForTopic(RuntimeEnvironment.application, "foobar")); Locale.setDefault(Locale.CANADA_FRENCH); assertEquals("https: SupportUtils.getSumoURLForTopic(RuntimeEnvironment.application, "foobar")); }
public static String getSumoURLForTopic(final Context context, final String topic) { String escapedTopic; try { escapedTopic = URLEncoder.encode(topic, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("utf-8 should always be available", e); } final String appVersion; try { appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException("Unable find package details for Focus", e); } final String osTarget = "Android"; final String langTag = Locales.getLanguageTag(Locale.getDefault()); return "https: }
SupportUtils { public static String getSumoURLForTopic(final Context context, final String topic) { String escapedTopic; try { escapedTopic = URLEncoder.encode(topic, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("utf-8 should always be available", e); } final String appVersion; try { appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException("Unable find package details for Focus", e); } final String osTarget = "Android"; final String langTag = Locales.getLanguageTag(Locale.getDefault()); return "https: } }
SupportUtils { public static String getSumoURLForTopic(final Context context, final String topic) { String escapedTopic; try { escapedTopic = URLEncoder.encode(topic, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("utf-8 should always be available", e); } final String appVersion; try { appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException("Unable find package details for Focus", e); } final String osTarget = "Android"; final String langTag = Locales.getLanguageTag(Locale.getDefault()); return "https: }  }
SupportUtils { public static String getSumoURLForTopic(final Context context, final String topic) { String escapedTopic; try { escapedTopic = URLEncoder.encode(topic, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("utf-8 should always be available", e); } final String appVersion; try { appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException("Unable find package details for Focus", e); } final String osTarget = "Android"; final String langTag = Locales.getLanguageTag(Locale.getDefault()); return "https: }  static String getSumoURLForTopic(final Context context, final String topic); static String getManifestoURL(); }
SupportUtils { public static String getSumoURLForTopic(final Context context, final String topic) { String escapedTopic; try { escapedTopic = URLEncoder.encode(topic, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("utf-8 should always be available", e); } final String appVersion; try { appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException("Unable find package details for Focus", e); } final String osTarget = "Android"; final String langTag = Locales.getLanguageTag(Locale.getDefault()); return "https: }  static String getSumoURLForTopic(final Context context, final String topic); static String getManifestoURL();  }