Is there a downside for using flutter packages? - flutter

Does using many packages in one app effect performance or bundle size?
I’m mostly familiar with web and trying to understand more about how it is when it comes to mobile apps.

As long as you are using good healthy packages (like from Google/Dart team and other well maintained packages), there isn't anything you need to worry about.
There is no significant performance issue you'd notice when using more and more packages but yes the size of your app will definitely increase.
You can find the health of package on pub.dev

Related

FLUTTER WEB: How can we have a single codebase for the Flutter app & Web?

We have a single codebase for Android & iOS in Flutter.
We tried to use the same codebase for Web in Flutter too, but it hadn't gone well.
As of some libraries/plugins, currently unsupported by Flutter SDK.
To mitigate these issues, we are maintaining two separate repositories, one for Android-iOS and other for Web.
Also, to add up here, for separate repositories because each Flutter product has a unique pubspec.yaml file. Now there are a few plugins that are currently supported in App but Not yet on Flutter Web, namely Awesome Notifications, Clevertap plugin, etc.
Integrating those plugins on the web, stops the web to run. So keeping the same codebase for both is getting technically complicated as the app has many many functions.
It takes so much time in simultaneously testing, debugging and resolving issues in Web.
So, how we can maintain same code for all platforms i.e., Android, iOS & Web, without doing it in other repository for Web and gaining advantage in streamlining our codebase into one for all platforms?
For Ex. If I commented the package awesome_notifications for Web in pubspec file, the issue arises (as shown in the screenshot) in code wherever we used its functionalities.
For successfully working on both Mobile & Web, are there any methods available we can use packages for both (Mobile & Web)?
Ideally you’d want to use a single codebase to host both the web and mobile versions, to minimise code maintenance and improve efficiency. To do this, you’ll need to be able to find the platform the code is running on, so that code can be called programmatically.
You can use the constant kIsWeb to check if the application is compiled for the web, and you can then use that condition to only run platform-specific code (such as the awesome_notifications package) if you’re on a platform that supports it. That way you’ll still be able to import the required packages, but only call them when the app is running on the mobile version of your app.
That should allow you to condense your codebase into one repository without sacrificing any functionality that may not work across all platforms.

How stable is the current version of Flutter Web

I'm wondering how stable the current version is for Flutter Web?
It looks like the authentications works well. But what about the Real-Time database & Firestore? Are you able to use these in the latest release? I would like to know if the current version works well with:
SVG's
Responsive enough?
Firestore possible?
Real-Time database supported? And do they use the same packages as the mobile version?
Multiple browsers compatible
Functions, are there CORS policy issues?
Uploading files
You can definitely use firestore, just like you would with apps. But as far as overall stability of web, I would say its not fully stable or else it wouldn't be in the "stable" channel instead of "beta".
It is capable of doing most of the things that you can do on a mobile device within the app. The things that aren't fully stable yet are the web specific things. It is already responsive, and firestore and real time database work fine. It should be compatible on all browsers (but i haven't test that). I'm not sure what you mean by uploading files, but if you mean to some database then that should be no problem either.
I think for now, if you're just trying to set up a simple website it should be good enough for that, but if you want to do something more complex, I would wait until it is in the "stable" channel.

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.

Smartphone Development Framework & Platform?

I am a C Sharp.NET & Silverlight developer and now thinking to swicth to SmartDevice development specially for iPhone & Andriod based phones. I have looked over web and found some cross platform development frameworks like
http://developer.openplug.com
http://www.phonegap.com/
http://android.xamarin.com/Welcome
but not sure about which to choose. Naturally I would like to keep my learning curve less but also would like to choose platform which provides more power, so I am looking for your suggestions and 'Getting Started' tips and also which device you think will be in demand in future iPhone or Android ? .
Thanks,
Maverick
I wouldn't recommend any of those. The problem is, that those "cross-platform" development frameworks, still aren't cross-compilable. This means you still need to develop an application for each platform, but you can reuse heavy calculations if you are using models af MVC.
Another thing is that those frameworks still aren't 100% native supported, so you'll loose some features from the native frameworks when developing applications.
I've read a lot of articles and to be honest, these cross-platforms seems to be dying out, cause both Android and iOS are moving very fast in each their direction and the cross-platforms cant keep up. But it's still up to you.
In would recommend you to choose one of those platform and learn it from scratch. With your C Sharp background, maybe iOS and Objective-C would be the most natural choice.
Enjoy
Edit: Regarding you last question:
I dont think it matters which one you choose, both will be domination for a long time. You should pick the one you can identify yourself with.
since you are C# dev, go for MonoTouch. I heard good things about it.
Miguel de Icaza is behind Xamrin. He wrote the most prolific .NET platform for UNIX, mono. I believe both he and his team have the capacity to bring you the most coverage for common features on Droid and iOS. My friend has a startup and is releasing an app shortly for iOS on Xamrin. It is a video streaming app.
HTML 5 will get you the most cross platform for the investment. Of course, like everyone else has said, if you need lots of native integration or if you want to use the latest APIs upon availability, you have to go native.

libraries / services to assist with iOS wireless app distribution

Can anyone recommend any libraries/utilities they use to assist in distributing iOS adhoc/enterprise applications over the air, so users can install without needing a PC/iTunes?
There's a few hosted services around (eg. https://testflightapp.com/ - though that is not free for enterprise apps), but I'm sure in the past I saw a non-hosted service (ie. something I could install on my own server) and came with a client side library that was easy to hook into the app to notify the user when updates were available and allow them to easily install them. Unfortunately it seems I didn't bookmark it and a bunch of googling and searching on stack overflow hasn't found it.
You need to create your own manifest and bundle it with the app package (the IPA from Build and Archive). There are a lot of guides on the web. e.g. this to automate OTA distribution using Heroku from Héctor Ramos or Mike Nachbaur's write up.
That said, I suspect using TestFlight.app is a lot easier than rolling your own - have you looked at the cost benefit of paying TestFlight vs developing and maintaining your own system. Much better to write production code rather than save the cost of the TestFlight subscription surely...
I finally found the one I believe I was thinking of when I wrote the question, it's called "Hockey":
http://hockeykit.net/
https://github.com/TheRealKerni/HockeyKit
If there are other similar solutions out there, please do add your own answer!