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-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable-hdpi/
icon.png
drawable-ldpi/
icon.png
drawable-mdpi/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action 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 strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
使用Mono for Android进行程序开发,为在程序中增加数据推送的功能,选用了JPush(极光推送)来实现,经过上网查找,借助于官方文档,最终实现了JPush的集成。本例以JPush SDK1.6.1、Mono for Android 4.10.x为例,说明如何将JPush库集成到Mono for Android程序中。 文档参见: http://blog.csdn.net/xaccc/article/details/26155561
资源推荐
资源详情
资源评论
收起资源包目录
jpush_M4A.zip (22个子文件)
JPushBindingLibrary
JPushBindingLibrary.csproj 3KB
JPushBindingLibrary.sln 2KB
Properties
AssemblyInfo.cs 1KB
Additions
AboutAdditions.txt 1KB
libs
armeabi-v7a
libjpush.so 117KB
armeabi
libjpush.so 117KB
JPushBindingLibrary.suo 26KB
obj
Transforms
Metadata.xml 475B
EnumFields.xml 643B
EnumMethods.xml 506B
bin
jars
jpush-sdk-release1.6.1.jar 224KB
AboutJars.txt 745B
JPushAndroidApplication
Assets
AboutAssets.txt 620B
Resources
AboutResources.txt 2KB
Layout
Main.axml 424B
Drawable
Icon.png 4KB
Resource.Designer.cs 2KB
Values
Strings.xml 194B
Properties
AssemblyInfo.cs 1KB
AndroidManifest.xml 4KB
Activity1.cs 1KB
obj
JPushAndroidApplication.csproj 4KB
bin
共 22 条
- 1
xaccc
- 粉丝: 4
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页