android中几个很有用的的api

0x0001

public PackageInfo getPackageArchiveInfo (String archiveFilePath, int flags)

Since: API Level 1

Retrieve overall information about an application package defined in a package archive file

Parameters
  • archiveFilePath   The path to the archive file
  • flags Additional option flags. Use any combination of GET_ACTIVITIES,
    GET_GIDS, GET_CONFIGURATIONS, GET_INSTRUMENTATION, GET_PERMISSIONS,
    GET_PROVIDERS, GET_RECEIVERS, GET_SERVICES, GET_SIGNATURES, to modify the
    data returned.
Returns
  • Returns the information about the package. Returns null if the package could not be successfully parsed.

0x0002

public abstract PackageInfo getPackageInfo (String packageName, int flags)

Since: API Level 1

Retrieve overall information about an application package that is installed on the system.

Throws PackageManager.NameNotFoundException if a package with the given name can not be found on the system.

Parameters
  • packageName The full name (i.e. com.google.apps.contacts) of the desired package.
  • flags Additional option flags. Use any combination of GET_ACTIVITIES, GET_GIDS, GET_CONFIGURATIONS,
    GET_INSTRUMENTATION, GET_PERMISSIONS, GET_PROVIDERS, GET_RECEIVERS,
    GET_SERVICES, GET_SIGNATURES, GET_UNINSTALLED_PACKAGES to modify the data returned.
Returns
  • Returns a PackageInfo object containing information about the package. If flag GET_UNINSTALLED_PACKAGES is set and if the package is not found in the list of installed applications, the package information is retrieved from the list of uninstalled applications(which includes installed applications as well as applications with data directory ie applications which had been deleted with DONT_DELTE_DATA flag set).

0x0003

public abstract File getDir (String name, int mode)

Since: API Level 1

Retrieve, creating if needed, a new directory in which the application can place its own custom data files. You can use the returned File object to create and access files in this directory. Note that files created through a File object will only be accessible by your own application; you can only set the mode of the entire directory, not of individual files.

Parameters
  • name Name of the directory to retrieve. This is a directory that is created as part of your application data.
  • mode Operating mode. Use 0 or MODE_PRIVATE for the default operation, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE to control permissions.
Returns
  • Returns a File object for the requested directory. The directory will have been created if it does not already exist.

0x0004

public DexClassLoader (String dexPath, String dexOutputDir, String libPath, ClassLoader parent)

Since: API Level 3

Creates a DexClassLoader that finds interpreted and native code. Interpreted classes are found in a set of DEX files contained in Jar or APK files. The path lists are separated using the character specified by the "path.separator" system property, which defaults to ":".

Parameters
  • dexPath the list of jar/apk files containing classes and resources
  • dexOutputDir directory where optimized DEX files should be written
  • libPath the list of directories containing native libraries; may be null
  • parent the parent class loader
   

不错的文章:

1、  http://blog.csdn.net/singwhatiwanna/article/details/22597587  关于加载apk中的类和代理实现的一种思路

时间: 2024-08-22 12:08:33

android中几个很有用的的api的相关文章

Web 开发中 20 个很有用的 CSS 库

转自:http://www.oschina.net/translate/css-libraries-for-developers 在过去的几年中,CSS已经成为一大部分开发者和设计者的最爱,因为它提供了一系列功能和特性.每个月都有无数个围绕CSS的工具被开发者发布以简化WEB开发.像CSS 库,框架,应用这样的工具能够为开发者做很多事,而且可以使开发者创造出创新立异的WEB应用. 在这篇文件章中我们找到了一系列对开发者有用的CSS库,它们能帮助开发者在一定的期限内取得有创造性和创新性的成果.我们

Web开发中20个很有用的CSS库

