Increase in app size on adding mlkit in flutter - flutter

I recently added mlkit in my app for smile detection and then .abb size increased from 48mb to 185mb. How can i reduce this size...

Are you using a flutter plugin or a direct ML Kit dependency. You could try use app bundle to include only one arch in your app, or use dynamic feature to download the feature. If you could depends on Google Play Service, you could use the unbundled version which is only hundreds of KB in size: https://developers.google.com/ml-kit/vision/face-detection/android

Please refer to https://developers.google.com/ml-kit/tips/reduce-app-size to reduce your size of the android app. Also, 48MiB to 185MiB doesn't sounds right. The native android sdk is about ~20MiB even without any of the above optimization.

Related

Deferred components to reduce app bundle size - Flutter

Whether the Deffered component in flutter reduces the app bundle size for play store upload?.
As the document saying
Flutter has the capability to build apps that can download additional
Dart code and assets at runtime. This allows apps to reduce install
apk size and download features and assets when needed by the user.
But the base apk will contain flutter lib. that will be around 9+ MB.

Which Flutter default plugins are important?

I am relatively new to flutter and app development. I noticed that whenever a new flutter project is created, there are many default plugins pre-loaded into the project and this makes the app take up a minimum of 80 Mb. Could i get a summary on which plugins are actually important in order to run any app in general?
Flutter provides almost all the basic things like themeing, icons, routing etc out of the box.
You can have any other package if you need more functionality like fetching data from internet and so on.
The important thing is the size you see is the debug build which is large as it contains the VM for hot reload to work at such speed. When you build the release version it is the minimum version which goes for about <5Mb on bare-bone app.
Currently my debug app stands at around 80mb on emulator but the release version is < 6mb.
So to answer your question,
it is the debug size,not the final version
Flutter requires no extra plugin for an offline app with basic functionality. Core components + testing is provided out of the box.
Nothing useless is shipped by default,
NOTE: there is a section called dev_dependencies in pubspec.yaml which means the packages listed under this won't go into the release build and are only for development purpose.

crosswalk in Ionic2 increases app size by 25 MB [duplicate]

I really hope I'm doing something wrong. I've added crosswalk to a project and have had some serious app size increase. To test I've done the following.
created a new ionic project
added my app code to /www/
added ngcordova and various plugins
Ran ionic build and drop the apk onto a Genymotion emulator. The app was very slow but had a app size of 8.01mb (once installed - checked with app manager).
Then I deleted the app from the emulator
Ran ionic browser add crosswalk
Ran ionic run android which installed the correct .apk on the emulator. On checking in manage apps the app size is now 79.36mb!!! Thats a 71mb increase! Most places say 20mb at most but 71mb!!!
Can someone tell me what I've done wrong?
When I added the Android SDK I did add all the tools ad platforms availabe in the SDK manager, did that have some effect?
If this isn's fixable it's a show stopper for me, which is a shame after spending weeks developing an app...
Please help!
I'm also running into that issue. Unfortunately using crosswalk will definitely increase your apk size. However, I found some way to at least reduce the apk size. For instance you could make use of the crosswalk lite. It may reduce your apk size for about 15 MB (see crosswalk lite).
You can also specify that you don't want to build the projects for two architectures (explained here).
Same problem here. I think promissed size of 20Mb is for the apk file which is compressed, you are looking at installed size on device.
You can check generated APK size on platforms/android/build/outputs/apk/ or platforms/android/ant-build/
I think the problem you're encountering though Crosswalk related, it's emulation related. I've tried emulators from both Android Studio versions and Genymotion. They both didn't work well for hybrid app testing.
My advice is to try Chrome Device Inspector along with actual device testing. I don't think anyone will argue that's the best way to ensure performance. AWS Device Farm is just one of many offerings that will spit out physical devices for testing. There's even services that let you outsource testing on different devices by real people, just can't think of the name of it right now...
My current favorite is Cordova Tools for Visual Studio Code, but it has been buggy for me lately.
However, I'm in the early stages of a fleet of Cordova apps and was alarmed at the overhead Crosswalk has. ~20MB extra to your APKs, and ~70MB to the installed size of your application. That's pretty alarming, considering the apps we use it with, with resource assets (images, etc.) are about 1/10th the size of this one plugin!
We have one app that has actually degraded with Crosswalk. My theory is that Crosswalk doesn't do a good job parsing non-standard HTML which is a core feature we have since we have XSLT transformed XML which winds up being non-standard HTML. Traversing it is extremely slow compared to the default WebView. We do a lot of manipulation with raw DocumentNode objects, so maybe that's it. That said, I'm so surprised that if it's slow traversing/appending HTML via vanilla JavaScript that these other apps are seeing performance gains!
I also learned last night there is Shared Mode with Crosswalk which allows multiple applications that use Crosswalk to share one instance.

