Giter VIP home page Giter VIP logo

flutter_plugin_device_apps's Introduction

Device Apps plugin for Flutter

Pub

A plugin to list installed applications on an Android device (โš ๏ธ iOS is not supported).

Change with Android 11

Starting with Android 11, Android applications targeting API level 30, willing to list "external" applications have to declare a new "normal" permission in their AndroidManifest.xml file called QUERY_ALL_PACKAGES. A few notes about this:

  • A normal permission doesn't require the user consent
  • Don't worry, this plugin automatically adds the permission for you

However, publishing applications on the Google Play with this kind of feature may change in the future. Quoting from the documentation:

In an upcoming policy update, look for Google Play to provide guidelines for apps that need the QUERY_ALL_PACKAGES permission.

๐Ÿ‘ Right now, there is no limitation, but be aware that this may change in the future.

Getting Started

First, you have to import the package in your dart file with:

import 'package:device_apps/device_apps.dart';

List of installed applications

To list applications installed on the device:

List<Application> apps = await DeviceApps.getInstalledApplications();

You can filter system apps if necessary.

Note: The list of apps is not ordered! You have to do it yourself.

Get apps with a launch Intent

A launch Intent means you can launch the application.

To list only the apps with launch intents, simply use the onlyAppsWithLaunchIntent: true attribute.

// Returns a list of only those apps that have launch intent
List<Application> apps = await DeviceApps.getInstalledApplications(onlyAppsWithLaunchIntent: true, includeSystemApps: true)

Get an application

To get a specific application info, please provide its package name:

Application app = await DeviceApps.getApp('com.frandroid.app');

Check if an application is installed

To check if an app is installed (via its package name):

bool isInstalled = await DeviceApps.isAppInstalled('com.frandroid.app');

Open an application

To open an application (with a launch Intent)

DeviceApps.openApp('com.frandroid.app');

Include application icon

When calling getInstalledApplications() or getApp() methods, you can also ask for the icon. To display the image, just call:

Image.memory(app.icon);

flutter_plugin_device_apps's People

Contributors

g123k avatar lohanidamodar avatar faisalansari0367 avatar frioo avatar imchetanyadav avatar refi64 avatar sleeyax avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.