Exemple #1
0
 protected override string GenerateInfo(string filename)
 {
     try {
         var manifest = AndroidAppManifest.Load(filename);
         return(manifest.PackageName);
     } catch (Exception ex) {
         LoggingService.LogError("Error loading android manifest '" + filename + "'", ex);
         return(null);
     }
 }
        public AndroidAppManifest AddManifest()
        {
            if (AndroidManifest.IsNullOrEmpty)
            {
                AndroidManifest = GetDefaultManifestFileName();
            }
            if (!Directory.Exists(AndroidManifest.ParentDirectory))
            {
                Directory.CreateDirectory(AndroidManifest.ParentDirectory);
            }
            var manifest = AndroidAppManifest.Create(GetDefaultPackageName(), Name);

            manifest.WriteToFile(AndroidManifest);
            AddFile(AndroidManifest);
            return(manifest);
        }
        static bool GetActivityNameFromManifest(IProgressMonitor monitor, MonoDroidProjectConfiguration conf, out string activity)
        {
            activity = null;

            var manifestFile = conf.ObjDir.Combine("android", "AndroidManifest.xml");

            if (!File.Exists(manifestFile))
            {
                monitor.ReportError("Intermediate manifest file is missing", null);
                return(false);
            }

            var manifest = AndroidAppManifest.Load(manifestFile);

            activity = manifest.GetLaunchableActivityName();
            if (string.IsNullOrEmpty(activity))
            {
                monitor.ReportError("Application does not contain a launchable activity", null);
                return(false);
            }

            activity = manifest.PackageName + "/" + activity;
            return(true);
        }