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


Java IDevice.getProperty方法代码示例

本文整理汇总了Java中com.android.ddmlib.IDevice.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java IDevice.getProperty方法的具体用法?Java IDevice.getProperty怎么用?Java IDevice.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.IDevice的用法示例。


在下文中一共展示了IDevice.getProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: add

import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
/**
 * Add a new device to the data model, or replace any existing.
 */
private void add(IDevice device) {
    String serial = device.getSerialNumber();

    do {
        // for emulators use their virtual device name as label
        String deviceAvdName = device.getAvdName();
        if (deviceAvdName != null) {
            deviceLabels.put(serial, deviceAvdName + " [" + serial + "]");
            break;
        }

        // for real devices use their model name (something like '<vendor> <device>')
        String deviceModelName = device.getProperty("ro.product.model");
        if (deviceModelName != null) {
            deviceLabels.put(serial, deviceModelName + " [" + serial + "]");
            break;
        }
    } while (false);

    // finally, add the serial.
    add(serial);
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:26,代码来源:LogDevicesComboBoxSupport.java

示例2: supportsUiAutomator

import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
private static boolean supportsUiAutomator(IDevice device) {
  String apiLevelString = device.getProperty(IDevice.PROP_BUILD_API_LEVEL);
  int apiLevel;
  try {
    apiLevel = Integer.parseInt(apiLevelString);
  } catch (NumberFormatException e) {
    apiLevel = UIAUTOMATOR_MIN_API_LEVEL;
  }

  return apiLevel >= UIAUTOMATOR_MIN_API_LEVEL;
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:12,代码来源:UiAutomatorHelper.java

示例3: setupDevicesTable

import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
private void setupDevicesTable() {
    DefaultTableModel tableModel = (DefaultTableModel) devicesTable.getModel();
    tableModel.setRowCount(0);
    for (IDevice device : devices) {
        String name;
        String target;
        if (device.isEmulator()) {
            name = device.getAvdName();
            AvdInfo info = avdManager.getAvd(device.getAvdName(), true /*validAvdOnly*/);
            target = info == null ? "?" : device.getAvdName();
        } else {
            name = "N/A";
            String deviceBuild = device.getProperty(IDevice.PROP_BUILD_VERSION);
            target = deviceBuild == null ? "unknown" : deviceBuild;
        }
        String state;
        if (DeviceState.BOOTLOADER.equals(device.getState())) {
            state = "bootloader";
        } else if (DeviceState.OFFLINE.equals(device.getState())) {
            state = "offline";
        } else if (DeviceState.ONLINE.equals(device.getState())) {
            state = "online";
        } else {
            state = "unknown";
        }

        tableModel.addRow(new Object[]{
            // TODO nulls?
            device.getSerialNumber(), name, target,
            Boolean.valueOf("1".equals(device.getProperty(IDevice.PROP_DEBUGGABLE))),
            state
        });
    }
    devicesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            DeviceUiChooser.this.updateState();
        }
    });
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:41,代码来源:DeviceUiChooser.java


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