Device can track GPS information and store on local memory. when SOS signal available it has to transfer the GPS information to relatives mobile number via SMS. Mean while it has to transfer the GPS information to server. if GPS is not available it has to send near available WIFI address. please find the block diagram and design circuit. the circuit should be small and cost effective.
The sending of nearby wifi address is not possible as the device needs to connect to the wifi using a password. As your stated requirement the device would be something that would be in motion. So accessing routers would be a no go. Rest the project is an easy implementation. With uploading coordinates to a server and forwarding sms to the desired mobile numbers in case of sos. In case of non availability of gps service the location can be traced by authorities using sim tracking accurately, which fulfills the need.