Children’s Day is coming, more and more families begin to choose children’s watches as gifts for their children. Various data show that both overseas and domestic shipments of children’s watches continue to grow rapidly. In China, children’s watches almost become children’s closest partner, The Chinese market accounted for up to 95%, become the world’s most vibrant children’s watches market 1.

Throughout the development trend of children’s watches in the past three years, the TOP3 manufacturers mainly composed of small talents are concentrated in the middle and high-end value areas, while the market distribution of the middle and low-end is relatively stable, which brings more choices to children and parents. As a new entrant in the children’s watch market in recent years, Huawei has provided a series of intelligent care scenarios such as calling, positioning and security, which have been welcomed and praised by children and parents.

Through interviews with users in the market, it is found that children’s watches have become universal products in primary school. Children in lower grades like them more, while children in higher grades have higher requirements for functionality and style. Therefore, function, appearance and reputation are already the main factors for consumers to consider when buying children’s watches, while safety and communication are the core competencies most parents care about. As parents, they need to know their children’s current position at any time, so that children in indoor school activities, outdoor picnics, on the way to and from school and other occasions, to maximize the safety of children, so that parents dynamic, real-time understanding of their children’s movement track, and even timely communication and dialogue in an emergency. Therefore, improving the endurance and positioning accuracy is the core appeal to decide whether to recommend children’s watches.

As we know, the accuracy of positioning capability depends on a variety of signal factors such as base station, satellite and Wi-Fi, and the weather and surrounding environment are also reference factors that determine the success and accuracy of positioning. The positioning of children’s watches as a positioning scenario on the non-mobile phone side, most of which cannot achieve a variety of signal fusion positioning mode. But positioning accuracy is a critical concern for parents. So, how can we improve positioning accuracy on this watch? This is Petal Maps Platform, which helps watch manufacturers achieve seamless positioning in This country and even in the world.

Children’s watch integrated with network location services can effectively improve location experience, easy to develop, and reduce maintenance costs. At the same time, when the child is in the room, the watch can locate the floor and nearby POI, which can provide real-time feedback to parents to help find the child running in the mall, greatly reducing the risk of children lost in the room. In China, the success rate of integrated network positioning is as high as 99%, and in overseas, the success rate of network positioning is equal to other manufacturers.

So, as you can imagine, with Petal Maps Platform, this is an indoor, high-precision location that allows parents to see where their child is on a map and their activity history for the day, making sure that their child is not visiting anything dangerous. With the low-power geo-fencing feature of Petal Maps Platform, parents can check if their child arrives at school on time, know when they arrive at school, what they do and when they go home. When the app is dormant in the background, parents can still receive timely notifications.

Of course, in addition to the children’s watches introduced above, smartwatches and mobile phone applications can achieve high-precision positioning ability. There are numerous scenarios that integrate Location Kit to obtain high-precision positioning experience at home and abroad. Didi Chuxing achieves urban taxi hailing and Huawei Sports Health generates movement records with low power consumption.

With such a powerful children’s watch, smart watch escort, I believe that they can become children and parents on children’s day exciting gift choice

Currently, the Location Kit network positioning adopts the form of REST API and is not limited to the system environment. Location data can be obtained in Android, iOS, Web pages, Windows applications and other environments. The following is a brief introduction to the development of network positioning example tutorial.

The development of preparation

1. Create an application on huawei AppGallery Connect website

2. Copy the APPLICATION API Key

Development steps

1. Obtain device network information: At present, wi-fi information or cellular network information are supported for network positioning. This article adopts the method based on WLAN information.

public WifiInfo getWIFIInfo(Context context) {
      WifiManager wifiMgr = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
      return wifiMgr.getConnectionInfo();
}
Copy the code

2. Construct the network location request: refer to the API documentation to construct the request message body in JSON format.

public String getRequestBody(WifiInfo[] wifiInfos) {

try { JSONObject request = new JSONObject(); request.put("boottime", SystemClock.elapsedRealtime() * 1000); request.put("indoorMode", 0); JSONArray infos = new JSONArray(); for (int i = 0; i < wifiInfos.length; i++) { JSONObject wifiInfo = new JSONObject(); wifiInfo.put("mac", wifiInfos[i].getMacAddress()); wifiInfo.put("rssi", wifiInfos[i].getRssi()); wifiInfo.put("time", SystemClock.elapsedRealtime() * 1000); infos.put(wifiInfo); } request.put("wifiInfos", wifiInfos); return request.toString(); } catch (JSONException e) { e.printStackTrace(); return ""; }}Copy the code

3. Request network location

private String getNetworkLocation(String body, String apiKey) { HttpClient httpClient = new HttpClient.Builder().readTimeout(5000).connectTimeout(5000).build(); Request.Builder requestBuilder = httpClient.newRequest().url("https://locationapi.cloud.huawei.com/networklocation/v1/geoLocation").method("POST"); // Set Request Header requestBuilder. AddHeader ("Authorization", "Bearer "+ apiKey); requestBuilder.addHeader("Content-Type", "application/json"); requestBuilder.requestBody(new RequestBody() { @Override public String contentType() { return "application/json"; } @Override public void writeTo(OutputStream outputStream) throws IOException { outputStream.write(body.getBytes(Charset.defaultCharset())); outputStream.flush(); }}); try { Response<ResponseBody> response = httpClient.newSubmit(requestBuilder.build()).execute(); if (response.getCode() == 200) { InputStream is = response.getBody().getInputStream(); ByteArrayOutputStream message = new ByteArrayOutputStream(); int len = 0; byte[] buffer = new byte[1024]; while ((len = is.read(buffer)) ! = -1) { message.write(buffer, 0, len); } is.close(); message.close(); return new String(message.toByteArray(), Charset.defaultCharset()); } } catch (IOException e) { Log.e(TAG, e.getMessage(), e); } return null; }Copy the code

Development effect

After the compilation and installation, connect to Wi-Fi and start the application. The user’s location can be located only through the network. The result is as follows.

{" indoor ": 0," errorCode ":" 0 ", "position" : {" acc ": 14.400121," bearing ": 0.0," floorAcc ": 0," flags ": 17," says lon ": 113.86621570429958, "speed": 0.0, "mode": 0, "time": 0, "floor": 0, "indoorFlag": 0, "LAT ": 22.881333903191347}, "locateType": "Wifi", "extraInfo": {"resultCode": 0, "macDetails": [0, 1, 2], "extraPosition": {" ACC ": 23.040194, "bearing": 0.0, "flags": 17, "LON ": 113.86621570429958, "speed": 0.0, "mode": 0, "lat": 22.881333903191347, "errorMsg": "Success"}Copy the code

1. Data are from third-party reports

2. Data are obtained from huawei internal laboratory test results

The original link: developer.huawei.com/consumer/cn…

Original author: Pepper