Xamarin forms Android app verison goes blackscreen randomly - xamarin

I got this app im been working on i xamarin forms. where i use a ContantPages inside a navigationspage. like shown below
MainPage = new NavigationPage(new SwipePage());
Now when i navigate to a other page like shown below, sometimes the screen goes black. If i then tap out of the app, and then tap in the app, the black screen will disappear, an the page content would be showing. making the app normally again.
this.Navigation.PushAsync(new ProfilPage());
I been trying to see if it's curse i load more data en app start, then resume. but i don't. its getting the same amount of load on resume, as on start.
So do anyone have a idea what it can be, or have tried something similar before?
Thanks for your time,
---UPDATE---
So In a emulator it runs without problems. but when i use a android device IRL it's keep doing that black screen thing.

I think this is occurring because you are not awaiting the async method thus showing a black screen as the page is still rendering but you have already been pushed to the page.
Try using the await operator.
var page = new SwipePage();
await Navigation.PushAsync(page);

Related

Xamarin Android MvvmCross Onboarding

so I'm developing an app that uses MvxSplashScreenActivity for its splash screen and it works well. I just got a feature request for onboarding screens to be shown to first time users. Here comes the problem, I can't seem to find a place to hook in code like if new user then do onboarding else show the splash screen. Is this possible or am I not thinking about it correctly. I will be using this AppIntro for the onboarding slides. Any assistance will be appreciated
I like to funnel users through another activity that has the same layout as the splash screen, which allows you to do any other initialisation and decide where the user should go. This means that you show every user the splash screen and every user the 'loading' screen, but where they go next depends on whether they are a new user or not. The user won't be able to tell the difference between the splash screen and your loading screen unless you want them too so it appears seamless. So it will look like:
Splash -> Main Loading Screen -> if new user Onboarding else the first screen of your app
If you are making any calls to an API or doing anything else that could take a while here it is wise to show an activity indicator also, so the user knows something is happening and the app isn't frozen.
I implemented Jason's suggestion. Basically, always show the splash screen and based on whether it's a new user or not show the onboarding screen or home screen.

How do I make and code a splash screen for an app in NativeScript (Angular)?

I'm trying to put an Splash Screen on the app that Im developing on NativeScript with angular, the problem is that I don't know how to create it and then implement it on the app.
What I want is just a screen that shows when I hopen the app and then just goes into a login screen (already have the login screen).
Checkout nativescript-splashscreen if you like to customise splash screen with cool animations & components.
Edit: If you are looking for a loading indicator to let user know you are processing something or waiting for a network call, you could use nativescript-loading-indicator Or even host your own dialog if you need something more customized.
You can use loader kind of mechanism if you want to just put some content for sometime you can add content on loader screen and it will be shows for defined time
you can use ngx-ui-loader npm package for this
else you can create new component and make it as dailog window that will open on login page loading and than it will be closed by click or timeout. you can use different NPM library for this.
This both approach might solve your splash screen problem.

Modal form is empty with PushModalAsync with Xamarin.Forms.Maps

I have a form that includes a Xamarin.Forms.Maps.Map control. When I push new views onto the stack with await Navigation.PushAsync(page), views that I want to be modal (using await Navigation.PushModalAsync(page)) that I push onto the stack are empty. The animation works fine, but what's animated is just empty (the background is white but with no controls or other UI elements rendered. If I remove the map control from the "root" view, the modal pages are displayed correctly. If I use .PushAsync instead of .PushModalAsync the views are displayed correctly.
I am targeting Android 6 using the Google emulators
I have no idea what's going on.
it looks like we have a bug on the Xamarin Forms ModalNavigation. It was already reported here: https://bugzilla.xamarin.com/show_bug.cgi?id=43692
For now, I'm using this workaround (from Scott Simms): before pushing a any page (in the OnDisappearing()) from a page that contains a MapView, remove the MapView from the Content of current page, and load it again in the OnAppearing();
It works well for next page BUT... if you push a new wrapped ModalPage on this second page, when you pop it, probably it will crash your app too.
It has been bothering me, and I am thinking about implement my own toolbar to make it looks like a Navigation Page and avoid the annoying crashing.

WP7: Is it possible to intercept the backstack before the journal thumbnail is created/stored

You all know the Windows Phone backstack right. If you go through some apps, tap the Home key after starting each app. Now tap and hold the Backkey to see the Backstack. You can now see some small images of your apps, and can pick which one to go to right.
Question:
Is it possible to intercept before the backstack image is created? I have tried to blur my page in various events (include OnNavigatingFrom) to no avail.
My guess is some other event (probably something we don't have access to) is triggered and a bitmap is created, because when you use the Backstack to navigate you can just see a slight transition from the saved image to a real page IMO.
Does anyone know if its possible to intercept or manipulate these images on the backstack?
Example screenshot from WP emulator of the Backstack thumbnails
Following my comment, I've just tried this:
Set a breakpoint anywhere in the code
Start the app with the debugger attached, then let it reach the breakpoint
While the execution is stopped by the debugger, long press on the back button
The task switching UI is displayed even though the managed code execution is stopped
From there, I think we can safely conclude that the task switching and the thumbnail are handled entirely by native code. Therefore, there's nothing you can do.
I recently wrote a blogpost in which I discuss the ways I tried to hide data from the application snapshot. (You can read it here: http://corstianboerman.com/trying-to-hide-crucial-data-from-an-application-snapshot/)
The outcome: You just can't hide it.

Mango Secondary Live Tile issue

I have a panorama application and I have successfully created secondary live tile with URI pointing to the desired xaml.cs. Now the xaml part which is separate from mainpage.xaml is of no use to me so what happens is when user goes to the secondary live tile, code from desired.xaml.cs is seen by the user. But when he presses the back button, he goes to an empty page and then goes to homepage and I am aware it is not possible to jump directly to home screen. So how do I solve this issue? If you are wondering how this works - try network dashboard for Windows phone. Quite similar.
Can't reproduce. When you are navigated from a Live Tile, and presses back, you'll exit the application, since there are no other pages in the navigation stack.
The Network Dashboard works the same way.
If you somehow managed to have other pages in your navigation-stack , consider removing them using NavigationService.RemoveBackEntry

Resources