Conditional Activity Start - android-activity

I want to start the application by giving the user to disable/enable the Splash Activity at start.
I created a activity without layout and decided to load the splash activity or directly goes to main activity based on SharedPreference setting that user saves.
The concept works fine but the startup activity shows for a very short time before it switches to Splash or Main activity.
How can I resolve that?
Any other way that I can achieve this?

Thanks for not answering me at all!!!!
I just found that, If I make a decision on Splash Activity itself, it works fine.
In fact, On Splash Activity itself, if the SharedPreference lookup returns the True, it shows the Splash activity itself and if not, it goes to Main Activity by running the intent.
That works fine

Related

Flutter: How to show splash screen based on theme data saved using shared preferences?

Currently the splash screen is showed according to the device theme and rest of the app according to user selected theme, but I want to show the splash screen according to the selected theme by the user (which I do save in shared preferences).
It's not possible.
Splash screen is handled by the system, and you app isn't launched yet, so no code to load user preferences could be run.
Uh, technically it's possible.
Here's a high-level overview:
You can always show a blank Container() on opening your app, while in the meantime you have your SharedPrefs checking the saved theme/appearance, then, once you have that data, you can show a splash screen where the rest of your prefs then load.
While at first glance this may seem inefficient, the call to SharedPrefs is so fast users literally won't notice that there was a frame of a blank screen before the Splash Screen comes up.
Source: Implemented this for my team's app and it works beautifully.

Clear back navigation stack (Android)

If I call my app using a separate activity (not the normal initial route but, for instance, by overriding getInitialRoute() in a secondary FlutterActivity), or maybe even if I have no UI at all but a plugin I call into provides a platform UI of any kind, upon returning to my code, when I want to dismiss the functionality, the root route of my Flutter app is visible for a short moment. As an example, let's consider a printing scenario:
my app receives a share intent
I catch the intent with my Android code, send it to the Dart side
I act upon the intent, which involves displaying the Android printing UI
the user finishes printing or dismisses the UI
control returns to my code
before my Flutter app goes away, its initial route displays temporarily
Item 6 happens even if I call SystemNavigator.pop() in my item 5. The app exits all right, the funcionality is OK, but the momentarily visible root page is a visual nuisance.
So, what I would practically need is a way to clear the back stack when I reach item 5 to make sure I don't return to the root, not even for a moment.
I found something in the meantime that, at least for now, seems to work. It involves several steps:
make sure you use an extra route for this activity -- this ensures that it won't be the root page but this one the navigation returns to temporarily,
make sure the route shows an invisible page, practically an empty Container() -- this ensures the page will not show anything,
start this activity with a transparent background mode (including a transparent launch theme and referencing it in the manifest) -- this ensures the page will not even re-color the background temporarily,
use SystemNavigator.pop([animated: false]) when your code returns from the foreign UI -- this ensures that the extra page will disappear in the end. Animated actually does nothing, as the doc describes (which is unfortunate, actually, it would be nice to be able to suppress it).
These all combined make sure that, although the extra page is technically present for a short period of time, it isn't actually visible and distracting to the user.
I'm still very much open to suggestions that provide a real solution rather than a hacky workaround, if possible. :-)

Splash screen getting invoked on map

I am working on a small project and my query is i have a view which displays the map and prompts me to use my current location.
my query is that when i press allow or dont allow button of the pop up it relaunches my app displaying my splash screen and then takes me back to my mapview.
So can we stop this from happening and does anyone know why this happens.
Thanks in advance.
As said in the comments, this "question" is hard to answer. Here's a try:
The popup is actually not shown by your app, but by iOS. Upon return of the popup, your application delegate's -applicationDidBecomeActive will get called. Apparently you (or the person who wrote the code for you) takes this as a sign to launch your splash screen. Of course, this should only happen when coming from the background or on startup.
So my guess is that the app is actually not relaunched at all. Put some logging in each of the application delegate functions, to see when and in what order they are called.

Splash screen should check data from database

hi i am creating an map application ,
initially when i click on the application icon on iphone a Splash screen showing application logo and a loading bar should be shown.
Expected Process:
Screen should achieve following objectives of initialization
1.Initialization of Synchronization Web Service
2.Create or Open available database on the device and keep the referece in the memory for quicker calling.
3.Validation of available UserInformation Record in database
4.Build up a Weather Map which should hold all 37 types of weather available for easy future reference
On each processing step progress bar should grow/fill with 25%
How could this be possible.Please anybody help me in achieving this tasks
The splash screen is just an image that should be called default.png. It will display during the launch of you app.
To realize what you want you have to define the first view controller with the same background and a UIProgress and do your sync and other processes.
When initialization is done you have to display your "real" first view controller
When user launch the application you could show a splash screen for 1 or 2 second after that you could show the progress (status) of your application using text msg.
for example "Initialization of Synchronization Service" ,"Storing to data base", "Loading map" .
The above text msg. is just a reference,you could have more descriptive text to show on screen along with progress bar.

Sending user to nested view

When a user shuts down my app, I'd like to send them back to where they left off. The app starts on a tableview, the user drills down to another tableview and then clicks a row for a detail view. When they startup the app again, I have two choices:
1.) Display options (alertview) for returning to the previous location or cancelling and remaining on the start view.
2.) Immediately jet them over to the detail view.
I don't like either option. (1) gets to be nagging if you must go through it on every startup. (2) could be confusing and I'm not sure technically how that works.
Any suggestions on the above or something different?
But 2) is the preferred way according to Apple's HIG:
Even though your application does not run in the background when the user switches to
another application, you are encouraged to make it appear as if that is the case. When your
application quits, you should save out information about your application’s current state in
addition to any unsaved data. At launch time, you should look for this state information and
use it to restore your application to the state it was in when it was last used. Doing so
provides a more consistent user experience by putting the user right back where they were
when they last used your application. Saving the user’s place in this way also saves time by
potentially eliminating the need to navigate back through multiple screens’ worth of
information each time an application is launched.
As far as the technical implementation, it's exactly the same: push your subviews onto the navigation controller. The only thing I'd do differently is not animate the 'drilling down.'
When your app starts up, it has an initial 'look', screen, view, whatever.
When it starts back up and has a previous context, add a link or button naming the previous context that allows returning there.