How to check installed android app in flutter?

We will be using Flutter device apps plugin to check the required app is already installed on Android device or not. To get this plugin follow this link Device Apps.

Step 1 : Paste this dependency “device_apps: ^1.0.9” in “pubspec.yaml” file of your project and save it.

Step 2 : Now go to the dart file in which you want enter the code to detect the required app is installed or not. Create a function as shown below as an example.

Step 3 : Here “com.example.myapp ” is package name of the app thru which the app will be search inside your device. After adding this code you will need to import device apps library in your dart file as shown below.

Step 4 : Now use the above mentioned function “Check” under any Button with “on tap” property. This function will give value “True” if it finds the mentioned app or value “False” if the app is not in your device as shown below.

Step 5 : Here we have received value as “true” in “DEBUG CONSOLE” which shows that the app is already installed in the device.

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

how to add app launcher icon in flutter ?

how to add app launcher icon in flutter ?

Just follow below steps to add launcher icon in flutter application

  • Place required launcher icon at project location . In my case i have placed it at images folder
  • Add dependency in pubspec.yaml i.e. Change this code

dev_dependencies:
flutter_test:
sdk: flutter

to

dev_dependencies:
flutter_test:
sdk: flutter

flutter_launcher_icons: ^0.7.4

flutter_icons:
android: “launcher_icon”
ios: true
image_path: “images/icon.png”

  • Run flutter pub get command from terminal
  • Run flutter pub run flutter_launcher_icons:main command from terminal
  • Wait for below output

Android minSdkVersion = 16
Creating default icons Android
Adding a new Android launcher icon
Overwriting default iOS launcher icon with new icon

Then reinstall the app into your handset

Hey You got the launcher icon Congrats

 

 

 

 

 

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

how to Prepare an android app for release in flutter

 

how to Prepare an android app for release in flutter?

Step 1 : First review the app manifest file 

in case of flutter you will get app manifest file here at location <app dir>/android/app/src/main





step 2 : Please check your package name this will be your app unique id in playstore ( How to change package name in flutter



step 3 : Please check permission in same file  Android Manifest file 

Internet permission should be there if your app need an internet access. if your app does not need internet access then remove the internet permission line 

step 4 : Review the build configuration in file build.gradle at folder location <app dir>/android/app/



step 5 : check the default id in build.gradle file . This should be matched with Android Manifest file package name. You can change minsdkversion and targetsdkversion here only. In case of flutter versioncode and version name will be picked from pubspec.yaml file. 



step 6: Add the launcher icon 
add dev dependency in pubspec.yaml  and place icon.png under images folder
flutter_launcher_icons: ^0.7.3
flutter_icons:
  android: "launcher_icon"

  ios: true

  image_path: "images/icon.png"
see below screenshot for clarity
run below commands
flutter pub get
flutter pub run flutter_launcher_icons:main
Step 7: sign the app by creating keystore file 

You need to sign the app digitally to upload it into playstore  
Run command 

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key 

In My Case it is " C:\Program Files (x86)\Java\jdk1.8.0_151\bin>keytool -genkey -v -keystore E:\pro jects\flutterprojects\santeyalibota/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key" 

step 8. reference the keystore file from the app 
create file at <app dir>/android/key.properties  
and load it with your data  
storePassword=<password from previous step> 
keyPassword=<password from previous step> 
keyAlias=key 
storeFile=<location of the key store file, e.g. /Users/<user name>/key.jks>

Note: Keep this file private; do not check it into public source control. 

step 9 : configure signing in build.gradle file

Replace:

android {
with the keystore information from your properties file:

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
  1. Replace:
    
    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
    
    
    with:
    
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
    
Release builds of your app will now be signed automatically.

Step 10: Enable Proguard 

Create /android/app/proguard-rules.pro file and add rules listed below.

#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
The configuration above only protects Flutter engine libraries.

Step 11 : Enable obfuscation

Open /android/app/build.gradle file and locate buildTypes definition. Inside release configuration set minifiyEnabled and useProguard flags to true. You have to also point ProGuard to the file you have created in previous step

android { ... buildTypes { release { signingConfig signingConfigs.release minifyEnabled true useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }

Note: Obfuscation and minification can extend compilation time of the Android application.

Step 12 : build the release apk

Using the command line:
  1. cd <app dir> (replace <app dir> with your application’s directory).
  2. Run flutter build apk (flutter build defaults to --release).
The release APK for your app is created at <app dir>/build/app/outputs/apk/release/app-release.apk.

Step 13 : install the release apk on a device

Connect your Android device to your computer with a USB cable.

cd <app dir> where <app dir> is your application directory

Run flutter install .

Step 14 : Publishing an APK to the Google Play Store

Thats it 



* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

How to change launcher icon in flutter?

How to change launcher icon in flutter?

To change the launcher icon, open the ‘pubspec.yaml‘ file in your project. Under ‘dev_dependencies’ enter launcher icon package dependency as shown below. Click here to know the latest version of Launcher Icon.

  dev_dependencies:
      flutter_launcher_icons: "^0.7.0"

Now write as shown below starting with ‘flutter_icons’:

  flutter_icons:
      android: "launcher_icon"
      ios: "true"
      image_path: "assets/logo.png"

Once the whole code is written, run below written commands under terminal window:

  flutter packages get
  flutter packages pub run flutter_launcher_icons:main

 

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

How to change package name in flutter?

How to change package name in flutter?

We will start by changing the Android App Name first:

  • Open this file ‘AndroidManifest.xml‘ in your project and enter required name in front of ‘android:label’:
<application android:name="io.flutter.app.FlutterApplication"
     android:label=“EnterAppNameHere” 

Now we change the Package Name:

  • In the same file ‘AndroidManifest.xml‘  inside below mentioned line enter package name after ‘package=’:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
     package="your.package.name" 

                                                                           

  • Now in ‘build.gradle‘ file enter package name after ‘applicationId‘:
defaultConfig { applicationId "your.package.name"
         }
  • Open this file now ‘MainActivity.java’ and on top you will find ‘package’ where you can enter package name as below:
             package your.package.name;
             import android.os.Bundle;
             import io.flutter.app.FlutterActivity;
  • Last Step is to change the Directory name under Android Folder:

          Before  

android\app\src\main\java\com\example\name

\com   –> \your

\example  –> \package

          After change

android\app\src\main\java\your\package\name

 

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

How to install Flutter on windows

Following are the steps to install Flutter on Windows platform:

System Requirements 

→  OS – Windows 7 with SP1 or higher

→  Min. Disk space – 400 MB excluding space for IDE/tools

→  Tools – (i) PowerShell 5.0 or higher. > Check whether Powershell installed on your system

(ii) GIT required for windows. > Download GIT

 

Flutter SDK

→  Download latest Flutter SDK

→  Extract the zip file.

→  Locate “flutter_console.bat” file in extracted folder and double click on it.

→  Type “flutter doctor”.

→  Required dependencies will be shown need to install.

 

Upgrade your Flutter SDK

→  Type “flutter upgrade” in flutter console and press Enter.

 

Download the JDK Latest Version

→  Click here to download JDK

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

An error occured during installation: Failed to move away or delete existing target file

Hey we got the solution of this problem

First, I renamed android-sdk-path\tools to android-sdk-path\tooltest.

Run sdkmanager –update in tooltest\bin.

Ignore the warning and wait until the update is done.

There will be a new folder named tools in android-sdk-path.

Copy all the files in tools folder and paste them to tooltest folder.

Overlay all the files that which has the same name in tooltest folder.

Finally,delete tools folder and rename tooltest to tools.

Is this solved?????? Oh yes its solved

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.