title: Android Assets and NDK
body: <p>I'm trying to read a simple text file from my native code.</p>
  
  <ol>
  <li>I placed file.txt under assets folder</li>
  <li><p>In my activity I'm creating asset manager: <code>assetManager = getAssets();</code>
  Then I'm passing the assetManager to my native method and(as in the native audio example):</p>
  
  <pre><code>AAssetManager* mgr = AAssetManager_fromJava(env, assetManager);
  AAsset* asset = AAssetManager_open(mgr, "file.txt", AASSET_MODE_UNKNOWN);
  AAssetManager* mgr = AAssetManager_fromJava(env, assetManager);
  
  off_t start, length;
  
  int fd = AAsset_openFileDescriptor(asset, &amp;start, &amp;length);   
  </code></pre></li>
  </ol>
  
  <p>The problem is that <code>fd</code> is smaller than 0!!!</p>
  
  <p>Can anyone help on this?</p>