CreateFromAdbData() public static method

Creates a new instance of the DeviceData class based on data retrieved from the Android Debug Bridge.
public static CreateFromAdbData ( string data ) : DeviceData
data string /// The data retrieved from the Android Debug Bridge that represents a device. ///
return DeviceData
Esempio n. 1
0
        /// <summary>
        /// Processes the incoming device data.
        /// </summary>
        private void ProcessIncomingDeviceData(string result)
        {
            List <DeviceData> list = new List <DeviceData>();

            string[] deviceValues = result.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);

            List <DeviceData> currentDevices = deviceValues.Select(d => DeviceData.CreateFromAdbData(d)).ToList();

            this.UpdateDevices(currentDevices);
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public List <DeviceData> GetDevices()
        {
            using (IAdbSocket socket = this.adbSocketFactory(this.EndPoint))
            {
                socket.SendAdbRequest("host:devices-l");
                socket.ReadAdbResponse();
                var reply = socket.ReadString();

                string[] data = reply.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);

                return(data.Select(d => DeviceData.CreateFromAdbData(d)).ToList());
            }
        }