Gallery startup

1 Overview Gallery2 is Gallery3D, GalleryNew3D in the G version of the H version for viewing pictures and video files, editing and management. I google on Gallery3D version of a massive reconstruction, UI style also has a greater difference. First look at the main interface:

ICS on a single browser interface on the G version Gallery2 efficiency than the high-G version, the user experience better. In a single browser interface, ICS added a line below the thumbnail interface, the operation is very convenient. Gallery2 on ICS also supports browsing gif format files (do not know if the gif file is not too large memory overflow). This document its startup process for a simple analysis.
2 Gallery2 boot process analysis
2.1 GalleryProvider start Gallery2 is to look for multimedia files and management, involving many of the operations of the media library. When you first start Gallery2, it will first start GalleryProvider. This class inherits from ContentProvider, it is clear that this is a class library for providing media operation interface. GalleryProvider overloaded basic method of operation of the media library query, delete, update, etc., with the domain com.android.gallery3d.provider.

Media files Gallery2 can operate include: mpeg4, mp4,3gp, 3gpp, 3gpp2 , webbm, bmp, jpeg, gif, png. We will first call onCreate start GalleryProvider () method, which was to do two things:
1. Obtain a GalleryAppIml a reference that references the entire Application;
2. Get a DataManager objects, DataManager class is used to manage all pictures and video files. When obtaining DataManager object, the first a new DataManager object and then call initializeSourceMap DataManager instance, different types of resource objects in a hash table.
the synchronized void initializeSourceMap public () {
IF (mSourceMap.isEmpty ()!) return;
// The Order Matters, UriSource MUST Come The Last
addSourc

Guess you like

Origin blog.csdn.net/qq_42894864/article/details/102671184
Recommended