how do we get to know Users Android device MTU size ?

Rashmi E 1 Reputation point
2022-03-28T03:02:52.06+00:00

We have our application in Xamarin forms for android devices how do we get to know the MTU size of the android device which user is using ?

I should be notify user if users device MTU size is not supported to use our application must check the MTU size of user device first.
Also is there a way to notify user before installing application from playstore? or before showing launch screen in the application.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,206 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 24,591 Reputation points Microsoft Vendor
    2022-03-29T06:07:46.533+00:00

    Hello,

    If you mean the MTU size of android device. For Android phones, MTU size is default (23 bytes) and couldn't be changed.

    If you mean the Bluetooth MTU size in Android, you can refer to requestMtu to get more details.

    The following simple code shows how to use it in Xamarin:

       public void setMTU(BluetoothGatt gatt, GattStatus status)  
       {  
       	if (status == Android.Bluetooth.GattStatus.Success)  
       	{  
       		//requestPriorityHigh();  
         
       		gatt.RequestMtu(182);  
                       // etc.  
       	}  
       }  
    

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments