Recent articles


System.IO.PathTooLongException: The specified path, file name, or both are too long.

Posted by seven.srikanth@gmail.com at 30 Nov 2017 in Errors


Got error when I run a freshly created a Xamarin Cross Platforms app.
Full Error:
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
This issue occurred because the path of the application you created is having so many folders and exceeds 260.
So I just moved that to a different and shorter path, which has resolved my issue.
Old Path: C:\Users\Srikanth\Documents\Visual Studio 2017\Projects\WaterBookingApp
New Path: C:\Temp\WaterBookingApp
Hope this helps.

Tags: System.IO.PathTooLongException




Android Emulator not showing in visual studio 2017

Posted by seven.srikanth@gmail.com at 30 Nov 2017 in Errors


I've seen this issue after repairing my Visual Studio 2017.



In order to fix this, you need to try the following.
Tools > Android > Restart Adb Server
Hope this will fix your issue. 

Tags: Android Emulator; visual studio 2017;




How to create a Circle Button in Xamarin Android?

Posted by seven.srikanth@gmail.com at 25 Nov 2017 in Tutorials


Hi All, 
Below example will help you to create a Circle button in Xamarin Android Project. 
Just like below.
Step 1:
File: Resources\Layout\Main.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        android:layout_gravity="right"
        android:layout_weight="0"
        android:padding="10dp">
        <Button
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/circle_button"
            android:layout_gravity="end"
            android:text="Edit"
            style="@style/CircleButton"
            android:drawableTop="@drawable/EditSmall"
            android:padding="15dp"
            android:textSize="7dp" />
    </LinearLayout>
</LinearLayout>
Mind that android:drawableTop="@drawable/EditSmall" in above code points to an Image. In case if you are not showing any image you can remove it.
Step 2: 
File: Resources\Values\styles.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <style name="CircleButton">
    <item name="android:layout_margin">30dp</item>
  </style>
</resources>
Step 3: 
File: Resources\Values\Strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="app_name">CircleButton</string>
</resources> 
Step 4: 
Run the Program now. You will have a Clickable Circle button.

Tags: Circle button in Xamarin Android Project