当前位置: 首页>>代码示例>>Java>>正文


Java AndroidInfoHelpers类代码示例

本文整理汇总了Java中com.facebook.react.modules.systeminfo.AndroidInfoHelpers的典型用法代码示例。如果您正苦于以下问题:Java AndroidInfoHelpers类的具体用法?Java AndroidInfoHelpers怎么用?Java AndroidInfoHelpers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AndroidInfoHelpers类属于com.facebook.react.modules.systeminfo包,在下文中一共展示了AndroidInfoHelpers类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDebugServerHost

import com.facebook.react.modules.systeminfo.AndroidInfoHelpers; //导入依赖的package包/类
public String getDebugServerHost() {
  // Check host setting first. If empty try to detect emulator type and use default
  // hostname for those
  String hostFromSettings = mPreferences.getString(PREFS_DEBUG_SERVER_HOST_KEY, null);

  if (!TextUtils.isEmpty(hostFromSettings)) {
    return Assertions.assertNotNull(hostFromSettings);
  }

  String host = AndroidInfoHelpers.getServerHost();

  if (host.equals(AndroidInfoHelpers.DEVICE_LOCALHOST)) {
    FLog.w(
      TAG,
      "You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' " +
        "to forward the debug server's port to the device.");
  }

  return host;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:21,代码来源:PackagerConnectionSettings.java

示例2: getDebugServerHost

import com.facebook.react.modules.systeminfo.AndroidInfoHelpers; //导入依赖的package包/类
/**
 * @return the host to use when connecting to the bundle server.
 */
private String getDebugServerHost() {
  // Check debug server host setting first. If empty try to detect emulator type and use default
  // hostname for those
  String hostFromSettings = mSettings.getDebugServerHost();

  if (!TextUtils.isEmpty(hostFromSettings)) {
    return Assertions.assertNotNull(hostFromSettings);
  }

  String host = AndroidInfoHelpers.getServerHost();

  if (host.equals(AndroidInfoHelpers.DEVICE_LOCALHOST)) {
    FLog.w(
      ReactConstants.TAG,
      "You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' " +
        "to forward the debug server's port to the device.");
  }

  return host;
}
 
开发者ID:ManrajGrover,项目名称:react-native-box-loaders,代码行数:24,代码来源:DevServerHelper.java

示例3: getInspectorDeviceUrl

import com.facebook.react.modules.systeminfo.AndroidInfoHelpers; //导入依赖的package包/类
public String getInspectorDeviceUrl() {
  return String.format(
      Locale.US,
      INSPECTOR_DEVICE_URL_FORMAT,
      mSettings.getPackagerConnectionSettings().getDebugServerHost(),
      AndroidInfoHelpers.getFriendlyDeviceName());
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:8,代码来源:DevServerHelper.java

示例4: JSPackagerClient

import com.facebook.react.modules.systeminfo.AndroidInfoHelpers; //导入依赖的package包/类
public JSPackagerClient(String clientId, PackagerConnectionSettings settings, Map<String, RequestHandler> requestHandlers) {
  super();

  Uri.Builder builder = new Uri.Builder();
  builder.scheme("ws")
    .encodedAuthority(settings.getDebugServerHost())
    .appendPath("message")
    .appendQueryParameter("device", AndroidInfoHelpers.getFriendlyDeviceName())
    .appendQueryParameter("app", settings.getPackageName())
    .appendQueryParameter("clientid", clientId);
  String url = builder.build().toString();

  mWebSocket = new ReconnectingWebSocket(url, this);
  mRequestHandlers = requestHandlers;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:16,代码来源:JSPackagerClient.java

示例5: getHostForJSProxy

import com.facebook.react.modules.systeminfo.AndroidInfoHelpers; //导入依赖的package包/类
/**
 * @return the host to use when connecting to the bundle server from the host itself.
 */
private static String getHostForJSProxy() {
  return AndroidInfoHelpers.DEVICE_LOCALHOST;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:7,代码来源:DevServerHelper.java


注:本文中的com.facebook.react.modules.systeminfo.AndroidInfoHelpers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。