aboutsummaryrefslogtreecommitdiff
path: root/WatercolorGames.Pong/Resources/AboutResources.txt
diff options
context:
space:
mode:
authorThe Fuzzy Riolu <[email protected]>2018-03-12 11:52:38 -0400
committerThe Fuzzy Riolu <[email protected]>2018-03-12 12:02:33 -0400
commit40d01342d00c57dce5069e53a455db048a2967d5 (patch)
tree99e64bed61317a564253e456e2aa45fba3c0c6ec /WatercolorGames.Pong/Resources/AboutResources.txt
parentcdb0da6c34228a4034dbe179dc268aaded532619 (diff)
downloadshiftos-pong-master.tar.gz
shiftos-pong-master.tar.bz2
shiftos-pong-master.zip
Initial commitHEADmaster
Diffstat (limited to 'WatercolorGames.Pong/Resources/AboutResources.txt')
-rw-r--r--WatercolorGames.Pong/Resources/AboutResources.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/WatercolorGames.Pong/Resources/AboutResources.txt b/WatercolorGames.Pong/Resources/AboutResources.txt
new file mode 100644
index 0000000..b0fc999
--- /dev/null
+++ b/WatercolorGames.Pong/Resources/AboutResources.txt
@@ -0,0 +1,44 @@
+Images, layout descriptions, binary blobs and string dictionaries can be included
+in your application as resource files. Various Android APIs are designed to
+operate on the resource IDs instead of dealing with images, strings or binary blobs
+directly.
+
+For example, a sample Android app that contains a user interface layout (Main.xml),
+an internationalization string table (Strings.xml) and some icons (drawable/Icon.png)
+would keep its resources in the "Resources" directory of the application:
+
+Resources/
+ Drawable/
+ Icon.png
+
+ Layout/
+ Main.axml
+
+ Values/
+ Strings.xml
+
+In order to get the build system to recognize Android resources, the build action should be set
+to "AndroidResource". The native Android APIs do not operate directly with filenames, but
+instead operate on resource IDs. When you compile an Android application that uses resources,
+the build system will package the resources for distribution and generate a class called
+"Resource" that contains the tokens for each one of the resources included. For example,
+for the above Resources layout, this is what the Resource class would expose:
+
+public class Resource {
+ public class Drawable {
+ public const int Icon = 0x123;
+ }
+
+ public class Layout {
+ public const int Main = 0x456;
+ }
+
+ public class String {
+ public const int FirstString = 0xabc;
+ public const int SecondString = 0xbcd;
+ }
+}
+
+You would then use Resource.Drawable.Icon to reference the Drawable/Icon.png file, or
+Resource.Layout.Main to reference the Layout/Main.axml file, or Resource.String.FirstString
+to reference the first string in the dictionary file Values/Strings.xml. \ No newline at end of file