Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Sectioned ListView for Android Using Mono C#

, 14 Mar 2013
Develop a Preferences style sectioned list adapter using Android Mono C#.
foodtypesectionlist_4.0.3.zip
FoodTypeSectionList
FoodTypeSectionList
Assets
bin
Release
FoodTypeSectionList.dll
FoodTypeSectionList.pdb
obj
Debug
android
assets
bin
classes
foodtypesectionlist
Activity1.class
foodtypesectionlist
R$attr.class
R$drawable.class
R$id.class
R$layout.class
R$string.class
R.class
FruitTypeListAdapter.class
JavaObjectHandler.class
MeatTypeListAdapter.class
SectionedListAdapter.class
VegetableTypeListAdapter.class
mono
android
Seppuku.class
MonoPackageManager.class
MonoPackageManager_Resources.class
MonoRuntimeProvider.class
classes.dex
FoodTypeSectionList.FoodTypeSectionList.apk
mono.android.jar
packaged_resources
resources_and_assemblies
foodtypesectionlist
foodtypesectionlist
src
foodtypesectionlist
foodtypesectionlist
mono
android
DesignTimeResolveAssemblyReferencesInput.cache
FoodTypeSectionList.dll
FoodTypeSectionList.pdb
R.cs.flag
res
drawable
icon.png
layout
main.axml
values
TempPE
__library_projects__
Release
android
assets
FoodTypeSectionList.dll
Mono.Android.dll
Mono.Android.dll.mdb
Mono.Security.dll
Mono.Security.dll.mdb
mscorlib.dll
mscorlib.dll.mdb
System.Core.dll
System.Core.dll.mdb
System.dll
System.dll.mdb
bin
classes
foodtypesectionlist
Activity1.class
foodtypesectionlist
R$attr.class
R$drawable.class
R$id.class
R$layout.class
R$string.class
R.class
FruitTypeListAdapter.class
JavaObjectHandler.class
MeatTypeListAdapter.class
SectionedListAdapter.class
VegetableTypeListAdapter.class
mono
MonoPackageManager.class
MonoPackageManager_Resources.class
MonoRuntimeProvider.class
classes.dex
mono.android.jar
packaged_resources
foodtypesectionlist
foodtypesectionlist
src
foodtypesectionlist
foodtypesectionlist
mono
assemblies
FoodTypeSectionList.dll
Mono.Android.dll
Mono.Android.dll.mdb
Mono.Security.dll
Mono.Security.dll.mdb
mscorlib.dll
mscorlib.dll.mdb
System.Core.dll
System.Core.dll.mdb
System.dll
System.dll.mdb
System.Xml.dll
System.Xml.dll.mdb
DesignTimeResolveAssemblyReferencesInput.cache
FoodTypeSectionList.dll
FoodTypeSectionList.pdb
link.flag
R.cs.flag
res
drawable
icon.png
layout
main.axml
values
TempPE
__library_projects__
Properties
Resources
Drawable
Icon.png
Layout
Main.axml
Values
FoodTypeSectionList.suo
FoodTypeSectionList_4_0_3_clean-noexe.zip
Icon.png
Main.axml
FoodTypeSectionList_4_0_3_clean.zip
FoodTypeSectionList.dll
Icon.png
Main.axml
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.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

stebo0728

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 14 Mar 2013
Article Copyright 2012 by stebo0728
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid