Add elevation/shadow on toolbar for pre-lollipop devices

For Android 5.0 and above : AppBarLayout automatically provides/gives shadow in the layout. You can also increase the elevation of the AppBarLayout by app:elevation=”4dp”. For Pre-Lollipop : You can use the following link: https://github.com/vipulasri/Toolbar-Elevation-Pre-Lollipop Note: Toolbar also supports elevation to it, using android:elevation=”4dp” New Update: In Appcompat v24.0.0, you can not set elevation to AppBarLayout … Read more

Xamarin.Android Proguard – Unsupported class version number 52.0

You need to update the default Android SDK proguard.jar with the latest version of Proguard found here: https://sourceforge.net/projects/proguard/files/ I would recommend that you install this on the side of the default version that Android ships in android-sdk\tools\proguard. Simply rename the existing folder to something else and add the new version of proguard. This is listed … Read more

How do I launch multiple instances of Xamarin Studio on the Mac (Visual Studio for Mac)? [duplicate]

Just want a tool? If you just want to download something that does this for you, there is also the MS Solution Launcher or the older Xamarin Studio Launcher v3. Presumably, it does something similar to the script below but comes in a nice pre-built app with a distinct icon you just copy to your … Read more

Whats the difference between Java.Net.Uri and Android.Net.Uri

The difference is that Android.Net.Uri is Google’s own implementation of RFC 2396. Android.Net.Uri is immutable, hence it is thread-safe. Their implementation is also, according to the comments in the source, more forgiving. So while Java.Net.Uri would throw an Exception you attempt to use a garbage Uri, the Android implementation would just return you a Uri … Read more

Adding a button to the title bar Xamarin Forms

Use ToolbarItem from YourPage.xaml.cs: ToolbarItems.Add(new ToolbarItem(“Search”, “search.png”,() => { //logic code goes here })); In Xaml: <ContentPage.ToolbarItems> <ToolbarItem Icon=”search.png” Text=”Search” Clicked=”Search_Clicked”/> </ContentPage.ToolbarItems> Update Xamarin.Forms introduced TitleView in 3.2.0 that you can customize title of the navigation. <ContentPage xmlns=”http://xamarin.com/schemas/2014/forms” xmlns:x=”http://schemas.microsoft.com/winfx/2009/xaml” x:Class=”TestPage”> <NavigationPage.TitleView> <Button … /> </NavigationPage.TitleView> … </ContentPage>

Warning major version 52 is newer than 51, the highest major version supported by this compiler

I was having the same issue, and tearing my hair out. I had the JDK Version 8 installed, but these warnings wouldn’t go away, and eventually they generated a build-breaking error. When I went to Tools -> Options -> Xamarin, and looked at the Android Settings, the Java Development Kit Location was pointing to jdk.1.7.xxxx, … Read more

Anyone have experience with architecture for cross platform WP7 Android iOS mobile development (monotouch, monodroid, C#)

You might want to look into the MonoCross project which is designed to help you reuse C# code with multiple presentation layers: http://code.google.com/p/monocross/ The authors of MonoCross (ITR Mobility) have created multiple mobile cross platform solutions for a variety of customers and have written two books on the subject one is “iPad in the Enterprise” … Read more

How do I use SharedPreferences in Xamarin.Android?

The Xamarin.Android equivalent of SharedPreferences is an interface called ISharedPreferences. Use it in the same way, and you will be able to easily port Android code across. For example, to save a true/false bool using some Context you can do the following: ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences (mContext); ISharedPreferencesEditor editor = prefs.Edit (); editor.PutBoolean (“key_for_my_bool_value”, mBool); … Read more