title: Access graphics from drawable folder of a dynamic feature module from main module
body: <p>I'm getting my feet wet with dynamic module split API delivery in order to break up my game app into Instant and Installable versions. I've been following the Codelabs tutorial here <a href="https://codelabs.developers.google.com/codelabs/on-demand-dynamic-delivery/index.html#0" rel="noreferrer">https://codelabs.developers.google.com/codelabs/on-demand-dynamic-delivery/index.html#0</a>. Unfortunately it uses Kotlin for the MainActivity code, which is less specific than Java, but still fairly followable if you've done a Kotlin tutorial. The example includes accessing a text tile in an 'assets' folder in an 'assets' feature module with the following:</p>
  
  <pre><code>private const val packageName = "com.google.android.samples.dynamicfeatures.ondemand"
  
  val assetManager = createPackageContext(packageName, 0).assets
  // Now treat it like any other asset file.
  val assets = assetManager.open("assets.txt")
  val assetContent = assets.bufferedReader()
             .use {
                 it.readText()
             }
  </code></pre>
  
  <p>For now I just want to access graphic files in a drawable folder of my dynamic feature module. I'll only be using my dynamic feature module to store large graphics that would take me over the 10 MG limit for an Instant app download. What would be the cleanest way to do this?</p>
  
  <p>Main 'app' module:</p>
  
  <p><a href="https://i.stack.imgur.com/HK0mt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HK0mt.png" alt="enter image description here"></a></p>
  
  <p>Java code in 'app':</p>
  
  <pre><code>loadTexture(R.drawable.aaa_image);
  
  Bitmap bitmap;
  public void loadTexture(final int resourceId){
      bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId, options);
      ***
  </code></pre>
  
  <p>Dynamically delivered 'installationassets' module:</p>
  
  <p><a href="https://i.stack.imgur.com/iEycB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iEycB.png" alt="enter image description here"></a></p>
  
  <p>Still java code in 'app', won't reach:</p>
  
  <pre><code> loadTexture(R.drawable.testgraphic);
   cannot resolve symbol 'testgraphic'
  </code></pre>