When the person complained of is brought before the justice of the peace or magistrate, the trial on the charge shall proceed as in other criminal cases.