コード例 #1
0
ファイル: Util.cs プロジェクト: steskalja/AstoriaUWP
        public static async Task LoadAPK(FileActivatedEventArgs e)
        {
            StorageFile sf = (StorageFile)e.Files[0];

            //Debug.WriteLine("When do I get called?");
            //var appsRoot = await localFolder.CreateFolderAsync("Apps", CreationCollisionOption.OpenIfExists);
            //StorageFile copiedFile = await sf.CopyAsync(appsRoot, sf.Name, NameCollisionOption.GenerateUniqueName);

            //ApkParser parser = await ApkParser.CreateAsync(copiedFile);
            //ApkMeta meta = await parser.getApkMeta();
            //apkpage.SetDisplayName(meta.getName());
            apkpage.SetDisplayName(sf.DisplayName);
            CurrentApp = await DroidApp.CreateAsync(sf);

            apkpage.appletLoaded(CurrentApp, EventArgs.Empty);
            //Debug.WriteLine($"cf is null: {CurrentFile == null}");
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: steskalja/AstoriaUWP
        private async void AppListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems[0] is string)
            {
                bgGrid.Children.Add(new DroidAppLoadingPopup());

                var appsRoot = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Apps", CreationCollisionOption.OpenIfExists);

                string   lbi = (string)e.AddedItems[0];
                DroidApp da  = await DroidApp.CreateAsync(await appsRoot.GetFolderAsync(lbi));

                da.Run(Frame);
            }

            else
            {
                Frame.Navigate(typeof(SettingsPage));
            }
        }
コード例 #3
0
        /*private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
         * {
         *  UserControl appView = (UserControl)RenderTargetBox.Child;
         *  appView.Width = (this.ActualWidth) * (40/37);
         *  appView.Height = (this.ActualHeight - 48) * (40 / 37);
         * }*/

        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            //base.OnNavigatedTo(e);
            if (e.Parameter.GetType().Equals(typeof(DroidApp)))
            {
                RunningApp      = (DroidApp)e.Parameter;
                appImage.Source = RunningApp.appIcon;
                //UIRenderer = new Renderer((DroidApp)e.Parameter);
                //cpu = new DalvikCPU(((DroidApp)e.Parameter).dex, ((DroidApp)e.Parameter).metadata.packageName, this);
                //cpu.Start();
                //await Render();
            }

            else if (e.Parameter.GetType().Equals(typeof(StorageFolder)))
            {
                setPreloadStatusText("Setting up app environment");
                RunningApp = await DroidApp.CreateAsync((StorageFolder)e.Parameter);
            }
        }