Questions tagged [resources]

Assets (like memory, disk space, CPU power or alike) necessary for effective operation or physical files (like images, configuration files or other) to provide some externalized enrichment to an application.

Typically resources are materials or other assets that are transformed to produce benefit and in the process may be consumed or made unavailable

9303 questions
72
votes
8 answers

How can I detect which layout is selected by Android in my application?

Assume I have an activity with three different layouts in different resource folders. For example: layout-land/my_act.xml layout-xlarge/my_act.xml layout-xlarge-land/my_act.xml In different devices and different positions one of them is selected…
Bob
  • 22,810
  • 38
  • 143
  • 225
71
votes
12 answers

Android/Eclipse: how can I add an image in the res/drawable folder?

I am completely new with Android/Eclipse. I can't figure out how to add an image in the /res/drawable folder of my Android Eclipse project.
toto_tata
  • 14,526
  • 27
  • 108
  • 198
71
votes
4 answers

Managing resources in a Python project

I have a Python project in which I am using many non-code files. Currently these are all images, but I might use other kinds of files in the future. What would be a good scheme for storing and referencing these files? I considered just making a…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
70
votes
10 answers

How can I access ResourceDictionary in wpf from C# code?

I have a DataTemplate defined in a xaml file that I want to access via C# code. Can anyone please tell me how can I access it? I added a new ResourceDictionary file and its name is Dictionary1.xaml. I have a data template such…
Embedd_0913
  • 16,125
  • 37
  • 97
  • 135
68
votes
3 answers

Android Resource IDs

I'm retrieving custom Resource IDs from a custom xml view type. I'm asked to specify a default int value for the retrieval and was wondering what is the range of IDs? Are they always positive or do they include zero?? i.e is -1 a valid "null"…
Kurru
  • 14,180
  • 18
  • 64
  • 84
67
votes
2 answers

Ruby on rails: singular resource and form_for

I want user to work with only one order connected to user's session. So I set singular resource for order routes.rb: resource :order views/orders/new.html.erb: <%= form_for @order do |f| %> ... <% end %> But when I open the new order page I get…
petRUShka
  • 9,812
  • 12
  • 61
  • 95
66
votes
3 answers

UriFormatException : Invalid URI: Invalid port specified

The assembly qualified string used as a parameter below for a Uri works in XAML, but gives me the error shown when used in code. I tried every kind of UriKind with the same result. How can I fix this? [Test] public void…
Berryl
  • 12,471
  • 22
  • 98
  • 182
66
votes
2 answers

Load properties file in JAR?

I'm having trouble when one of the jars that my web app depends on tries to load a properties file from within the jar. Here is the code in the jar. static { Properties props = new Properties(); try { …
Andy
  • 8,841
  • 8
  • 45
  • 68
65
votes
8 answers

Resources for lexing, tokenising and parsing in python

Can people point me to resources on lexing, parsing and tokenising with Python? I'm doing a little hacking on an open source project (hotwire) and wanted to do a few changes to the code that lexes, parses and tokenises the commands entered into it. …
Hamish Downer
  • 16,603
  • 16
  • 90
  • 84
65
votes
4 answers

Adding resource files to xcode

I'm trying to add some new resource files to a project which was build by another person on another mac. I think that the project has the provision of the previous person. Using right click->Add Files to "MyProject" doesn't provide the expected…
dole doug
  • 34,070
  • 20
  • 68
  • 87
64
votes
4 answers

How to reference CSS / JS / image resource in Facelets template?

I've done tutorial about Facelets templating. Now I've tried to create a page that isn't in same directory as the template. I've got problems with page style, because of styles are referenced with relative path like so:
kravemir
  • 10,636
  • 17
  • 64
  • 111
64
votes
3 answers

Java: Which of multiple resources on classpath JVM takes?

If I have multiple files of the same name on classpath (e.g. I have multiple .jar with log4j.properties), what are the rules JVM follows to chose one?
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
64
votes
9 answers

How do I read a resource file from a Java jar file?

I'm trying to access an XML file within a jar file, from a separate jar that's running as a desktop application. I can get the URL to the file I need, but when I pass that to a FileReader (as a String) I get a FileNotFoundException saying "The file…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
64
votes
3 answers

Eclipse/Java - Values in R.string.* return int?

I thought I'd be classy and use the string.xml file to define some constant strings for things like exception messages. In strings.xml I hit Add, chose the "String" option (not 'String Array'), then gave it a name and value. I was surprised to see…
James Cadd
  • 12,136
  • 30
  • 85
  • 134
63
votes
32 answers

AAPT error: resource drawable/... not found

After recently upgrading my android studio, I am not able to build my project anymore. Every time I execute a build, I am struck with the following error: error: resource drawable/splash_screen (aka…
Lucas Romier
  • 1,291
  • 1
  • 13
  • 22