connect android devices in ad-hoc mode without needing to net connection? can we get android devices in ad-hoc mode using WIFI-card but without access internet ?
i mean to connect peers to send and receive messages between them but without having internet connection ?

i see this  link  talk about wpa_supplicant.conf  to enable ad-hoc mode, but it seems that there are problems in this thing.

and see this command iwconfig but this doesn't support on android !!
Ad-hoc is not natively supported by Android. But starting with Android 4.0 (Ice Cream Sandwich), a new feature called WiFi Direct was introduced:


  Wi-Fi Direct, previously known as Wi-Fi P2P, is a standard that allows Wi-Fi devices to connect to each other without the need for a wireless access point. This allows Wi-Fi Direct devices to directly transfer data between each other with greatly reduced setup.


(Source: Wikipedia)


  Support for Wi-Fi Direct lets users connect directly to nearby peer devices over Wi-Fi, for more reliable, higher-speed communication. No internet connection or tethering is needed. Through third-party apps, users can connect to compatible devices to take advantage of new features such as instant sharing of files, photos, or other media; streaming video or audio from another device; or connecting to compatible printers or other devices.


(Source: Android.Com)

To me, this looks like what you are asking for: directly connecting two Android devices via WiFi without the need of a "mediator".