Following W-‘s example (I’m such a copycat!), I’ve been trying out a few sleep-related applications on my phone. I get more sleep than he does and my schedule is pretty flexible, but I figure that an app might let me swap out the diminishing returns of sleeping in for some extra discretionary time. For a while, I ran Sleep as Android in parallel with SleepBot, and I also tried each of them separately. I used a sturdy, extra-long USB cable to charge my phone, and I slept with my phone under my pillow.

Both apps seem to agree with each other on the motion they detect, and they also appear to do a decent job of distinguishing between my motion and W-‘s motion (we have different-looking graphs). I’m not sure if there’s a significant difference, but I prefer Sleep as Android’s timing, so I bought it after the trial ended.

I also like Sleep as Android’s way of gradually waking me up with short buzzes, gradually leading up to an audio alarm. I like buzzes because they feel more discreet. I don’t have to feel guilty about interrupting W-‘s sleep. They also don’t lead to overexposure to whatever tones I picked for my alarm. I’d previously used the built-in Medieval Jaunt and songs like Shonen Knife’s Cookie Day, and those still result in an odd tug on my concentration whenever I hear them.

I’m still not keen on morning meetings, but I can make them with less grumbling now!

I was going to be in the US for 14 days, so I picked up a free prepaid SIM card for my phone in order to avoid massive roaming fees. My Samsung Galaxy S3’s compatible with the T-Mobile network, so I opted for the $2 Pay by the Day plan that included unlimited talk, text, and 2G web. A $30 load covered my 14-day trip with a dollar to spare. My parents were going to be there longer, so the $50 unlimited talk/text/web (100MB at 4G speed) was a better fit for them.

After I put in the SIM card, I confirmed that phone and text worked. The Internet connection wasn’t working, though. The call center agent asked me to make sure airplane mode was off (yup) and packet data was enabled (yup), and she tried resetting my connection to the network. Still no luck, though. Some searching turned up the fact that the 2G network is GSM. The following setting made it possible for me to connect to the Internet using my phone:

One of the reasons why I like working with the Android operating system is that you can build little tools that interact with the other apps on your system. It’s like the reason why I like Emacs, although Emacs lets you go ahead and redefine routines. Anyway. =)

So here was my motivation: When you share a recipe from the BigOven recipe app, it sends the URL instead of the text. This is inconvenient, so I wanted to make a small tool that extracted the URL and opened it in the browser. That way, I could pass it to Evernote and save the recipe for later searching.

Android stitches different applications together through the idea of an Intent. An application can send an intent to another application in order to get it to do something. It can broadcast an intent to notify other applications that have registered to receive that event. An app can also register to receive various events.

To add something to the Share menu, I needed to write a small application that receives and processes the SEND intent. After trying to figure out if I should use a BroadcastReceiver or a Service or whatever, I settled on using an Activity instead. I might extend this to let me select one of multiple URLs, or recognize phone numbers and things like that too. We’ll see.

From Tuesday: I spent most of the long weekend learning about Android development by working on the MobileOrg for Android open source project. When it comes to learning new technologies, I like working on existing projects more than starting from scratch. There’s plenty of sample code to draw on, and there’s enough functionality to inspire me to think about how to tweak it to fit my needs.

The first two days were really slow in terms of progress. It took me a while to figure out how to build both MobileOrg and MobileOrgNG, and I blogged the instructions in case someone else needs them in the future. After I figured that out, I started fiddling with the settings menu. I made the system more consistent, updated the look and feel to the latest design guidelines, and learned a little more about how everything tied together.

I’m starting to feel more comfortable with Android development. There are still tons of things to learn, of course, but I’m getting the hang of where things are, what things are called, and how things flow together. It’s an amazing thing, feeling the concepts click into place. As you learn more things, the possibilities grow combinatorically.

I should take care of a few other tasks before I move on to the next steps. I have to prepare a presentation for the Quantified Self conference in September. It’ll be an Ignite-style presentation, which is good – clear constraints make it easier to put something together. I also want to do an annual review in preparation for my birthday on Sunday.

After I finish those tasks, what do I want to do next in terms of Android development?

I’d like to build a better browsing interface for MobileOrg. I like the way MobileOrgNG makes it easy to browse the Org file’s hierarchy.

I want to be able to capture information from other applications.

It would be awesome to be able to handle attachments, too.

Tasker integration for automatically capturing information, perhaps?

Org-contacts would be great.

If I have a year of days like this, I think I’ll be able to learn and do a lot.

MobileOrgNG is kvj’s fork of matburt’s MobileOrg for Android. It has a better layout for large devices and a useful outline view, but doesn’t have some of the other features in the main branch. Here’s how you can build it in Eclipse.

In order to be able to get all the libraries you’ll need, install the Subversive SVN plugin for Eclipse.

In Eclipse, click Help – Install New Software.

Click on the dropdown for Work with and choose the update site for your Eclipse version (ex: Juno).

When the packages load, type in Subversive to filter the list.

Choose Subversive SVN Team Provider. You can choose other plugins as well.

Click Next and proceed through the installation process.

Now you can check out the MobileOrgNG source code and other modules. MobileOrgNG is set up as an Eclipse project, so importing it is easier than importing the original MobileOrg. Here’s how to get MobileOrgNG:

If you want to use your Android device to work with your Org-mode files, there’s MobileOrg and there’s MobileOrg NG. MobileOrg seems to have more recent activity and more contributors, but NG has a more tablet-optimized layout and better support for navigating large files, so it would be good to apply some of the ideas from NG to the main MobileOrg project. Might be a useful way for me to learn more about mobile development.

Here’s how to build MobileOrg (the matburt version).

Copy the URI to the Git repository (ex: git://github.com/matburt/mobileorg-android.git).

In Eclipse, click on File – Import – Projects from Git – URI. This may autodetect the URI. If not, paste in the URI. Click Next.

You should now see a list of branches. You can leave them all selected. Click Next.

Check the box for Clone Submodules. This will make sure that the project’s dependencies are also checked out. Click Next.

When you see the dialog called Select a wizard to use for importing projects, click on Cancel.

Because the .project file hasn’t been set up, you’ll need to import the project using a different wizard. However, there’s an Eclipse bug that can make this a bit of a hassle, so this is what you should do to get the projects set up in your system.

Close Eclipse.

Move the mobileorg-android subdirectory from your Eclipse workspace directory to a different directory that is not in your workspace.

Now you should have a bunch of projects in your system. You may need to adjust the libraries and build paths.

Right-click on the com.matburt.mobileorg.Gui.OutlineActivity project and choose Properties.

Click on Android and confirm that both libraries are detected. If not, you may need to remove and re-add them.

Wait for the libraries to be built. If you notice that the compiled JARs don’t have classes, doublecheck that the src folder has loaded the sources. Right-click on the src folder and choose Refresh in order to get the sources recognized by Eclipse.

Re-detect the Git connection by doing the following:

Right-click on the com.matburt.mobileorg.Gui.OutlineActivity project and choose Team – Share Project.

Choose Git.

Check the Use or create repository in parent folder of project.

Check the .git directory you’re using.

Click on Finish.

I also had to remove some code from AndroidManifest.xml because you’re apparently not supposed to have more than one action in an intent-filter:

Recent comments

JohnKitchin Thanks. That matches my current understanding too. It seems like use-package pretty conveniently installs and configures packages. I have seen cask for creating and installing... – Emacs configuration and use-package