简体   繁体   English

离子在Android设备上安装应用程序

[英]Ionic get installed apps on android device

我是 ionic 框架和移动应用程序的新手,是否有任何插件或方法可以获取 android 设备上已安装应用程序的列表?

There is indeed a ready-made Cordova plugin available that gives the list of installed apps in the device.确实有一个现成的 Cordova 插件可用,可提供设备中已安装应用程序的列表。 This AppList Plugin should help you out.这个AppList 插件应该可以帮助你。

Infact it gives the app icon as well.事实上,它也提供了应用程序图标。

UPDATE: There are no such ready-made plugin available yet for iOS as far as I know.更新:据我所知,目前还没有适用于 iOS 的现成插件。

Add添加

import * as Applist from 'cordova-plugin-applist2/www/Applist.js';
import { Platform } from '@ionic/angular';

to your component .ts file到您的组件 .ts 文件

Then to use it in probably constructor然后在可能的构造函数中使用它

constructor(public platform: Platform) {
  platform.ready().then(
    function(){
      if(platform.is('android') && !platform.is('mobileweb')){
          var success = function(app_list) { 
            //success function
            console.log(app_list);
           };
          var error = function(app_list) {  
            //error          
            console.log("An Error occured while fetching App Lists");
            console.error(app_list);
          };
          //for the date parameters, any date is okay, 
          //the first date should be in the past
          Applist.createEvent('', '', '', new Date(1999, 10, 11, 12, 12, 12, 12), new Date(), success, error);
      }
    }
  );
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 离子在带有图标的安卓设备上安装应用程序 - Ionic get installed apps on android device with icon 如何获取 Android 设备上已安装应用程序的列表 - How to get a list of installed apps on Android device 获取Android设备上已安装的应用程序数量? - Get number of installed apps on an Android device? 如何获取用户在 Android 设备上安装的应用列表? - How to get the list of apps that have been installed by a user on an Android device? Android CTS是否会测试设备中已安装的应用程序? - Does Android CTS test installed apps in device? 如何确定在Android设备上安装的应用程序? - How to determine apps installed on Android device? 如何了解Android设备上安装的应用程序 - How to know about the apps installed on the android device 使用cordova如何获得Android设备上已安装的应用程序列表? - Using cordova how can i get list of installed apps on android device? 如何在Android设备中安装的应用程序的AndroidManifest.xml文件中获取权限? - How do I get permissions only in AndroidManifest.xml file for installed apps in android device? 如何在Android手机上安装所有应用程序 - How to get all apps installed on android phone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM