本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}