
Almost any service can be made geosocial. Those. expand its functionality beyond the usual Internet and give users of the service opportunities for interaction in real life.
')
The first question that arises is whether users need it? The answer very much depends on what kind of service. For example, dating services are very popular because they solve many problems. They allow those who want to meet, save time searching for a partner. They help to overcome modesty and avoid many conflict situations.
Well, if you think that the geosocial service of Habrahabr can offer interesting things?
Privacy options:
1) Visible to everyone - for those who want maximum communication
2) Visible only to those members of the social community who are subscribed to several common hubs with me - a moderate option
3) It is visible only to those to whom I am subscribed and, at the same time, whoever is subscribed to me - the minimum of contacts with the maximum mutual interest.
I think that with such a scheme almost everyone will find a suitable option. By the way, I am against the pakaz of users on the map, as some services do. It is much more interesting when users are simply informed about their random encounters. And in order to achieve real efficiency, the location should be carried out not on-demand (on the basis of the chekin), but on-line.
Technical implementation
To make the service geosocial, you need to develop client applications for mobile devices and implement a geolocation service on the server side.

Functions of Geolocation Service:
1) Validation of data coming from devices
2) Search for meetings (device convergence)
3) Analysis of the privacy settings of the users encountered
4) Informing the service and interested users about the meeting.
5) Additional functions required for user interaction, for example, a chat module, etc.
Mobile client application features
1) Geolocation
2) Transfer current coordinates to server
3) User notification of meetings and other events.
4) Additional functions required for user interaction, such as chat rooms, etc.
Nuances
You need to understand that the implementation of a full-fledged client application is quite a labor-intensive thing. And if we talk about the implementation of client applications for different platforms, the costs increase even more. You can simplify the task, using, for example, HTML 5 for the layout of the user interface of applications, but the location module will have to be done by native means.
Location must be energy efficient. The easiest way to solve this issue on Android. You can adjust power consumption by writing a smart location algorithm. Those. in certain cases, to obtain an accurate, but expensive in terms of energy, GPS-coordinate. If there is WiFi in sight, then, of course, use it for location (an error of 50-100 meters, almost without energy costs). Sometimes used to determine cell coordinates. We obtain a sufficiently large (but in some cases acceptable) error, but without energy consumption.
It is also necessary to take into account that the phone that performs the location is not sleeping at this time. And its processor also consumes power. If we wake up to get a location, then we can not always do it as quickly as we want. The GPS module, which received information about satellites, gives us coordinates very quickly, but it may take several minutes to initialize it.
Another problem - the native location services of the device can sometimes give large errors. Those. not a coordinate with a large error, but simply an incorrect coordinate, which can easily turn out to be a kilometer from the real one. It would be useful on the server side to keep records of such “black holes” to increase the reliability of the tracks.
Large energy savings can be achieved, including different location modes for the following cases:
- the device is motionless
- the device is moving at low speed
- device moves fast
In this case, there are two main ideas. When the device is stationary, it does not generate any events. When the device moves quickly (the person in the car) there are a lot of events, but the user will not be able to react to them anyway.
Also, it would be nice to synchronize the sending of coordinates by devices. Those. need client time to synchronize with server time. This is important for moving objects. Example - two people ride the tram on the adjacent seats, but sending their coordinates is out of sync. Then the server will receive intermittent biases of one or the other device and will not fix the meeting ...
It is also wrong to send one time for all devices. Thus, we will create peak loads on the server. Those. You need to consider an algorithm that will link the time of sending coordinates to the current coordinates.
And yet, if we use not only GPS to get coordinates, then looking at the track of the device, we will be unhappy. The movement will look like some kind of jumps, then forward, then back, then right, then left. It’s nice to think about how to process the coordinates coming from the device, given that the error is constantly changing? If anyone is interested, I can describe the algorithm in one of the following articles.
Cases with location on iOS are worse. We only have the opportunity to request a coordinate with a certain accuracy and it is not possible to control by what means (in what time and with what energy consumption) it will be obtained. In addition, there is no simple way to take the phone out of sleep mode. And if you do not go into this mode, the processor consumes a lot of energy (much more than on modern Android). There are certain opportunities for solving problems of energy-efficient location, but the implementation is rather complicated. The only simple option, which in many cases will be sufficient, is to use Geofences.
Symbian. Full location is possible only on devices with an operating system of at least S60. In addition, the device must have WiFi and GPS (there are very few such models), otherwise the location error will be simply huge. There will be problems with the application autostart. The development effort for a Symbian application is several times higher, for example, iOS.
Windows Phone. The 7th version of this system, apparently, turned out to be quite heavy for mobile devices, and the possibilities for full-fledged background location were not realized there. In the 8th version a big step forward was made. There was an extensive geolocation API, which is a cross between Android and iOS. However, do not forget the formula:
“New operating system” + “devices from different manufacturers” = “inevitable bugs”.
And this may not be the best impact on the complexity of the development.
And, of course,
you need to develop a client for Google Glass. I can’t say anything here because I didn’t hold it in my hands. And in general, I think, is this a joke?
Notification
In certain cases, you will need to inform users about meetings and other events. For each platform, you will need to do a separate native implementation. However, in our case, there is a unique opportunity to organize a notification not through the services of vendors, but through our own feedback.
If the device connects to our server via TCP, then we can contact it during the session at any time. Even if the device sends us UDP packets (which is reasonable, if we think about the load), then we have some time to send a response packet. This time depends on the ISP, but, in any case, is at least 10 seconds.
Aggregators
You can save manpower and resources and use the services of aggregators that provide an API for integrating third-party services and independently resolve issues with the location of mobile devices. They provide ready-made template native applications for different platforms with already implemented functionality for users to communicate, display them on the map (if necessary) and much more, and also provide the ability to integrate functionality specific to each service via web-view.

PS This article describes only general ideas and principles of the technical implementation of geosocial services. With reference to Habrahabr, of course, you can come up with many more interesting and useful features. I wanted to know your opinion, dear habravchane.