當前位置:首頁 » 安卓系統 » androidpm

androidpm

發布時間: 2022-02-09 02:51:13

⑴ adb shell am和pm的區別

AM,表示上午;PM,表示下午。 AM(拉丁ante meridiem的縮寫)指的是從零晨到上午時段,PM(拉丁ante meridiem)意為「中午之前」。是指下午13到0點之間。

⑵ adb install怎麼調用到pm.java

其入口函數源文件為pm.java
(源文件路徑:android\frameworks\base\cmds\pm\src\com\android\commands\pm\pm.java)
其中\system\framework\pm.jar 包管理庫
包管理腳本 \system\bin\pm 解析
showUsage就是使用方法
private static void showUsage() {
System.err.println("usage: pm [list|path|install|uninstall]");
System.err.println(" pm list packages [-f]");
System.err.println(" pm list permission-groups");
System.err.println(" pm list permissions [-g] [-f] [-d] [-u] [GROUP]");
System.err.println(" pm list instrumentation [-f] [TARGET-PACKAGE]");
System.err.println(" pm list features");
System.err.println(" pm path PACKAGE");
System.err.println(" pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH");
System.err.println(" pm uninstall [-k] PACKAGE");
System.err.println(" pm enable PACKAGE_OR_COMPONENT");
System.err.println(" pm disable PACKAGE_OR_COMPONENT");
System.err.println(" pm setInstallLocation [0/auto] [1/internal] [2/external]");
**********************省略**************************
}

⑶ android 利用 pm命令 靜默安裝 不成功,怎麼整

跟手機有關,android是開源的,很多手機廠商都自己做了修改,包括許可權,SD卡路徑等。
另外看看你報錯的log,貼出來

⑷ android pm grant 怎麼用

Grant裡面一共有三個類,分別是:

(1)Permissions

[java] view plain


package com.anthonycr.grant;

/**
* Enum class to handle the different states
* of permissions since the PackageManager only
* has a granted and denied state.
*/
enum Permissions {
GRANTED,
DENIED,
NOT_FOUND
}

這是一個枚舉類,用來對應三種狀態:已授權,授權失敗,未發現的許可權

(2)PermissionsManager
package com.anthonycr.grant;

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.util.Log;

import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
這個類主要是獲取單例下的許可權管理類,然後通過內部方法進行許可權管理
(3)PermissionsResultAction

[java] view plain


package com.anthonycr.grant;

import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.util.Log;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/

⑸ android kernel和標准linux kernel的區別

