Preface
We are still worried that Parse does not support complex SQL queries. For example, we can find people nearby, today, I carefully read the article "Parse-based cloud services for Android Applications". unexpectedly, I directly provided an API, which is dedicated to the mobile background!
You are welcome to repost, but please keep the original source of the article :)
Blog: http://www.cnblogs.com
Farmer's uncle: http://over140.cnblogs.com
Body
I. Series
1. [Parse] development notes (1) -- Preparation
2. [Parse] development notes (2) -- import Data from Mysql to Parse Data
II. Introduction
To find people nearby, follow these steps: locate the device to obtain the geographical location information, upload the data to the server, and obtain the data by comparing and sorting the data.
Iii. Mysql version
Typical SQL statements include:
ORDER
(PS ~~~, If the data volume is large and multiple tables are associated, this statement takes a break from cainiao ~~~)
Iv. Parse version
List <ParseObject> queryAroundUsers (Context ctx, POUser user, minute, startIndex, pageSize) ParseException {
ParseQuery query = ParseQuery ("nmbb_user ");
ParseGeoPoint point = ParseGeoPoint ();
Point. setLatitude (user. locationLatitude );
Point. setlongpolling (user. locationlongpolling );
Query. whereWithinKilometers ("location", point, 5); query. setSkip (startIndex );
Query. setLimit (pageSize );
Query. find ();
}
1. ParseQuery provides a very considerate method:
2. Two related methods:
3. The ParseGeoPoint object can be stored. If the data type is GeoPoint, add this field to save it.