solr

Indexing SOLR Using Data from Google’s BigQuery

For this entry I assume you already know how to configure SOLR’s Data Import Handler as that is how we’ll configure SOLR to use BigQuery: https://wiki.apache.org/solr/DataImportHandler Steps Google’s Service Account File Download the service account file as described here: https://cloud.google.com/docs/authentication/getting-started  Read more…

hadoop

Using Hadoop to Create SOLR Indexes

One of the most challenging projects I faced at work recently was to create a Apache SOLR index consisting of approx 15 million records. This index had been created once in the history of the company using a MySQL database and SOLR’s Data Import Handler (DIH). It had not been attempted since then because the original indexing process was time consuming (12-14 hours), required human supervision, and on failure had to be restarted from the very beginning.
(more…)

android

Android apps on my phone

I was the first one at work to get an Android phone. As word got around I have become the guy to go to when it comes to Android. I get asked questions about Android before they buy. I also get questions about Android after they’ve bought their new phone. One thing that people seem to appreciate is when I provide them with a list of apps to get them started.

Without further ado, here is a list of most of the apps I have on my phone. I’ve not included some of the apps (e.g., OEM pre-installed crap).
(more…)

android

How I managed to install the CyanogenMod 6.0.0-Droid-RC2 on my Motorola Droid from a Mac Book Pro (OSX v.10.6.4)

First I read the wiki entry http://wiki.cyanogenmod.com/index.php?title=Full_Update_Guide_-_Motorola_Droid As I was reading I noticed that there were no directions for OSX; only for Windows and Linux. It turns out that the flash recovery tools are not available for OSX. That means that I would have to do this from a virtual machine.

Because I am more comfortable with Linux I decided to use Ubuntu running in a virtual machine. I grabbed a copy of VMWare Fusion from http://downloads.vmware.com/ I then grabbed a copy of Ubuntu from http://www.ubuntu.com/desktop/get-ubuntu/download I had use VMWare with Windows before so I knew this couldn’t be that difficult but I skimmed http://svenand.blogdrive.com/archive/56.html just in case there might be any gotchas.

Once VMWare was installed and a copy of Ubuntu was up and running I began down the path described in the wiki page noted above. Unfortunately I ran into problems in section entitledInstalling SPRecovery with sbf_flash (Linux).Steps 1-5 worked without a problem. However, during step 6 the process for me looked like this

[email protected]:/tmp# ./sbf_flash SPRecovery_ESE81.sbf
SBF FLASH 1.08 (mbm)

Index[1]: Unexpected chip 16
Index[2]: Unexpected chip 16
=== SPRecovery_ESE81.sbf ===
00: RDL03 0x80500000-0x8054CFFF FE66 AP
01:  CG35 0xC0680000-0xC08E37FF ABCB AP
02:  CG47 0xC0A00000-0xC0D5C7FF 02C0 AP

Droid found.
 >> uploading RDL03
Uploading: 100% OK
 >> verifying ramloader
 -- OK
 >> executing ramloader
 >> waiting for phone:

…and there it would sit. I tried this a couple of times each time with the same result.

The few pages that google returned didn’t quite get me there and then I noticed something strange in the VMWare window. The USB button at the bottom of the window was grayed out where before it was black:

VMWare USB Button

I clicked on the button and started again.

This time, when the waiting for phone: appeared I clicked the USB button to enable USB and the process completed.

[email protected]:/tmp# ./sbf_flash SPRecovery_ESE81.sbf
SBF FLASH 1.08 (mbm)

Index[1]: Unexpected chip 16
Index[2]: Unexpected chip 16
=== SPRecovery_ESE81.sbf ===
00: RDL03 0x80500000-0x8054CFFF FE66 AP
01:  CG35 0xC0680000-0xC08E37FF ABCB AP
02:  CG47 0xC0A00000-0xC0D5C7FF 02C0 AP

Droid found.
 >> uploading RDL03
Uploading: 100% OK
 >> verifying ramloader
 -- OK
 >> executing ramloader
 >> waiting for phone: Droid found.
 >> sending erase
 >> uploading CG35
Uploading: 100% OK
 >> uploading CG47
Uploading: 100% OK
 >> verifying CG35
 -- OK
 >> verifying CG47
 -- OK
 >> rebooting
[email protected]:/tmp#

Note above where waiting for phone: is shown is where the USB button turned gray. When I clicked the USB button is where Droid found. appeared and the rest of the output followed.

android

r cannot be resolved

In the Google group Android Beginners I frequently see messages that ask what the error "r cannot be resolved" means in Eclipse.

Eclipse generates the file R.java for you using the aapt tool (Official Guide to the Android Asset Packaging Tool). R.java contains a mapping to all the resources your application will use. Note that you should have the Build Automatically option under the Project menu checked on.

If this happens to you, make sure the files under res/ are valid (make sure they are not marked invalid in Eclipse). Since aapt generates R.java from the files in res/ if those files are mucked aapt can’t work.

An example of an aapt generated R.java file:

  /* AUTO-GENERATED FILE.  DO NOT MODIFY.
   *
   * This class was automatically generated by the
   * aapt tool from the resource data it found.  It
   * should not be modified by hand.
   */

  package com.likethecolor.android.helloandroid;

  public final class R {
      public static final class attr {
      }
      public static final class drawable {
          public static final int icon=0x7f020000;
      }
      public static final class layout {
          public static final int main=0x7f030000;
      }
      public static final class string {
          public static final int app_name=0x7f040001;
          public static final int hello=0x7f040000;
      }
  }

While I use Eclipse for my Android development it is always good to know how things work behind the scenes. I’ve tried to find a more detailed description of how aapt creates R.java but can find nothing more than a vague description:

From: http://developer.android.com/guide/tutorials/notepad/notepad-ex1.html

The folders under res/ in the Eclipse project are for resources. There is a specific structure to the folders and files under res/. Resources defined in these folders and files will have corresponding entries in the R.class allowing them to be easily accessed and used from your application. The R.class is automatically generated using the contents of the res/ folder by the eclipse plugin (or by aapt if you use the command line tools). Furthermore, they will be bundled and deployed for you as part of the application.

This is how one might run aapt from command line (note that this command must be run from the top level of your project):

  aapt package -m -J src -M AndroidManifest.xml -S res -I /platforms/android-2.0/android.jar

While doing a clean project and build project has always worked for me, this site suggested clicking on "Fix Project Properties" which appears under "Android Tools" when right/ctrl-clicking on the project in the package explorer.

Another possibility is that when creating a new source file your IDE (e.g., eclipse) may have added

  import android.R;

That may be fine if you actually have a package called android in which there is a class R but that’s probably not the case. Removing that import would solve the problem.

%d bloggers like this: