Friday, March 7, 2014

Use jar package resource id problem


A project is packaged as a A.jar output package that contains the resource. Reference the jar in another project B, but the code can not be used directly inside A.jar resources, such as direct use of AR ... the resource id will not find the resource. But we can use Android.jar resource id, such as android.R.string.VideoView_error_button, etc., may be used directly in the code.
Android.jar not know how to do?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Nobody knows?
Reply:
Top landlord for solving ~ hehe
Reply:
Up!
Reply:
It seems that this question is a bit difficult
Reply:
Attention to the next!
Reply:
Concern. .
Reply:
Binding! Concerned about learning!
Reply:
Android.jar the resource id number is fixed, so it will not say when referring to the resource can not be found
Our compiled once every resource id have to re-generate an id number
Reply:
Open the jar package to see the package name you use rar There are no wrong references
Reply:
reference to the 8th floor wenzheng38 reply:
Android.jar the resource id number is fixed, so do not say that the resource can not be found
Our compiled once every resource id have to re-generate an id number

And this should be okay. After labeled jar package, jar package inside the resource id is fixed.

I recently go to android, android under study component development encountered this problem. By components packaged into a jar to achieve, but generally require jar can not contain resources. But Android.jar which contains resources, and can be directly referenced by id. If our own components can do, and that their development android components will not face restrictions.
Reply:
After the application of the general resources are not packaged in *. Jar in,
In the *. Dex just have R.java in the R.class,
Actual resource is not *. Jar or *. Dex in.
Resources and *. Dex packaged together became *. Apk.
So *. Jar, and is not a reference to the actual resources.
Here you can see the details in the build section on android sdk program.

Also, in addition to a similar framework of android.jar general public outside of the package so it is not recommended to refer to other resources in the package. From the package and coupling procedure can be seen in this point.
Reply:
Packaged when the resources are packaged in a jar, but not directly referenced by id.
Here are just discuss why android.jar can do, and we do not develop their own jar, the package does not involve procedural issues, and resources could be shared use.
In fact, a more general problem is, jar package contains Activity, But Activity in the direct use of resource id code to be wrong, for example, setContentView (R.layout.main);
Hoping to find a better way to solve similar problems.

Reply:
reference to the 12th floor yy4040 reply:
is packaged when resources are packaged into the jar, but not directly referenced by id.
Here are just discuss why android.jar can do, and we do not develop their own jar, the package does not involve procedural issues, and resources could be shared use.
In fact, a more general problem is, jar package contains Activity, But Activity in the direct use of resource id code to be wrong, for example, setContentView (R.layout.main);
Hoping to find a better ......

Also encountered this problem, solved!
Reply:
I am here right resources are deleted, direct play out jar package, and then put the resource files are overwritten first program resources, and of course, the best resource you prefix ~
Reply:
Busy working some time ago, did not further study.
Now it seems difficult to solve this problem.
When speculation started on the JVM loaded Android.jar all classes, while loaded with which resources. However, when the user's jar is loaded, does not automatically load resources, so only jar package system resources can be used.
There seems to be a solution, and later left to have time to study the next source.
Reply:
Results posted this question.
See http://blog.csdn.net/yy4040/article/details/6641688
Reply:
This issue of great value, we top up ah
Reply:
Wood there a better way to change this id reference to it
Reply:
111111
Reply:
Support ah hope to have more insight to comment
Reply:
I have encountered similar problems, big head
Reply:
Time of day did not come out of this problem, what should complain boss estimate
Reply:
Use dynamic layout, my ok the
Reply:
Android.jar reason I can, I looked at it references id is @ id, rather than the @ + id, id all ids.xml which are written in this document are also in the simulator, so I guess every This mobile platform will have the following.
Reply:
reference to the 24th floor kjsolo reply:
Android.jar reason why you can, I looked at, it refers id is @ id, rather than the @ + id All are written in ids.xml id inside the file in the simulator there, so I guess every mobile platform will have the following.

ids.xml document what position in the simulator, thank you!
Reply:
Used public.xml. Edge of the id write here. Editing time can be found.
Reply:
I feel android.jar been able to use their own resources, and not because android.jar apk run on one level, he was the first to be deployed in all the apk using the system, in fact, it should be between the middle Linix with Java layers. Apk is supporting all trays

No comments:

Post a Comment