How can i set my app is supported with all Android devices ? - Ionic-v3 - ionic-framework

yesterday I upload my ionic app on google play store but there showing 9751 Supported Android Device only what should I do for all device support for my app…any help, please.
I build the ionic app using this commend: ionic Cordova build android --prod --release
and I added this in the config.xml file
<platform name="android">
<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="26" />
</platform>
I have showing like this Supported Android Devices: 9751

Based on your settings and Android developers Distribution dashboard you are supporting 99.4% of android devices out there, You can bring down you min and target SDK supported to lower versions of android, but:
You will lose the higher end devices
It is not suggested, especially less than 14 as lots of design elements have changed and memory management libraries have changed.
If you change your target SDK in this level, after all the coding and building has finished you have to go and update your gradle libraries, which will be opening the door to lots of problems.
Bringing down your minimum sdk version, you will have run-time problems with older devices.
So my suggestion, keep it safe, don't change anything.

Related

Generate HarmonyOS (Huawei) build from Flutter project

I am working on one Flutter project. In which, We want to generate builds of Android, iOS, and HarmonyOS (Huawei). But I am not sure does Flutter supports this OS or not. I went through some of the stuff on the internet but was unable to figure out how to generate and what kind of commands were needed. Here, Anyone has previously generated HarmonyOS compatible build from the Flutter project. Please share your thoughts.
For now it is not possible directly from Flutter. Because of the change in architecture brought by Huawei with HarmonyOS it is not anymore an "Android device" and it doesn't run "Android applications".
Now what you can call "native HarmonyOS applications" are *.app files (not *.apk or *.aab)
Most recent answer on Quora to:
Will Harmony OS run Android apps?
Gives the following response:
Answered Jun 4, 2021 by Mahdi Parastech, Software Engineer
Nope, because:
The structure of the APIs are different.
Hongmeng (HarmonyOS) apps are in *.app, Android apps are *.apk
The structure of pages (activities) are different, Hongmeng uses some additional json files and puts pages inside *.har files.
Hongmeng uses Javascript too, and that's the only option in Wearable Hongmeng devices, but Android apps are just written in Java.
source
Apparently you should be able to migrate your native android application to HarmonyOS by using their IDE but the thing is that Flutter was not build for this architecture.
Except if the Flutter team decides for some reason to support HarmonyOS I don't think it will be possible to develop HarmonyOS applications by using Flutter.

Ionic HTTPS requests failing on Android 9

Disclaimer: this looks incredibly the same as Ionic Native HTTP does not work for Anroid 9 (Pie) and up? but it isn't!
We are facing an incredibly strange and hard problem after updating our app today.
We are mantaining an Ionic v1 app for Android. It uses Cordova-Android 7. Today when we were uploading a new update to the play store we found a restriction forcing us to target SDK starting from 28. We added <preference name="android-targetSdkVersion" value="28" /> to the config.xml file, re-built the app, tested on some smartphones and uploaded it. After distribution, we found that all network communication is failing on Android 9 devices. We were sure that this would be the popular cleartext error, so we changed all URLs to HTTPS. But the problem persisted. Then we build the app again but with the debuggable attribute on the manifest so we could inspect the app and see the errors, and we discovered that if we switch the debuggable feature on, the error doesn't happen - we are just adding it to the manifest, we are still building with the --release flag.
So, the final scenario is:
http requests fail only after targeting SDK 28, only on Android 9 devices, and only if the app is built with --release flag and we don't put the debuggable attribute on the manifest
if we change any point above error disappears so no way to debug
app is using https on all requests
when the app fails, requests don't reach the server, we already watched at that
So what the hell may be failing here?
Finally it seemed to be a somewhat kind of cleartext error teorically out of any specification. Our discovery was that adding
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
to the android platform tag on the config.xml file solved the problem. So we can assure that on our Ionic 1 + Cordova-Android 7 + Cordova CLI 8 + Ionic CLI 4 + HTTPS + non debuggable production build scenario, HTTPS requests were interpreted as cleartext requests and thus blocked until we statedly allowed them.

Minimum Android version with flutter

