We present a new kind of mobile ad hoc application, which we call mobile profile based distributed grouping (MPDG), which is a combination of mobile clustering and data clustering. In MPDG each mobile host is endowed with a user profile and while the users move around, hosts with similar profiles are to be found and a robust mobile group is formed. The members of a group are able to cooperate or attain a goal together. Here MPDG is defined and it is compared with related approaches. Furthermore, a modular architecture and algorithms are presented to build arbitrary MPDG applications.