android kernel和標准linux kernel的區別
總的區別可以歸納如下:
ARCH -- 這是Android修改了arch/arm下面的一些文件:
arch/arm:
Chg: arch/arm/kernel/entry-armv.S
Chg: arch/arm/kernel/mole.c
Chg: arch/arm/kernel/process.c
Chg: arch/arm/kernel/ptrace.c
Chg: arch/arm/kernel/setup.c
Chg: arch/arm/kernel/signal.c
Chg: arch/arm/kernel/traps.c
Chg: arch/arm/mm/cache-v6.S
Chg: arch/arm/vfp/entry.S
Chg: arch/arm/vfp/vfp.h
Chg: arch/arm/vfp/vfphw.S
Chg: arch/arm/vfp/vfpmole.c
Goldfish -- 這是Android為了模擬器所開發的一個虛擬硬體平台。Goldfish執行arm926T指令(在2.6.29中,goldfish也支持ATMv7指令),但是在實際的設備中,該虛擬平台的文件不會被編譯
arch/arm/mach-goldfish:
New: arch/arm/mach-goldfish/audio.c
New: arch/arm/mach-goldfish/board-goldfish.c
New: arch/arm/mach-goldfish/pdev_bus.c
New: arch/arm/mach-goldfish/pm.c
New: arch/arm/mach-goldfish/switch.c
New: arch/arm/mach-goldfish/timer.c
YAFFS2 -- 和PC把文件存儲在硬碟上不一樣, 移動設備一般把Flash作為存儲設備。尤其是NAND flash應用非常廣泛(絕大多數手機用的都是NAND flash,三星的一些手機使用的是OneNAND)。NAND flash具有低成本和高密度的優點。
YAFFS2 是「Yet Another Flash File System, 2nd edition" 的簡稱。 它提供在Linux內核和NAND flash設備 之前高效率的介面。 YAFFS2並沒有包含在標準的Linux內核中, Google把它添加到了Android的kernel
fs/yaffs2:
New: fs/yaffs2/devextras.h
New: fs/yaffs2/Kconfig
New: fs/yaffs2/Makefile
New: fs/yaffs2/moleconfig.h
New: fs/yaffs2/yaffs_checkptrw.c
New: fs/yaffs2/yaffs_checkptrw.h
New: fs/yaffs2/yaffs_ecc.c
New: fs/yaffs2/yaffs_ecc.h
New: fs/yaffs2/yaffs_fs.c
New: fs/yaffs2/yaffs_getblockinfo.h
New: fs/yaffs2/yaffs_guts.c
New: fs/yaffs2/yaffs_guts.h
New: fs/yaffs2/yaffsinterface.h
New: fs/yaffs2/yaffs_mtdif1.c
New: fs/yaffs2/yaffs_mtdif1.h
New: fs/yaffs2/yaffs_mtdif2.c
New: fs/yaffs2/yaffs_mtdif2.h
New: fs/yaffs2/yaffs_mtdif.c
New: fs/yaffs2/yaffs_mtdif.h
New: fs/yaffs2/yaffs_nand.c
New: fs/yaffs2/yaffs_nandemul2k.h
New: fs/yaffs2/yaffs_nand.h
New: fs/yaffs2/yaffs_packedtags1.c
New: fs/yaffs2/yaffs_packedtags1.h
New: fs/yaffs2/yaffs_packedtags2.c
New: fs/yaffs2/yaffs_packedtags2.h
New: fs/yaffs2/yaffs_qsort.c
New: fs/yaffs2/yaffs_qsort.h
New: fs/yaffs2/yaffs_tagscompat.c
New: fs/yaffs2/yaffs_tagscompat.h
New: fs/yaffs2/yaffs_tagsvalidity.c
New: fs/yaffs2/yaffs_tagsvalidity.h
New: fs/yaffs2/yportenv.h
Bluetooth -- Google為Bluetooth打上了patch,fix了一些Bluetooth的bug
drivers/bluetooth:
Chg: drivers/bluetooth/bfusb.c
Chg: drivers/bluetooth/bt3c_cs.c
Chg: drivers/bluetooth/btusb.c
Chg: drivers/bluetooth/hci_h4.c
Chg: drivers/bluetooth/hci_ll.c
Scheler -- 對於Scheler的改變非常小,我對它並沒有去研究。
Chg: kernel/sched.c

New Android Functionality -- 除了fix一些bug以及其他一些小的更改,Android增加了一些新的功能,介紹如下:
IPC Binder -- The IPC Binder is an Inter-Process Communication (IPC) mechanism. It allows processes to provide services to other processes via a set of higher-level APIs than are available in standard Linux. An Internet search indicated that the Binder concept originated at Be, Inc., and then made its way into Palm's software, before Google wrote a new Binder for Android.
New: drivers/staging/android/binder.c
Low Memory Killer -- Android adds a low-memory killer that, each time it's called, scans the list of running Linux processes, and kills one. It was not clear in our cursory examination why Android adds a low-memory killer on top of the already existing one in the standard Linux kernel.
New: drivers/staging/android/lowmemorykiller.c
Ashmem -- Ashmem is an Anonymous SHared MEMory system that adds interfaces so processes can share named blocks of memory. As an example, the system could use Ashmem to store icons, which multiple processes could then access when drawing their UI. The advantage of Ashmem over traditional Linux shared memory is that it provides a means for the kernel to reclaim these shared memory blocks if they are not currently in use. If a process then tries to access a shared memory block the kernel has freed, it will receive an error, and will then need to reallocate the block and reload the data.
New: mm/ashmem.c
RAM Console and Log Device -- To aid in debugging, Android adds the ability to store kernel log messages to a RAM buffer. Additionally, Android adds a separate logging mole so that user processes can read and write user log messages.
New: drivers/staging/android/ram_console.c
Android Debug Bridge -- Debugging embedded devices can best be described as challenging. To make debugging easier, Google created the Android Debug Bridge (ADB), which is a protocol that runs over a USB link between a hardware device running Android and a developer writing applications on a desktop PC.
drivers/usb/gadget:
New: drivers/usb/gadget/android.c
Chg: drivers/usb/gadget/composite.c
Chg: drivers/usb/gadget/f_acm.c
New: drivers/usb/gadget/f_acm.h
New: drivers/usb/gadget/f_adb.c
New: drivers/usb/gadget/f_adb.h
New: drivers/usb/gadget/f_mass_storage.c
New: drivers/usb/gadget/f_mass_storage.h

