rudyryk
rudyryk

Reputation: 3805

In Xamarin Android how is AssemblyInfo.cs related to AndroidManifest.xml?

I find it confusing that Xamarin docs examples suggest adding permissions to AssemblyInfo.cs like that:

// Need to access the internet for GCM
[assembly: UsesPermission(Name = "android.permission.INTERNET")]

Why? Permissions are usually defined in AndroidManifest.xml and there's even GUI for that in Xamarin Studio.

Also seems like AssemblyInfo.cs contains information about title and version:

[assembly: AssemblyTitle("MyApp")]
[assembly: AssemblyVersion("1.0.0")]

What does that mean? AndroidManifest.xml also contains title and version info.

How are they related? Seems to be basic knowledge, but didn't found clear explanation about that.

Upvotes: 7

Views: 5111

Answers (2)

Floris Devreese
Floris Devreese

Reputation: 3667

AssemblyInfo.cs generates elements that are inserted into AndroidManifes.xml.

More info in the official documentation.

Upvotes: 0

Anon Dev
Anon Dev

Reputation: 1411

Xamarin just added this way as another way to add permissions but at assembly level, if you do not use it no problem!, you can continue setting the permissions as usual in the AndroidManifest.xml. Reference in this link

Upvotes: 9

Related Questions