An emerging research area in pervasive computing is the inference of social context in order to facilitate and mediate communications among collocated people. Understanding users' needs through information reasoning and leveraging principles of social networks plays an important role in the emergence of innovative computer-mediated social networks. This thesis introduces a generic social networking framework for the design, analysis and visualization of opportunistic social networks. The proposed framework is capable of analyzing social similarities in order to provide decision support to users in the form of ego-centric social graphs. Using opportunistic data networks, a distributed inference model is introduced to provide multi-criteria attribute matching in an ad hoc computing environment. Enhancing communications protocols to deal with real-time analysis of dynamic data, generation of spontaneous semantics, and introducing efficient social visualization techniques are salient goals of this research. Efficient pattern matching algorithms in mobile ad hoc networks can have significant benefits in generating real-time context and eliminate the need for a centralized arbiter. In our research, we demonstrate a generic and customizable software architecture for achieving efficient pattern matching in mobile ad hoc networks. In this research we present a novel design for the development of a generic matching engine that is customizable to changing social scenarios. We show how customizable semantics can play an important role in decision-making, selection of a desired attribute, and notifying users with messages in a volatile mobile network.