ionic sidemenu on mobile browser not working smoothly

I am developing mobile web app using ionic sidemenu, but it is not as smooth as it should be. When I open sidemenu using slide left/right, I am getting less than 30 FPS as shown in figure.
How can I improve the performance?
Reaching 60 FPS would be great!
AppGyver's Steroids tooling also provides you with access to Crosswalk on Android. You can run it in your Ionic project directly without modifying any files.
Also, Supersonic's sidemenu/drawer is fully native, so if you're up for migrating, it'll run way faster. :)
(Disclaimer: I'm a programmer for AppGyver.)
My advice is to use Crosswalk instead of the Cordova as the webview for the app.
While both share the same end goal, they are different:
Cordova, from the Apache Foundation, uses the regular (pre-lollipop) Android webview, which is based on Android's stock browser since its inception.
The Crosswalk Project, created on the Intel Open Source Technology Center, is different. It wraps your app with Chromium, the open-source base code that gave birth to Google Chrome, which brings numerous performance enhancements: css3 transitions, animations, 3d transformations, html5 support, remote debugging and much better javascript support and performance.
At the time of writing, the Ionic team is already working on a beta version (1.3.0-beta1) that uses Crosswalk instead of Cordova. Not really stable just yet, but a huge promise.
In any case, you can use Crosswalk today, by manually copying your Ionic project's 'www'
folder content to the project folder inside Crosswalk folder and run it. You'll need to setup some manifest files previously, so read the docs.
In any case, it's not hard at all to try, and I'll recommend it everyday for all projects pre-Lollipop. If you're targeting Lollipop/Android 5 versions, you don't need it, because the default Webview in these versions is already Chrome-based.
Hope it helps.

intel xdk really slow, including the demo

I've been creating a game for the last few weeks and everything seemed to be fine on the emulator. But when I tried testing and building it for my Android device (Sony Xperia Z), it was very slow. I tried one of the demo applications they gave with the XDK (Rolling Can) and this one was very slow as well.
I'm wandering if everything I did was for nothing, or that there is a reason for this problem. Can someone help?
The emulator in the Intel XDK is an implementation of the Ripple Cordova emulator. It is running in a desktop browser that is based on the Chromium project. Thus, it has substantially more resources (especially CPU and RAM) to draw upon than your phone or tablet does.
Likewise, your HTML5 app runs inside what is commonly referred to as a "webview," which is kind of like an embedded browser. Some features in this webview are disabled by the OEM firmware, it varies, there is no hard rules.
To address the wide variance in webview performance and HTML5 features that you find on Android devices The XDK also provides a build option based on the Crosswalk open source project. When you build your app using the Crosswalk build option you'll get consistent features and, generally, much better performance on your Android device. (This is only available for Android 4.x devices.) This comes at the cost of adding about 15MB to your application size, because a complete embedded browser is included with the application.
Give the Crosswalk build a try and see if that provides the results you need.
As of February, 2017, the Crosswalk Project has been retired. Crosswalk 23 was the last version of the Crosswalk library produced by the Crosswalk team. You can continue to build for the Crosswalk library using Cordova CLI or PhoneGap Build, but no further updates to the Crosswalk library will occur beyond version 23 (FYI: the Crosswalk 23 library for Android is based on the Chromium 53 runtime release).
If you are only distributing your mobile apps on Android 5 and greater there is no compelling reason for including Crosswalk as part of your app. The Android 5+ webviews are regularly updated, via the Android store, to include an up-to-date copy of the Chrome webview, providing good performance and current features.