Which minimum android version is supported by flutter?
Do some plugins have any effect on which version is not supported?
I tried to run my flutter app on an android emulator, but with the version android 16 it doesn't work and the app crashes. Do I have to change the compile version in some config files or why doesn't it work?
Flutter support 16. But to run app on Android emulator, use over 19.
https://github.com/flutter/flutter/issues/11094
https://github.com/flutter/flutter/issues/9108
https://github.com/flutter/flutter/issues/8610
From Flutters FAQ
flutter.dev/docs/resources/faq#what-devices-and-os-versions-does-flutter-run-on
Mobile operating systems: Android Jelly Bean, v16, 4.1.x or newer, and
iOS 8 or newer.
Mobile hardware: iOS devices (iPhone 4S or newer) and ARM Android
devices.
Note Flutter currently does not support building for x86 Android
(issue #9253) directly, however apps built for ARMv7 or ARM64 run fine
(via ARM emulation) on many x86 Android devices.
We support developing Flutter apps with Android and iOS devices, as
well as with Android emulators and the iOS simulator.
We test on a variety of low-end to high-end phones but we don’t yet
have an official device compatibility guarantee.
We believe Flutter works well on tablets. We do not currently
implement all of the tablet-specific adaptations recommended by
Material Design, though we are planning further investment in this
area
The answer to this question also, partly, needs to take into consideration what parts of Android you want to take advantage of in your application. The question of what min version Flutter supports has been answered here a couple of times so I won't answer that, but the Android support libraries will also need specific min versions.
If you plan to use plugins of any kind then you will probably hit multiple issues if your min version is too low. Do you need Firebase? Do you need specific camera functions?
Google also just announced required bumps for min versions with regards to Google Play that you should review.
My advice is to follow documentation, analytics and best practices to determine what you "true" min version should be.
The Flutter documentation has this answer to Android and iOS. Now it says that support: Android Jelly Bean, v16, 4.1.x or newer, and iOS 8 or newer. However, this information can change according to the new Flutter version. By this reason, it is better that you review the next link:
https://flutter.dev/docs/resources/faq#what-devices-and-os-versions-does-flutter-run-on
Furthermore, it would be best if you analyzed the plugins because they could need higher versions of Android and iOS.
This answer can be useful :
Devices and OS versions on which Flutter runs
Mobile operating systems: Android Jelly Bean, v16, 4.1.x or newer, and iOS 8 or newer.
Mobile hardware: iOS devices (iPhone 4S or newer) and ARM Android devices.
You can learn more here

Ionic app shows white screen after splash for 14-15 second

I'm working on ionic2.Few days ago,ionic2 was updated.After splash screen,we get the white screen for 14-15 second ,due to ionic2 was updated.
Add the --prod flag during any of the following CLI commands:
// If iOS
ionic emulate ios --prod
ionic build ios --prod
ionic run ios --prod
// If Android
ionic emulate android --prod
ionic build android --prod
ionic run android --prod
More about this.
there is some issues with that, you can follow them here github.com/driftyco/ionic/issues/9686 there is also some issue in ionic-app-scripts and there is some solutions try it
I'm assuming this in Android specific. I was having the same problem, the issue is two-fold:
The app is loading very slowly. If you watch console logs you'll see you get a note about it's taking 11000ms to load or whatever
Android is trying to be helpful by hiding the splash screen before you app is actually ready
I can't help you with #1, review your plugins, google around a bunch, and good luck. As for #2, you can add the line to config.xml to resolve
<preference name="AutoHideSplashScreen" value="false" />
Increase the SplashScreenDelay until you the app is reliably loaded before it hides.
Make sure you have SplashScreen.hide() in your platform.ready function in your main module as well so that when your app actually does load it'll hide.
You can find a bit more in Cordova, Android, incredibly slow loading

Admob and API version 8

I develop on an.. let's say: not ultramodern computer, and were doing fine so far developing with the emulator for API version 8. Now I try to use Admob (after meddling with "Adsense for Mobile Apps" which never displayed any ads for some reason), but it turns out that I need an API target of 13 to use it.
Is there any way to get it to run with 8?
In my Manifest file, I have defined
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
already. After my investigations and the tips I have read so far, I tried the 'reduced' set for the Android Manifest,
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
but running it on the v8 emulator produces a number of exceptions basically complaining that the required configChanges are not set.
I have read about a 'trick' of using an older Admob SDK, but also the warning of Google that from end of 2011, they won't display ads anymore and the new version must be used.
The worst thing is that I can't even run my own app on my connected mobile phone (HTC Legend, v2.3.7 / API 10) if I want to use Admob?!
Or maybe I am missing something, am quite frustrated right now.
There is a way. Check out this blog post, which applies to AdMob SDK 6.0 as well.
The TL;DR:
Set target in project.properties to android-13 or higher. You need the full set of configurations:
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
As long as minSdkVersion is 8, you can still run on Android 2.2.