Some of the most useful APIs in Android

Source: Internet
Author: User

0x0001Public 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 is not successfully parsed.
0x0002Public abstract PackageInfo getpackageinfo (String packagename, int flags) SINCE:API Level 1

Retrieve overall information about a application package, that's installed on the system.

Throws PackageManager.NameNotFoundException If a package with the given name can is found on the system.

Parameters
    • PackageName The full name (i.e Com.google.apps.contacts) of the 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 Appli Cations with Data directory IE applications which had been deleted with Dont_delte_data flag set).
0x0003Public 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 into create and access files in this directory. Note that files created through a File object is only being accessible by your own application; You can only set the mode of the entire directory, not the individual files.

Parameters
    • name Name of the directory to retrieve. This is a directory for 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'll has been created if it does not already exist.
0x0004public dexclassloader (String Dexpath, String Dexoutputdir, String LibPath, ClassLoader parent) SINCE:API Level 3

Creates a that DexClassLoader finds interpreted and native code. Interpreted classes is found in a set of DEX files contained in Jar or APK files. The path lists is 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 resource s
    • dexoutputdir directory where optimized DEX files should be written
    • < Span class= "Apple-tab-span" >libpath The list of directories containing native libraries; Null
    • parent the parent class loader  

A Good article:

1, http://blog.csdn.net/singwhatiwanna/article/details/22597587 about loading APK class and agent implementation of a way of thinking

Some of the most useful APIs in Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.