Creating an Android Activity with no UI

How do you create an Activity based applications with no UI?

The answer is that you need to set the activity theme in the manifest, for RosieUtility I use:


Like this in AndroidManifest.xml:

<activity android:name=".MainActivity"
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

If you just want to kick off something quick, you’ll also want to call “finish();” after firing the intent in onCreate of Activity

The latest set of activity themes are defined in /res/values/themes.xml in the Android source here.

Note I’m not using the theme ‘NoDisplay’ as I do actually show notifications on the screen as the Activity is going about its business.


How To Use SandCastle To Generate Help Files From Code

1) Generate XML Documentation For SandCastle To consume

To generate an XML documentation file for a Visual C# project

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Build tab.
  3. On the Build page, select XML documentation file. By default, the file is created under the specified output path, for example, “bin\Debug\Projectname.XML”.

2) Download and install SandCastle –

3) Download and install SandCastle Help File Builder:

4) Load up SandCastle and create a new project choosing the .sln for your application. Click Documentation menuitem then Build.

More good info here:

More Verbose Application_Error() handling in global.asx

Extracting exception specifics like line number, class, method, etc:

   /// <summary>
        /// Handles the Error event of the Application control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Application_Error(object sender, EventArgs e)
                Logging logging = new Logging();

                Exception ex = Server.GetLastError().GetBaseException();

                StackTrace trace = new StackTrace(ex, true);                

                string sourceFile = trace.GetFrame(0).GetFileName();
                int sourceLine = trace.GetFrame(0).GetFileLineNumber();
                string sourceMethod = trace.GetFrame(0).GetMethod().Name;            
                string sourceClass = trace.GetFrame(0).GetMethod().DeclaringType.ToString();
                string sourceMessage = ex.Message.ToString();
                string sourceThreadID = AppDomain.GetCurrentThreadId().ToString();

                string currentUser = (SessionWrapper.CurrentLoggedInUser != null) ? SessionWrapper.CurrentLoggedInUser.UserId : "";

                logging.insertLog(sourceClass, DateTime.Now,
                    trace.ToString(), currentUser, "FATAL",
                    sourceLine.ToString(), sourceMessage, sourceMethod, sourceThreadID, 0, 0, currentUser, "EHAP");

            catch (Exception)
                // If logging to database fails, log to file system
                log.Fatal("EHAP Site Application_Error", Server.GetLastError());


            Response.Redirect("/SiteException.aspx", false);