Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance improvement of Xamarin forms application

I am developing an Xamarin forms (Android and iOS) applicaion and checking the logged in status when application starts and assign the appropriate values if the user already logged in to application. This process takes 6 seconds to load the first page in our application. I have followed the Xamarin Auth to store the credentials of the user when logged in.

Below is the procedure to store and retrieve the details of logged-in user that I've used in the application.

https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/general/store-credentials/

Code snippet which is used in OnStart method of App.cs file:

        protected async override void OnStart()
        {
            LoginType login = DependencyService.Get<ILoginCredentialStorage>().LoginExists();
            this.MainPage = new NavigationPage(new HomePage(login));
        }

How can I reduce time to load the first page in application?

like image 358
Vijay457 Avatar asked Oct 17 '17 06:10

Vijay457


People also ask

How does Xamarin form improve app performance?

Use fast Renderers Fast renderers reduce extensions and rendering the cost of controls on android by flattering the resulting native control hierarchy. It also improves performance by creating fewer objects, which turns results in a less complex visual tree and memory use.

How do I make Xamarin app faster?

Startup Tracing If you go into the Android Options of your Xamarin projects, you'll see this: If you enable the AOT Compilation (Ahead of time), your app performances will improve significantly and so the startup time, but your apk size will increase as well.

Is Xamarin good for app development?

Since its appearance in 2011, Xamarin has become a great option for cross-platform app development, a faster way to build iOS, Android, and Windows apps.


Video Answer


1 Answers

You probably need to move the getting of the login credentials to the login page, and leave it as late (i.e. OnAppearing rather than the constructor) as possible to do that so you can show a progress indicator.

Here are some more tips

like image 82
Steve Chadbourne Avatar answered Oct 29 '22 05:10

Steve Chadbourne