title: Use "sp" in Android NDK
body: <p>I'm trying to intercept some native library-calls via LD_PRELOAD.</p>
  
  <p>This is working fine for simple libraries written in C, but now I try to go further and override some more complex class-methods from the AOSP written in C++.</p>
  
  <p>Here's my example:</p>
  
  <pre><code>#include &lt;rs/cpp/util/RefBase.h&gt;
  
  namespace android {
      sp&lt;MediaCodec&gt; MediaCodec::CreateByType(const sp&lt;ALooper&gt; &amp;looper, const char *mime, bool encoder) {
          // TODO this will be implemented by me
          return NULL;
      }    
  }
  </code></pre>
  
  <p>In my Application.mk, I got the following piece of code:</p>
  
  <pre><code>APP_STL := gnustl_static
  </code></pre>
  
  <p>and inside the Android.mk this one:</p>
  
  <pre><code>LOCAL_STATIC_LIBRARIES += libstlport_static
  </code></pre>
  
  <p>Sadly, the error I get is the following:</p>
  
  <blockquote>
    <p>jni/libhook/ld_preload.cpp:88:1: error: 'sp' does not name a type</p>
  </blockquote>
  
  <p>Anyone an idea how to use sp&lt;..> here? I assume it's not Android-specific but a standard C++-thing - I'm totally new at C++, just started "today" :)</p>
  
  <p>I know this may be bad practice, so I'm welcome for any other idea.</p>