来源: 微信公众号文章 在过去的几年中,CSS已经成为一大部分开发者和设计者的最爱,因为它提供了一系列功能和特性.每个月都有无数个围绕CSS的工具被开发者发布以简化WEB开发.像CSS库,框架,应用这样的工具能够为开发者做很多事,而且可以使开发者创造出创新立异的WEB应用. 在过去的几年中,CSS已经成为一大部分开发者和设计者的最爱,因为它提供了一系列功能和特性.每个月都有无数个围绕CSS的工具被开发者发布以简化WEB开发.像CSS 库,框架,应用这样的工具能够为开发者做很多事,而且可以使开发者

MySQL中group_concat函数 --- 很有用的一个用来查询出所有group by 分组后所有 同组内的 内容

本文通过实例介绍了MySQL中的group_concat函数的使用方法,比如select group_concat(name) . MySQL中group_concat函数 完整的语法如下: group_concat([DISTINCT] 要连接的字段 [Order BY ASC/DESC 排序字段] [Separator '分隔符']) 基本查询 mysql> select * from aa; +------+------+ | id| name | +------+------+ |1 |

Android开发中遇到的问题——Android中WARNING: Application does not specify an API level requirement!的解决方法

今天在手机上调试运行Andorid项目时,发现Console打印出"WARNING: Application does not specify an API level requirement!"这样的警告信息,如下图所示: 虽然不影响项目的正常运行,不过还是要找出原因,上网查了一下出现警告的原因,原来是创建项目时AndroidManifest.xml文件中没有指定Min SDK Version 解决办法:修改AndroidManifest.xml文件,在<manifest>

Android开发中遇到的问题(四)——Android中WARNING: Application does not specify an API level requirement!的解决方法

今天在手机上调试运行Andorid项目时,发现Console打印出"WARNING: Application does not specify an API level requirement!"这样的警告信息,如下图所示: 虽然不影响项目的正常运行,不过还是要找出原因,上网查了一下出现警告的原因,原来是创建项目时AndroidManifest.xml文件中没有指定Min SDK Version 解决办法:修改AndroidManifest.xml文件,在<manifest>

Android中显示和隐式Intent的使用

显示启动activity                                                                                                                   这个很简单,下面是代码示例:为了看着方便,所以就把layout直接截图了,里面的代码只是一些简单的布局.activity_login.xml: activity_main.xml: 下面是Manifest.xml中的代码 1 <?xml vers

8个很有用的PHP安全函数,你知道几个?

原文:Useful functions to provide secure PHP application 译文:有用的PHP安全函数 译者:dwqs 安 全是编程非常重要的一个方面.在任何一种编程语言中,都提供了许多的函数或者模块来确保程序的安全性.在现代网站应用中,经常要获取来自世界各地用户的输 入,但是,我们都知道“永远不能相信那些用户输入的数据”.所以在各种的Web开发语言中,都会提供保证用户输入数据安全的函数.今天,我们就来看看,在 著名的开源语言PHP中有哪些有用的安全函数. 在PH

Android中Service概述

Service是Android中一种很重要的组件,一般来说有两种用途:用Service执行长期运行的操作,并且与用户没有UI界面的交互:某个应用程序的Service可以被其他应用程序的组件调用以便提供更广泛的使用.要想使得自己写的Service能够正常运行,必须在AndroidManifest.xml中通过标签注册Service,类似于通过标签注册Activity一样.有两种方式使用Service,一种是通过Context类的startService方法启动Service,另一种是通过Conte

Android中自定义视图View之---进阶篇(Canvas的使用)

更多技术内容请移步:我的个人博客 一.前言 今天是周日,昨天刚刚写完了一篇关于如何搭建LNMP环境,让自己可以DIY有个性的个人主页: http://blog.csdn.net/jiangwei0910410003/article/details/50929955 那么今天,我们继续来看一篇关于Android中的UI篇,如何自定义视图View的进阶篇,关于前奏篇之前已经写过了,还没有了解的同学可以去看看:http://blog.csdn.net/jiangwei0910410003/articl