Android's underlying library Libutils introduction

Source: Internet
Author: User

Android's underlying library Libutils introduction
    • December 5, 2008 11:38
    • Source: The original site
    • I have something to say (0 participants )

The first part Libutils overview

Libutils is the underlying library of Android, which is implemented in C + + and provides an API that is also C + +. Android's hierarchy of C language programs and libraries, mostly based on libutils development.
The header files in Libutils are as follows:
Frameworks/base/include/utils
Source files for Libutils:
Frameworks/base/libs/utils
Libutils Name of the library:
Libutils.so
This library can be divided into two parts, one is the underlying tool, and the other is the binder mechanism that implements the IPC (interprocess communication) primarily.

Part II Public Library overview

The common library section in Libutils mainly contains header files as follows:
Errors.h: Define a macro to represent an error code
Endian.h: Defines a macro that represents a size end
Misc.h: Several string and file-related function functions

TextOutput.h: Defines the base class for text output textoutput
BufferedTextOutput.h: Class Bufferedtextoutput, which is an implementation of Textoutput
Pipe.h: Defining Pipe class Pipes
Buffer.h: Defines the memory buffer area of the class buffer
List.h: Defining a template class for a linked list

SharedBuffer.h: Defines the class Sharedbuffer to represent shared memory.
String16.h: Defines a class that represents a double-byte string String16
String8.h: Defines a class String8 that represents a single-byte string, and contains a conversion function from STRING16

VectorImpl.h: Defines a class that represents vectors vectorimpl
Vector.h: Defines a class template vector that inherits Vectorimpl, and a sort vector class Sortedvectorimpl
SortedVector.h: Defines the template for the sort vector sortedvector
KeyedVector.h: Defines a vector template that uses keywords Keyedvector

Threads.h: Defines thread-related classes, including threads thread, mutex mutex, condition variable condition, read-write lock Readwritelock, and so on
Socket.h: Defines a socket-related class socket
Timers.h: Defines time-related functions and timer class Durationtimer.
ZipEntry.h, ZipFileCRO.h, ZipFile.h, ZipFileRO.h, ZipUtils.h: Classes related to the ZIP function.


Part III Binder Inter-process Communication Section

Binder is the core of the interprocess communication component, which provides a portable inter-process communication tool for different systems.
RefBase.h:
A reference count that defines the class refbase.
Parcel.h:
Define the container for the data transferred in the IPC, define the class parcel
IBinder.h:
Abstract interface for Binder objects, defining class IBinder
Binder.h:
Binder Object Basic function, define class binder and Bprefbase
BpBinder.h:
Bpbinder function, define class Bpbinder
IInterface.h:
Defines a generic class for an abstract binder-like interface,
Define class IInterface, class template Bninterface, class template Bpinterface
ProcessState.h
Class that represents the state of the process, defines the class Processstate
IPCThreadState.h
Represents the state of an IPC thread, defining a class Ipcthreadstate


IServiceManager.h: A class that represents a service manager for use by other classes that need to construct the service
IPermissionController.h: Permission control class.

The header files for several memory-related classes are as follows:
IMemory.h: An interface that defines memory-related classes, classes Imemoryheap and bnmemoryheap that represent heap memory, classes that represent general memory

Imemory and Bnmemory.
MemoryHeapBase.h: Define class Memoryheapbase, inherit and implement Bnmemoryheap
MemoryBase.h: Define class Memorybase, inherit and implement Bnmemory
In general use, the Memoryheapbase class is typically used to allocate a chunk of memory (like malloc), while Memorybase represents a portion of memory allocated from a piece of heap memory.

In addition, the memory-related features include header files MemoryDealer.h and MemoryHeapPmem.h.

Android's underlying library Libutils introduction

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.