How to make the R.java has different values in 2 android application?
<p>I'm writing a plugin-enabled android application here.
I have 2 applications(2 apk), one is main program and another is a plugin.</p>

<p>Now I want the plugin constructs it's own interface in main program's Activity. But I found the R.java in 2 applications has the same values:</p>

<p>The R.java in plugin:</p>

<pre><code>public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int icon=0x7f020000;
    }
    public static final class id {
        public static final int button1=0x7f050000;
        public static final int button2=0x7f050001;
    }
    public static final class layout {
        public static final int widget=0x7f030000;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
        public static final int button1text=0x7f040001;
        public static final int button2text=0x7f040002;
    }
}
</code></pre>

<p>And, R.java of main program:</p>

<pre><code>public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int icon=0x7f020000;
    }
    public static final class id {
        public static final int mainWidgetLayout=0x7f050000;
    }
    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;
    }
}
</code></pre>

<p>Just as you can see, there are a lot of same values in these 2 R.java, this makes chaos. In plugin, if I wanna construct the interface via resource defined in R.java, it may refer to the same value in main program resource.</p>

<p>So, how to handle this? Is it possible to make the 2 R.java in 2 applications have different values?
Thanks a lot. Any suggestions are appreciated.</p>