Android also adds a new real-time clock, switch support, and timed GPIO support. We list the impacted files for these new moles at the end of this document.
Power Management -- Power management is one of the most difficult pieces to get right in mobile devices, so we split it out into a group separate from the other pieces. It's interesting to note that Google added a new power management system to Linux, rather than reuse what already existed. We list the impacted files at the end of this document.
kernel/power:
New: kernel/power/consoleearlysuspend.c
New: kernel/power/earlysuspend.c
New: kernel/power/fbearlysuspend.c
Chg: kernel/power/main.c
Chg: kernel/power/power.h
Chg: kernel/power/process.c
New: kernel/power/userwakelock.c
New: kernel/power/wakelock.c
Miscellaneous Changes -- In addition to the above, we found a number of changes that could best be described as, 'Miscellaneous.' Among other things, these changes include additional debugging support, keypad light controls, and management of TCP networking.
(freedom_asic)

⑹ android.content.pm.ipackageinstallobserver 1.5以後沒了用什麼代替

今天一個同學要我給他解決一個android問題,我看了下程序import android.content.pm.IPackageInstallObserver ;語句出了錯誤。很明顯既然是版本問題肯定是現在已經不存在這個包了。網路了下才知道


然後我就想既然1.5有這個包的話,那就直接把那個包給傳到我自己的android2.3版本裡面來,然後我就打開E:\android\android-sdk\platforms\android-10下的android.jar文件,進入android.content.pm。然後吧IPackageInstallObserver.class文件復制進來。
上面的步驟弄完之後,重啟eclipse發現一個新的問題。extends IPackageInstallObserver.Stub語句除了問題。然後估計又缺少了那個class文件。但不知道去少了哪個,對比了下1.5版本的jar包,沒發現少了啥,然後網路,沒發現問題,然後谷歌發現有http //www jarvana com/jarvana/view/com/google/android/android/1.5_r4/android-1.5_r4.jar!/android/content/pm/IPackageInstallObserver$Stub.class?classDetails=ok可以下載一個class文件。然後下載了,像之前一樣放進去之後,重啟eclipse,發現沒錯誤了。
然後最後運行,發現我了個擦,竟然是個srtp項目,痛恨這東西,去年報了個,我是少數幾個沒申報成功的,嗨。桑心事。

⑺ 為什麼安卓設備用pm install -r命令靜默安裝應用時報錯Failure [INSTALL_FAILED_INVALID_APK]

提示的內容為無效的APK。

那麼就有以下幾種可能:
1,apk文件損壞,不完整。
2,apk文件不支持低版本的系統。

⑻ Android 代碼,關於pm指令安裝apk。

你看你的加號被寫到字元串里了

⑼ android判斷應用是否有某個許可權

您好,很高興為您解答,可以使用如下方式來判斷
PackageManager pm = getPackageManager();
boolean permission = (PackageManager.PERMISSION_GRANTED ==
pm.checkPermission("android.permission.RECORD_AUDIO", "packageName"));
if (permission) {
showToast("有這個許可權");
}else {
showToast("木有這個許可權");
}
希望能幫到您,望採納!

熱點內容
androidsdk接入 發布:2025-01-24 20:54:14 瀏覽:193
我的世界伺服器如何使用路由器映射 發布:2025-01-24 20:49:30 瀏覽:739
腳本操作瀏覽器 發布:2025-01-24 20:41:40 瀏覽:296
fast自動獲取ip地址伺服器無響應 發布:2025-01-24 20:19:13 瀏覽:710
http加密數據 發布:2025-01-24 20:15:00 瀏覽:100
中國存儲行業排名 發布:2025-01-24 20:02:21 瀏覽:422
arm編譯鏈 發布:2025-01-24 19:42:12 瀏覽:700
linuxc的函數返回值 發布:2025-01-24 19:35:23 瀏覽:665
威綸編程軟體反編譯 發布:2025-01-24 19:30:26 瀏覽:49
網路存儲單元 發布:2025-01-24 19:28:04 瀏覽:168