コード例 #1
0
 public AstoriaContext(DroidApp da, AstoriaResources res)
 {
     runningApp = da;
     RClass     = new AstoriaR(runningApp);
     resObj     = res;
     da.context = this;
 }
コード例 #2
0
        public AstoriaContext(DroidApp da)
        {
            runningApp = da;
            RClass     = new AstoriaR(runningApp);
            //resObj = new AstoriaResources(runningApp);

            //Inflate manifest, inflate RClass using dex.net

            /*string layoutAbsoluteUri = runningApp.localAppRoot.Path + "\\AndroidManifest.xml";
             *
             * IAsyncOperation<StorageFile> task1 = StorageFile.GetFileFromPathAsync(layoutAbsoluteUri);
             * StorageFile sf = task1.GetResults();
             *
             * Task<byte[]> task = DalvikUWPCSharp.Disassembly.Util.ReadFile(sf);
             * byte[] xmlfile = task.Result;
             *
             * using (MemoryStream ms = new MemoryStream(xmlfile))
             * {
             *  AndroidXmlReader man = new AndroidXmlReader(ms);
             *  man.MoveToContent();
             *  XDocument LINQData = new XDocument(man);
             *
             *  foreach (XElement xe in LINQData.Elements(XName.Get("activity")))
             *  {
             *      AstoriaActivity a = new AstoriaActivity(this);
             *
             *      foreach (XElement xe2 in xe.Descendants())
             *      {
             *          if (xe2.Name.Equals("intent-filter"))
             *          {
             *              Intent i = new Intent();
             *
             *              foreach (XElement xe3 in xe2.Descendants())
             *              {
             *                  if (xe3.Name.Equals("action"))
             *                  {
             *                      string act = xe3.Attribute(XName.Get("{http://schemas.android.com/apk/res/android}name")).Value;
             *                      i.setAction(act);
             *                  }
             *
             *                  if (xe3.Name.Equals("category"))
             *                  {
             *                      string cat = xe3.Attribute(XName.Get("{http://schemas.android.com/apk/res/android}name")).Value;
             *                      i.addCategory(cat);
             *                  }
             *              }
             *
             *              a.setIntent(i);
             *          }
             *      }
             *
             *      Activities.Add(a);
             *  }
             * }*/
        }
コード例 #3
0
 public PreloadedDroidApp(DroidApp da)
 {
     runningApp     = da;
     currentContext = new AstoriaContext(runningApp);
     currentRes     = new AstoriaR(da);
 }