An adapter , supporting a first charging mode and a second charging mode, the first charging mode being a constant voltage mode, the second charging mode being a constant current mode, in which a peak value or a mean value is controlled, and the adapter comprising: a power conversion unit , configured to convert input alternating current to obtain an output voltage and an output current of the adapter , wherein the output current of the adapter is a current with a first pulsating waveform; a sampling and holding unit , coupled to the power conversion unit , and configured to sample the current with the first pulsating waveform in a sampling state, and to hold a peak value of the current with the first pulsating waveform in a holding state; a current sampling control unit , coupled to the sampling and holding unit , and configured to determine whether the sampling and holding unit is in the holding state, and to sample the peak value of the current with the first pulsating waveform held by the sampling and holding unit when the sampling and holding unit is in the holding state, the adapter further comprising: a voltage adjusting unit , coupled to the power conversion unit , and configured to detect and adjust the output voltage of the adapter , wherein the current sampling control unit is coupled to the voltage adjusting unit , and configured to adjust the peak value of the current with the first pulsating waveform by the voltage adjusting unit , and wherein further the voltage adjusting unit is configured to control the peak value of the output current of the adapter to not exceed the current corresponding to the constant current mode. a power conversion unit , configured to convert input alternating current to obtain an output voltage and an output current of the adapter , wherein the output current of the adapter is a current with a first pulsating waveform; a sampling and holding unit , coupled to the power conversion unit , and configured to sample the current with the first pulsating waveform in a sampling state, and to hold a peak value of the current with the first pulsating waveform in a holding state; a current sampling control unit , coupled to the sampling and holding unit , and configured to determine whether the sampling and holding unit is in the holding state, and to sample the peak value of the current with the first pulsating waveform held by the sampling and holding unit when the sampling and holding unit is in the holding state, the adapter further comprising: a voltage adjusting unit , coupled to the power conversion unit , and configured to detect and adjust the output voltage of the adapter , wherein the current sampling control unit is coupled to the voltage adjusting unit , and configured to adjust the peak value of the current with the first pulsating waveform by the voltage adjusting unit , and wherein further the voltage adjusting unit is configured to control the peak value of the output current of the adapter to not exceed the current corresponding to the constant current mode. a voltage adjusting unit , coupled to the power conversion unit , and configured to detect and adjust the output voltage of the adapter , wherein the current sampling control unit is coupled to the voltage adjusting unit , and configured to adjust the peak value of the current with the first pulsating waveform by the voltage adjusting unit , and wherein further the voltage adjusting unit is configured to control the peak value of the output current of the adapter to not exceed the current corresponding to the constant current mode. <EOS>