Android adapters Simpleadapter and baseadapter
When designing a network program or data processing display program, you often usesimpleadapter and baseadapter to achieve. adapter is the adapter mode, which is the bridge between the data and the interface. baseadapter is an abstract class that must be used to define subclasses and implement related methods. simpleadapter is derived from baseadapter , and the relevant methods have been implemented, so it can be used directly. There is not much difference between the two in the use effect, both can design a nearly identical interface. But on the use of methods, baseadapter need to create a subclass derived from the class, and implement some methods of the parent class, he can be based on our interface and the needs of the data free customization. simpleadapter can be used directly, but the data structure used by the adapter is hashmap If you need to manipulate the data object structure is too complex, such as a large number of members, member content is not a basic type, etc., it is necessary to write the relevant conversion code, which will facilitate the program's efficiency and maintainability of the poor . Sometimes, we face the problem of which adapter to use. If the data structure is very simple, the operation of the database object members are very few, no non-basic type of data members, just as a simple display, then simpleadapter is a good choice, simple and efficient and fast. If there are many members, the members contain complex objects, such as button , darwable , etc., using baseadapter makes the code simple and efficient.
Http://www.tuicool.com/articles/fmQfMr
The difference is that the Simpleadapter data source is list< Map<string,?>, that is, the value of HashMap must be a simple type, otherwise a complex conversion.