The R file is supposed to be auto-generated.. you're not supposed to share 
it... I'm not actually sure why you're doing all of this... if you mark 
your project as an android library it does exactly that (build a jar file 
with all of the resources which can be used in any other project). 

You should also follow the ADT dev site, they are working on a build system 
that will make it even easier (i'm not sure how final it is.. haven't dealt 
with in a while).

On Monday, March 11, 2013 11:22:20 AM UTC+2, Mr cool wrote:
>
> I have planned to create an SDK in android, that means to share my class 
> files and resource(layouts) to another application that requires them. If I 
> export my application as JAR it does not include the resource files and 
> R.class. I know currently Android does not support to packaging resource 
> file via JAR but I searched the net and found one solution if compile our 
> resource files with source code means we can access the resource in some 
> other application.
>
> So for that reason I did it in the following way:
>
>     1.copied all res folders content  into  my source folder 
>     src
>       ->com.mypackege
>         -> res--->here i put my res folder
>     2.finally my src folder look like
>             src 
>              >com.mypackage
>               
>                >myfile.java
>               drawable-hdpi
>               drawable-ldpi
>               drawable-mdpi
>               drawable-xhdpi
>               com.mypackage.drawable
>               com.mypackage.layout
>               com.mypackage.menu
>               com.mypackage.values
>              
>     3. and i build my project i got all class files including resource and 
> r.class in my bin
>     
>     4.then i create jar manually by jar -cvf mysample.jar com/mypackage/*
>     
>     5.the final jar contain all classes and resource of my project in side 
> mypackage.
>
> then I add `mysample.jar` into another application say `testapp`, here I 
> put the JAR in asset folder(because of layout )and add to build path. And 
> also I configure the build path
>
> In this application I call the `myfile.class` from `mysample.jar` which is 
> needed to load the layout from that JAR.
>
> The problem is here it doesn't see resource under the JAR file it only see 
> the resource in current project res folder and though `NULL pointer 
> Exception`
>
> But it calls the R.java from JAR file. Ad also i tried to put 
> xmlns:custom="http://schemas.android.com/apk/res-auto"; in my manifest 
> file it is also not working.
> I hope I exactly come to close this issue, it may be a resource mapping 
> problem.
> do you have any idea to resolve this? 
>
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to