private void Form1_Load(object sender, EventArgs e) { GetAppList(1); GetAppList(2); GetPackList(); AndoridDeviceManger.GetShareInstance().OnListDeviceChangeComplete += Form1_OnListDeviceChangeComplete; AndoridDeviceManger.GetShareInstance().ListDevice(true); if (IOSDeviceManger.GetShareInstance().CheckItunes()) { if (!IOSDeviceManger.GetShareInstance().CheckVCRuntime()) { MessageBox.Show("VC++运行库未安装,请安装"); IOSDeviceManger.GetShareInstance().InstallVCRuntime(); } if (IOSDeviceManger.GetShareInstance().StatrListenDeviceChange()) { IOSDeviceManger.GetShareInstance().OnIOSDeviceChangeComplete += Form1_OnIOSDeviceChangeComplete; } else { MessageBox.Show("苹果监听服务启动失败"); } } else { MessageBox.Show("iTunes未安装,请安装iTunes,安装完后请重启程序"); Process.Start("explorer", "http://www.apple.com/cn/itunes/download/"); } }
public static AndoridDeviceManger GetShareInstance() { lock (lockHelper) { if (instance == null) { instance = new AndoridDeviceManger(); } return(instance); } }
protected override void WndProc(ref Message m) { if (m.Msg == 0x219) { if (m.WParam.ToInt32() == 0x7) { AndoridDeviceManger.GetShareInstance().ListDevice(false); } if (m.WParam.ToInt32() == 0x8000) { AndoridDeviceManger.GetShareInstance().ListDevice(true); } } base.WndProc(ref m); }
public void InstallAndoridApp(ImageApp[] apps) { if (imageButton1.Enabled) { if (apps.Length > 0) { imageButton1.Enabled = false; label2.Text = "应用安装中,请稍后.."; progressBar1.Maximum = apps.Length; progressBar1.Value = 0; foreach (ImageApp i in apps) { AndoridDeviceManger.GetShareInstance().InstallApp(andoridDevice, i.appPath); } } } }
public Devices(AndoridDevice device, AppImageListPanel andoridAppImageListPanel, string uid, string username) { InitializeComponent(); this.uid = uid; this.username = username; platform = Platform.Android; this.andoridDevice = device; this.andoridAppImageListPanel = andoridAppImageListPanel; this.label1.Text = device.DeivceId; AndoridDeviceManger.GetShareInstance().OnInstallAppComplete += Devices_OnInstallAppComplete; player = new System.Media.SoundPlayer(Config.GetShareInstance().GetValue("Wav")); if (device.Status == AndoridDeviceStatus.OnLine) { label2.Text = "手机连接成功,请安装应用"; } else { label2.Text = "手机连接成功,但没有安装权限,请授权"; } }