Re: [android-developers] How to avoid resource overriding in Android ?
Thanks for reply, I got the direction but not getting how to achieve this, as I am writing code like this in library project. ImageView mImageView = new ImageView(); mImageView.setImageResources(R.drawable.splash_screen); My all code is present in Library project, my Main project having only string file. that contains project related values. In this case how to write code for pass by parameters ? any sample we will relay helpful. Thanks Makrand On Wednesday, November 7, 2012 9:34:54 PM UTC+5:30, casantos wrote: On Wed, Nov 7, 2012 at 10:20 AM, Makrand makra...@gmail.com javascript: wrote: I am working on Android Project, to avoid duplication of files I am using library project, but I have observed that library project is following overriding concept, First it will check resources files in Main Project if its not there then it will look in to library project. for eg. My show splash screen code is in Library project so I have to incude splash screen image into Library project as well as in Main Project. I need to add resources for two time. because when I run that project I want splash screen icons of my new project not of library project. anyhow I can't publish library project but still I need to add resources such as slash screens, icon, etc in library project otherwise it will give an compile time error. My all code is in Library project, so I need to provide all huge resources to it and new Main project also contains such different huge resources files. Its increasing my application size unnecessary. Is there any way to avoid overriding resources files? Can I share only common resources between projects? instead of all resource files. How I can share only resources across the projects ? You should solve this by means of better design. Do not hard-code the resource id in the library code. Let it be a parameter that you pass at run-time from the code in you app project. -- The flames are all long gone, but the pain lingers on -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to avoid resource overriding in Android ?
You could include just 1px x 1px resources with the correct names on the library. Marina El 07/11/2012 09:20, Makrand makrandm...@gmail.com escribió: I am working on Android Project, to avoid duplication of files I am using library project, but I have observed that library project is following overriding concept, First it will check resources files in Main Project if its not there then it will look in to library project. for eg. My show splash screen code is in Library project so I have to incude splash screen image into Library project as well as in Main Project. I need to add resources for two time. because when I run that project I want splash screen icons of my new project not of library project. anyhow I can't publish library project but still I need to add resources such as slash screens, icon, etc in library project otherwise it will give an compile time error. My all code is in Library project, so I need to provide all huge resources to it and new Main project also contains such different huge resources files. Its increasing my application size unnecessary. Is there any way to avoid overriding resources files? Can I share only common resources between projects? instead of all resource files. How I can share only resources across the projects ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com 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 post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to avoid resource overriding in Android ?
On Wed, Nov 7, 2012 at 10:20 AM, Makrand makrandm...@gmail.com wrote: I am working on Android Project, to avoid duplication of files I am using library project, but I have observed that library project is following overriding concept, First it will check resources files in Main Project if its not there then it will look in to library project. for eg. My show splash screen code is in Library project so I have to incude splash screen image into Library project as well as in Main Project. I need to add resources for two time. because when I run that project I want splash screen icons of my new project not of library project. anyhow I can't publish library project but still I need to add resources such as slash screens, icon, etc in library project otherwise it will give an compile time error. My all code is in Library project, so I need to provide all huge resources to it and new Main project also contains such different huge resources files. Its increasing my application size unnecessary. Is there any way to avoid overriding resources files? Can I share only common resources between projects? instead of all resource files. How I can share only resources across the projects ? You should solve this by means of better design. Do not hard-code the resource id in the library code. Let it be a parameter that you pass at run-time from the code in you app project. -- The flames are all long gone, but the pain lingers on -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en