开发者

monodroid: how to create receiver/meta-data clause in manisfest.xml

I note the the mono android port of the SDK API Demos does not include the DeviceAdministration pieces.

Is this because it (DeviceAdmin)开发者_StackOverflow社区 doesnt work? I have tried to make a small sample app and have not succeeded.

EDIT: Well I got a fair way in, now my problem is that I cannot generate the receiver/meta-data clause

I am on my way to writing my own aapt.exe to intercept the xml file on its way through this seems like a lot of heavy lifting


You can use the [BroadcastReceiverAttribute] custom attribute to generate the <receiver/> element, and you can use the [MetaDataAttribute] custom attribute to generate the <meta-data/> element:

[BroadcastReceiver]
[MetaData ("foo", Value="bar")]
public class MyReceiver : BroadcastReceiver {
}

Would generate the XML fragment within AndroidManifest:

<receiver android:name="generated-by-mandroid">
    <meta-data android:name="foo" android:value="bar" />
</receiver>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