-
Book Overview & Buying
-
Table Of Contents
Xamarin Mobile Development for Android Cookbook
By :
Almost all apps include some sort of content with the app package; it can be a database, image, or just plain text.
We can only get read-only access to bundled assets and resources but that is often all that is needed, as most app data comes from other sources such as the Internet or device sensors. We will create and add three basic types or resources by performing the following steps:
Starting with assets, create a folder named Assets at the root of the project.
Create a new file in the new Assets folder and save some text into that file, for example, a file named MyAsset.txt with the following contents:
Hello Asset World!
Now, mark the file as an asset by selecting the file. In the Properties pane, select AndroidAsset from the Build action dropdown.
Next, for raw resources, create a folder named raw in the Resources folder.
In the new raw folder, again create and save any text file, for example, a file named MyRaw.txt with the following contents...
Change the font size
Change margin width
Change background colour