I'm testing Flutter for Windows and i noticed that, even with a basic 'HelloWorld' app, the content appears slowly, i have a 1 second blank screen inside the app (see gif below):
The app is packaged with default command (flutter build windows).
How can i improve performance at startup ? Is it possible to show the window when content is ready to display ? Or shall i use a splashscreen (I don't even know if this is possible with windows, and if so how) ?
Thanks to everybody!
How can i improve performance at startup ?
Flutter for Windows currently only supports debug builds, which among other things means that it's using JIT compilation, not AOT as a release build of a Flutter application would. Slower startup time is one of the downsides of JIT.
Is it possible to show the window when content is ready to display ?
There is currently no callback hook for when the first frame is drawn, so this would be difficult, if not impossible, to do accurately.
Or shall i use a splashscreen (I don't even know if this is possible with windows, and if so how) ?
There is no support for splashscreens in Flutter's Windows embedding.
Related
Hi i am developing a flutter application and i am using getx statemanagment. The problem is when i put application in background and use some other applications like whatsapp,youtube,play a game or listen music, after some time when i resume my application from recents it restarts and all progress is lost.
I have already tried different solutions like moveTaskToback(true) with native android function call
Please help, I have almost finished my important application.
I'm not sure on why this happens, but some manufacturers have their own restrictions on apps running in the background. Nothing you can really do from a flutter perspective, the app lifecycle is the same on all devices.
Here is a link where they share some tips how to deal with this on Xiaomi from the users perspective.
https://dontkillmyapp.com/xiaomi
From the developers perspective, as you can read on the bottom of the article, the are no common workarounds known yet.
Hi stack overflow community,
I'm a novice programmer in high school and have never written an app for mobile devices before so please bear with me. If I was to write an app using Flutter, will I only be required to write the code once and then be able to distribute different versions of it (iOS, macOS, Windows, Linux, Android, etc)? Or will I need to make small changes for each version such as using XCode to create the iOS version and Android Studio for the Android version? I know this is such a basic question but I've spent a couple of hours looking this stuff up and I'm still confused. Any help would be nice.
Thanks,
Daniel
In a product development environment, after writing the cross-platform code with Flutter, there are some need-to-do tasks related to Native environment.
In the case of Android, there are several cases when you'll need to touch the Native level such as config Firestore settings, Social authentication (Login with Facebook for example), changing the launch icons/ splash screen of the app or publishing to app store, etc
For iOS, the same case apply as well. So I suggest you start with small steps to develop the app first, then when running into something that seems impossible with just Flutter code, there are tutorials and SO to guide you through. It might seem overwhelmed at first, but we are all on a journey, so no need to rush it ;)
You should make small changes too. For eg when adding launcher icons and splash screen you have to edit the respective native folders. When distributing for ios you need to manually customize its Runner from xcode. There are many library that support either android only or ios only. In that case if you need that feature you have to make changes in native code like java ans swift.
if you're creating your own native plugins, you will have unique code to write. But if you're just using things out of pub, almost nothing will require change (unless you are publishing to the store).
In Flutter, how can I check if I am releasing (dispose) everything correctly?
I am building an application and I have the feeling that the simulator is getting slower after a series of hot reloads.
Many thanks for your answers.
Dart comes with a debugger called Observatory. It does a bit of everything you need. From CPU/Memory usage, to time spent on each functions. Even breakpoints and code coverage.
When running your flutter app, it's available by default on the localhost.
When running flutter run in the terminal, the port will be displayed.
On vscode with Dart code extension, you'll need to use the command Open Observatory timeline.
I'm thinking of making a text expanding app with Electron. Is it even possible to make an Electron app that can do that? For instance, if the Electron app is open and I enter an abbreviation into Sublime Text and hit tab will it expand?
Electron allows you to make apps that run node scripts and display UI in a webkit based view.
The purpose of Electron is to provide native OS interactions to node and package everything in a distributable app. It does a fairly decent job covering basic OS interaction, however it is by no means a full API wrapper.
In short, no Electron itself will not do this. I doubt it is worth the time writing a node module for this purpose, you would be far better off writing a native app for whatever platform you are targeting.
I'm looking at prototyping with a HTC Advantage, which runs Windows Mobile 5 and has a screen resolution of 640x480 (or the other way if in portrait).
Before anyone jumps in and suggests developing as a native Windows mobile app, we're prototyping as a Java midlet because we also want to find out what restrictions/limitations/design considerations there are if we decide to then take the code to run on other mobile platforms: Java allows us the largest mobile-base with fewer code changes.
I'm using Netbeans 6.8 for the development, and I can't see any way to change the "Device Screen" view of a midlet from a typical mobile-phone sized screen, nor change the view from Portrait to Landscape; similarly, the emulator doesn't have a large-resolution device.
I'm using the default mobile device of ClamshellCldcPhone1. I've looked at some of the other device profiles, but none of them seem to be targetting larger screen devices from what I can see. And I can't find any documentation that tells me the difference between, say, ClamshellCldcPhone1 and DefaultCldcPhone2.
Has anyone any experience of this? Most of the existing things I've read have said to design for the smaller resolution and use anchoring to ensure controls stay in place; however as I've got a screen that's twice the resolution, I want to write for that resolution (given this is currently in prototype world). I can copy the code over to the HTC device to test, but this will (probably) get painful, especially during the early stages.
Any advice welcome :-)
What you need is a new emulator configuration for your handset form factor.
The emulator in Netbeans is the same as the J2ME SDK (formerly Wireless ToolKit, hence the WTK acronym) from SUN Ltd.
You can make a copy of the ClamshellCldcPhone1 folder that is presumably located inC:\Program Files\NetBeans 6.8\mobility8\WTK2.5.2\wtklib\devicesand modify the images and .properties file in your new configuration to match the device you want to emulate.
You can add/remove physical keys, resize the screen and make it touchscreen that way.
This should all be explained in the J2ME SDK documentation.
It's been a very long time since I did any of this, but I think you can just copy one of the existing profiles, rename it, and change the settings to what you want.