We present a smoothing projected Barzilai-Borwein (SPBB) algorithm for solving a class of minimization problems on a closed convex set, where the objective function is nonsmooth nonconvex, perhaps even non-Lipschitz. At each iteration, the SPBB algorithm applies the projected gradient strategy that alternately uses the two Barzilai-Borwein stepsizes to the smooth approximation of the original problem. Nonmonotone scheme is adopted to ensure global convergence. Under mild conditions, we prove convergence of the SPBB algorithm to a scaled stationary point of the original problem. When the objective function is locally Lipschitz continuous, we consider a general constrained optimization problem and show that any accumulation point generated by the SPBB algorithm is a stationary point associated with the smoothing function used in the algorithm. Numerical experiments on 2 -p problems, image restoration problems, and stochastic linear complementarity problems show that the SPBB algorithm is promising.