As a brief note to self, I like the way the TODO tag is highlighted when using TextMate, so I dug around to see how it worked so I can make other words be highlighted the same way it is. The short answer is that in TextMate, click the Bundles menu, select Edit Bundles, then scroll down to select TODO near the bottom of the list, then Language Grammars and TODO. The last few steps are shown in the image.
I wrote earlier about how to use the
javapackager command to create a macOS application bundle from a Java application, so I won’t repeat all of that information here. Instead, in this article I just want to show how to display an image that’s stored in the Contents/Resources/Java directory of a Mac/Java application bundle.
I recently learned how to use the Java javapackager command to build a macOS application bundle — i.e., a regular macOS application — from a Java application. In this tutorial I’ll show how to create a Mac application bundle from a simple Java class, in this case a Java Swing class.
Over the last two days I’ve gotten a Mac/Java app ready for Apple’s Mac App Store, including bundling the application as a macOS “.app” application bundle, and signing it so it can be submitted to the Store.
A relatively quick look at my browser history shows that I needed to hit over 260 URLs to get that done. As a wise professor once told me, “Keep learning, keep learning.”
As a quick note to self, I just created a TextMate Bundle snippet to insert some text at the current cursor position. Using TextMate 2.0.x, I did it with the following steps. I’ll go through these steps quickly as I’m just writing this for myself:
I just created a TextMate 2 bundle to underline the current line, and this image shows how I created that bundle. The dashed-line will be the same length as the line the cursor is currently on (the current line). I do this a lot when I use TextMate to write notes and even Markdown text, so I wanted a little script/bundle like this.
FWIW, the result of this bundle/command is that I can have the cursor be on a line like “Hello, world,” as shown below, press [Command][u], and end up with this:
Hello, world ------------
This is a little unusual for me, but I'm putting the following code here so I can remember how I implement a
ViewPager in my current Android application. I want to put this code out here in its current state before it gets more complicated. In fact, I only wish I had copied it out here earlier, before I made it as complicated as it is.
The only things that are important to know are:
Here are a few notes on using static fields in Android, from this SO page. (Note: Some of the stuff on that page is very wrong.)
Because static fields live until an Android app is killed (while instance fields are destroyed a lot), I’ve been using static fields to persist some of my Android app’s “state” data, but I was just thinking that I can probably do the same thing at the
Activity level using
onSaveInstanceState(Bundle) and then restoring the state with
onRestoreInstanceState(Bundle). The correct approach really depends on the problem you’re trying to solve.
This is the source code for a simple Android Preferences demo from the book Beginning Android 3:
This is an Android Handler and ProgressBar example, from the excellent book, Beginning Android 3. (See the URL that I have linked to.)