question

BhautikBhavshar-5902 avatar image
1 Vote"
BhautikBhavshar-5902 asked RobCaplan edited

How to improve app loading time in xamarin forms.

Hi,

I'm working on the Xamarin form and frequently I'm facing app loading issues. Whenever an application launch the first time it will take approx 10-12sec.

Another issue is application is too much legging while navigating through pages.

Thank you in advance.

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

Firstly, Xamarin forms application load is slower than the Xamarin.Android application load. Because Xamarin.Forms provides not only the ability to share UI across targets, but common application features such as AppLinks for deep linking, Navigation, MessagingCenter, and DependencyService, as well as several pieces needed for cross-platform UI alerts, action sheets, toolbars, status bars, etc.

Then, do you have lots of network connection when you open your application? If so, you have to improve the speed of connection and change the method of loading, please use Lazy Load method when develop applications. For example, the App.xaml Resources is a convenient place to put styles, fonts, and other resources that you’ll use throughout your application, but it’s also all loaded at startup. If you’re trying to erase every unnecessary millisecond from your startup time, remove anything here that you don’t need and lazy load it by page or in another method.

And enable Enable XAML Compilation(XAMLC), XAMLC is enabled you’ll get compile time XAML checking on most all properties and UI will render faster.

Reducing Images and video in your splash screen, it will slow down the initial rendering of a screen.

Here are several tips in this blog, you can refer to it as well.

https://devblogs.microsoft.com/xamarin/5-ways-boost-xamarin-forms-app-startup-time/

Then for your another question it would be best if you try to open up a new thread for it. In this way, it will make answer searching in the forum easier and be beneficial to other community members as well.


Best Regards,

Leon Lu



If the response is helpful, please click "Accept Answer" and upvote it.

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.



· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the Answer.

I have found in my application that, my initial page is tabbed page and it contains 6 pages. So whenever the application land on my initial page it loads all 6-page content. So is there any way to prevent load all the pages rather it load only the first tab and another page will load when I click on a particular tab?

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT BhautikBhavshar-5902 ·

You can use lazy load for loading time-consuming view, You can see my answer in this thread:https://docs.microsoft.com/en-us/answers/questions/419926/how-to-load-only-first-page-of-tabbed-page-in-amar.html When you click the tab, this loading time-consuming view will be loaded.

0 Votes 0 ·
LeonLu-MSFT avatar image LeonLu-MSFT BhautikBhavshar-5902 ·

@BhautikBhavshar-5902 I have not heard from you for a couple of days. Please let me know if there is anything that I can help here.

0 Votes 0 ·