Saturday, December 31, 2011

Wait a second

For many, 2011 has been a long and economically challenging year, and the start of 2012 is a welcome new beginning. I think that most can attest that no matter one's level of patience, it can be a stretching and growing experience to wait on God for a year or more of rocky times. But if the year of 2011 has been a long time to wait on God, then how much longer is 2011 years to wait for "the second coming," Jesus' promised return? If Jesus were to come again, I have often wondered why he has taken two millenia--and counting--to do so. I mean, if people still aren't believing in him, what better way would it be to convince them than to make a dramatic appearance?

But then I got to thinking of his time course in the past, and why he might even choose to delay his coming for longer. It took him quite some time to attend to his first coming. If we measure from the time of the first writings of Scripture in the Torah, one could argue that he waited a good millennium or so to make his first appearance. And if we were to count from the beginning of creation, then we're looking at up to a multi-billion year delay before his first arrival. With that in mind, a 2,000 year delay in his reappearance is paltry at best.

More importantly, I realized that he may have an actual purpose in not returning so soon. For one, he has already expressed that his appearance by itself would not necessarily change hearts, as his first arrival had only emboldened many to bring him to his crucifixion. Instead of rushing his second arrival to turn hearts toward him, he may have in fact delayed his coming for this same effect.

Indeed, perhaps one of the most powerful points of his credibility is the fact that he has stood the test of time. Even for those who do not believe in him as God and Savior, the persistent longevity of his wisdom, of his message and example of love, justice, and forgiveness, still ring true thousands of years after he first spoke them. It would be one thing to hear this message spoken at an inspirational seminar, harbor a warm fuzzy feeling in one's heart on the way home, and promptly forget about it upon returning to work. It's another to inspire a generation to sacrifice their lives for a fiery orator's cause, only for the next generation to shun or forget such philosophy. But it's another entirely for the message to live on, no matter how misused, abused, or misinterpreted, to continue to humble and convict and energize those from all walks of life to live a life of service. Had Jesus returned in 70 AD to set up his kingdom, we would never know in our hearts whether his message would stand the test of time. If he had swooped in during the Plague or returned during the World Wars, we would never know if his message would have persisted on its own through some of its greatest tests.

Perhaps he will come tomorrow, or next year, or perhaps it will be another billion years before his next arrival. In any case, his message is alive and well, and so is he.

Thursday, December 01, 2011

Android 4.0 (Ice Cream Sandwich) on Virtualbox

Yesterday to my utter delight I realized that the Ice Cream Sandwich version of Android (4.0) can run in Virtualbox. I've been contemplating programming an Android app for the tablet form factor but don't quite have the resources to purchase a spanking new ICS tablet, and a virtually free virtual machine fits the pocketbook much better.

For Android ports, I normally turned to the venerable Android-x86 project. Indeed, they have just released an ICS port designed for the AMD Brazos platform, but the build apparently does not support internet connectivity or use of a mouse, which of course makes use within a virtual machine on a laptop rather challenging. Fortunately, I found another blog posting that referenced a Japanese site whose developer has provided a .vdi virtual hard disk file for loading directly within Virtualbox. Best of all, this not only includes mouse support and networking, but also hooks up with ADB for Android app development.

To set up the Virtualbox environment, I followed these steps:
  • Download the pre-made .vdi file with Android 4.0.
  • Create a new virtual machine with the following settings:
    • OS Type Linux 2.6
    • 512MB RAM
    • Acceleration: VT-x/AMD-V (which is apparently required for ICS at least on this build), nested paging, and PAE/NX
    • Bridged network adapter (but see below)
    • 2GB hard drive (not required)
    • Hard disk pointing to the .vdi file. Note that the disk will be attached by default to a SATA controller, but the disk should be removed from there and attached to the IDE Controller instead.
The virtual machine booted and worked out of the box! Next, I needed to connect the virtual machine to ADB so that I could load up my app for testing:
  • Open a command-prompt in the directory of adb.exe (ie Shift-right-click in android-sdk-windows\platform-tools and choose the "Open command window here" item).
  • Enter adb connect [ip-address]. This turns out to be the most difficult step because unlike using netcfg in the Android-x86 builds, I haven't found an easy way to determine the local IP address. One method is to log into your router and check the DHCP client list. The list usually shows IP addresses for the various MAC addresses of devices connected to the router. You can find the MAC address of your device by right-clicking on the networking icon in the Virtualbox status bar, choosing "Network adapters...", and then opening the "Advanced" section.
One of the challenges I've faced while on the road is the inability to connect while completely disconnected from the internet or any router. In this case, I need a way to make a solely local network connection from ADB to the virtual machine. Fortunately, this posting describes a simple method to make that connection:
  • In the same network adapters page from within Virtualbox, change the "Attached to" selection to "NAT".
  • Choose "Port forwarding", and in the "Host Port" and "Guest Port" sections, type "5555". If you have multiple virtual machines and want to connect to each of them, you could increment the host port for each of the forwarding rules while keeping the same guest port for each device (eg host port 5556, guest port 5555 on a second virtual machine).
  • From the command-prompt in the directory of adb.exe, enter adb connect localhost.

The Android 4.0.1 device should pop up in the DDMS devices listing from within the Eclipse development environment, and packages should transfer to ICS with glee.