places365

Google Places API can be used to find nearby places. In this tutorial, we’ll be developing an application that displays the nearby places of our choice along with the approximate distance and time from our current location. We’ll be using the Google Places API Web Service with Distance Matrix API in the application.

Google Places API可用于查找附近的地方。 在本教程中,我们将开发一个应用程序,该应用程序显示我们选择的附近地点以及距当前位置的大概距离和时间。 我们将在应用程序中使用带有Distance Matrix API的Google Places API Web服务。

Google Places API (Google Places API)

Google Places API Web Service allows us to query places based upon a few parameters such as the type of place, whether a place is open right now etc.

Google Places API网络服务使我们能够根据一些参数来查询位置,例如位置类型,位置是否现在打开等。

A Nearby Search request is an HTTP URL of the following form:

附近搜索请求是以下格式的HTTP URL:

https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters

json is the recommended output, the other being xml

json是推荐的output ,另一个是xml

The Required parameters are:

必需参数为:

  1. key(API key)密钥 (API密钥)
  2. location位置
  3. rankby=distance or radius : If one is used the other can’t be used.rankby =距离半径 :如果使用了另一个,则不能使用。

Note: rankby=distance requires specifying either of the following parameters:

注意rankby=distance需要指定以下参数之一:

  1. name: values can be mcdonalds, kfc etc.名称 :值可以是mcdonalds,kfc等。
  2. type : values can be restaurant, cafe etc.类型 :值可以是餐厅,咖啡馆等。
  3. keyword关键词

The optional parameters can be opennow, pagetoken etc.

可选参数可以是opennowpagetoken等。

For more details refer this page.

有关更多详细信息,请参阅此页面。

Google Distance Matrix API (Google Distance Matrix API)

The Distance Matrix API is used to calculate the distance and time between two or more points.

Distance Matrix API用于计算两个或多个点之间的距离和时间。

A Distance Matrix API url is of the form:

Distance Matrix API网址的格式为:

https://maps.googleapis.com/maps/api/distancematrix/outputFormat?parameters

The required parameters are origins, destinations and the key.

必需的参数是originsdestinationskey

origins — This contains the starting point for calculating travel distance and time. We can pass more than one set of coordinates separated by pipelines(|).

origins —包含计算旅行距离和时间的起点。 我们可以传递由管道(|)分隔的一组以上的坐标。

We can also pass the addresses/place id instead of coordinates and the service automatically converts them into the latitude-longitude coordinates to calculate distance and duration.

我们还可以传递地址/地点ID而不是坐标,并且服务会自动将其转换为纬度-经度坐标以计算距离和持续时间。

Sample code:

样例代码:

https://maps.googleapis.com/maps/api/distancematrix/json?origins=Washington,DC&destinations=New+York+City,NY&key=YOUR_API_KEY

Optional parameters are:

可选参数为:

  1. mode : this expects a value among driving, bicycling, walking, transit模式 :期望在drivingbicyclingwalkingtransit取值
  2. avoid : Introduces restrictions to the route such as tolls, indoor etc避免 :对tollsindoor等限制路线

For more details visit this page.

有关更多详细信息,请访问此页面。

启用API密钥 (Enabling API keys)

Go to https://console.developers.google.com/ and enable the following APIs:

转到https://console.developers.google.com/并启用以下API:

  1. Google Maps Distance Matrix APIGoogle Maps Distance Matrix API
  2. Google Places API Web ServiceGoogle Places API网络服务
  3. Google Places API for Android适用于Android的Google Places API

Go to credentials and create a new Key. Set the key restriction to None for now.

转到凭据并创建一个新密钥。 现在将密钥限制设置为“无”。

Let’s jump onto the business end of this tutorial. We’ll be developing an application that allows us to search nearby places based on our current location and display the places in a RecyclerView.

让我们跳到本教程的业务端。 我们将开发一个应用程序,使我们可以根据当前位置搜索附近的地点并在RecyclerView中显示这些地点。

We’ll be searching places based on the type and name keywords that’ll be entered in the EditText and separated by a space. Example: restaurant dominos or cafe vegetarian

我们将根据将在EditText中输入并以空格分隔的类型和名称关键字来搜索地点。 例如: 多米诺骨牌餐厅素食咖啡馆

Google Places API示例项目结构 (Google Places API Example Project Structure)

The Project consists of a single Activity. An adapter class for the RecyclerView. A Model class that holds the data for each RecyclerView row. Two POJO classes for converting the JSON responses to Gson from the Google places API and Distance Matrix API. APIClient and ApiInterface for using Retrofit and the endpoints.

该项目由一个活动组成。 RecyclerView的适配器类。 一个Model类,其中包含每个RecyclerView行的数据。 两个POJO类,用于将JSON响应从Google place API和Distance Matrix API转换为Gson 。 APIClient和ApiInterface用于使用Retrofit和端点。

Google Places API示例代码 (Google Places API Example Code)

Add the following dependencies inside the build.gradle file

build.gradle文件中添加以下依赖build.gradle

compile 'com.google.android.gms:play-services-location:10.2.1'compile 'com.google.android.gms:play-services-places:10.2.1'compile 'com.google.code.gson:gson:2.7'compile 'com.squareup.retrofit2:retrofit:2.1.0'compile 'com.squareup.retrofit2:converter-gson:2.1.0'compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'compile 'com.squareup.okhttp3:okhttps:3.4.1'compile 'io.nlopez.smartlocation:library:3.3.1'compile 'com.android.support:cardview-v7:25.3.0'compile 'com.android.support:recyclerview-v7:25.3.0'

compile 'io.nlopez.smartlocation:library:3.3.1' is a LocationTracking third party library that reduces the boilerplate code.

compile 'io.nlopez.smartlocation:library:3.3.1'是一个LocationTracking第三方库 ,可减少样板代码。

The APIClient.java code is given below:

APIClient.java代码如下:

package com.journaldev.nearbyplaces;import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;public class APIClient {private static Retrofit retrofit = null;public static final String GOOGLE_PLACE_API_KEY = "ADD_YOUR_API_KEY_HERE";public static String base_url = "https://maps.googleapis.com/maps/api/";public static Retrofit getClient() {HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);OkHttpClient client = new OkHttpClient.Builder().readTimeout(30, TimeUnit.SECONDS).writeTimeout(30, TimeUnit.SECONDS).addInterceptor(interceptor).build();retrofit = null;retrofit = new Retrofit.Builder().baseUrl(base_url).addConverterFactory(GsonConverterFactory.create()).client(client).build();return retrofit;}}

The ApiInterface.java code is given below

ApiInterface.java代码如下

package com.journaldev.nearbyplaces;import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;public interface ApiInterface {@GET("place/nearbysearch/json?")Call<PlacesPOJO.Root> doPlaces(@Query(value = "type", encoded = true) String type, @Query(value = "location", encoded = true) String location, @Query(value = "name", encoded = true) String name, @Query(value = "opennow", encoded = true) boolean opennow, @Query(value = "rankby", encoded = true) String rankby, @Query(value = "key", encoded = true) String key);@GET("distancematrix/json") // origins/destinations:  LatLng as stringCall<ResultDistanceMatrix> getDistance(@Query("key") String key, @Query("origins") String origins, @Query("destinations") String destinations);
}

PlacesPOJO.java is the file which holds the response from Places API. Its code is given below

PlacesPOJO.java是保存Places API响应的文件。 其代码如下

package com.journaldev.nearbyplaces;import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;public class PlacesPOJO {public class Root implements Serializable {@SerializedName("results")public List<CustomA> customA = new ArrayList<>();@SerializedName("status")public String status;}public class CustomA implements Serializable {@SerializedName("geometry")public Geometry geometry;@SerializedName("vicinity")public String vicinity;@SerializedName("name")public String name;}public class Geometry implements Serializable{@SerializedName("location")public LocationA locationA;}public class LocationA implements Serializable {@SerializedName("lat")public String lat;@SerializedName("lng")public String lng;}}

ResultDistanceMatrix.java class holds the response from Distance Matrix API. It’s code is given below:

ResultDistanceMatrix.java类保存来自Distance Matrix API的响应。 它的代码如下:

package com.journaldev.nearbyplaces;import com.google.gson.annotations.SerializedName;import java.util.List;public class ResultDistanceMatrix {@SerializedName("status")public String status;@SerializedName("rows")public List<InfoDistanceMatrix> rows;public class InfoDistanceMatrix {@SerializedName("elements")public List elements;public class DistanceElement {@SerializedName("status")public String status;@SerializedName("duration")public ValueItem duration;@SerializedName("distance")public ValueItem distance;}public class ValueItem {@SerializedName("value")public long value;@SerializedName("text")public String text;}}
}

The activity_main.xml file is given below

下面是activity_main.xml文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android"xmlns:tools="https://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:background="#212121"tools:context="com.journaldev.nearbyplaces.MainActivity"><EditTextandroid:id="@+id/editText"android:layout_width="match_parent"android:textColor="@android:color/white"android:textColorHint="@android:color/white"android:text="restaurant mcdonalds"android:hint="type name"android:layout_height="wrap_content"android:layout_alignParentTop="true"android:layout_toLeftOf="@+id/button"android:layout_toStartOf="@+id/button" /><Buttonandroid:id="@+id/button"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentEnd="true"android:layout_alignParentRight="true"android:text="Search" /><android.support.v7.widget.RecyclerViewandroid:id="@+id/recyclerView"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_below="@+id/editText"android:scrollbars="vertical" /></RelativeLayout>

The MainActivity.java class code is given below.

MainActivity.java类代码如下。

package com.journaldev.nearbyplaces;import android.annotation.TargetApi;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.maps.model.LatLng;
import java.util.ArrayList;
import java.util.List;import io.nlopez.smartlocation.OnLocationUpdatedListener;
import io.nlopez.smartlocation.SmartLocation;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;public class MainActivity extends AppCompatActivity {private ArrayList<String> permissionsToRequest;private ArrayList<String> permissionsRejected = new ArrayList<>();private ArrayList<String> permissions = new ArrayList<>();private final static int ALL_PERMISSIONS_RESULT = 101;List<StoreModel> storeModels;ApiInterface apiService;String latLngString;LatLng latLng;RecyclerView recyclerView;EditText editText;Button button;List<PlacesPOJO.CustomA> results;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);permissions.add(ACCESS_FINE_LOCATION);permissions.add(ACCESS_COARSE_LOCATION);permissionsToRequest = findUnAskedPermissions(permissions);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {if (permissionsToRequest.size() > 0)requestPermissions(permissionsToRequest.toArray(new String[permissionsToRequest.size()]), ALL_PERMISSIONS_RESULT);else {fetchLocation();}} else {fetchLocation();}apiService = APIClient.getClient().create(ApiInterface.class);recyclerView = (RecyclerView) findViewById(R.id.recyclerView);recyclerView.setNestedScrollingEnabled(false);recyclerView.setHasFixedSize(true);LinearLayoutManager layoutManager = new LinearLayoutManager(this);recyclerView.setLayoutManager(layoutManager);editText = (EditText) findViewById(R.id.editText);button = (Button) findViewById(R.id.button);button.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {String s = editText.getText().toString().trim();String[] split = s.split("\\s+");if (split.length != 2) {Toast.makeText(getApplicationContext(), "Please enter text in the required format", Toast.LENGTH_SHORT).show();} elsefetchStores(split[0], split[1]);}});}private void fetchStores(String placeType, String businessName) {/*** For Locations In India McDonalds stores aren't returned accurately*///Call<PlacesPOJO.Root> call = apiService.doPlaces(placeType, latLngString,"\""+ businessName +"\"", true, "distance", APIClient.GOOGLE_PLACE_API_KEY);Call<PlacesPOJO.Root> call = apiService.doPlaces(placeType, latLngString, businessName, true, "distance", APIClient.GOOGLE_PLACE_API_KEY);call.enqueue(new Callback<PlacesPOJO.Root>() {@Overridepublic void onResponse(Call<PlacesPOJO.Root> call, Response<PlacesPOJO.Root> response) {PlacesPOJO.Root root = response.body();if (response.isSuccessful()) {if (root.status.equals("OK")) {results = root.customA;storeModels = new ArrayList<>();for (int i = 0; i < results.size(); i++) {if (i == 10)break;PlacesPOJO.CustomA info = results.get(i);fetchDistance(info);}} else {Toast.makeText(getApplicationContext(), "No matches found near you", Toast.LENGTH_SHORT).show();}} else if (response.code() != 200) {Toast.makeText(getApplicationContext(), "Error " + response.code() + " found.", Toast.LENGTH_SHORT).show();}}@Overridepublic void onFailure(Call<PlacesPOJO.Root> call, Throwable t) {// Log error here since request failedcall.cancel();}});}private ArrayList<String> findUnAskedPermissions(ArrayList<String> wanted) {ArrayList<String> result = new ArrayList<>();for (String perm : wanted) {if (!hasPermission(perm)) {result.add(perm);}}return result;}private boolean hasPermission(String permission) {if (canMakeSmores()) {if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {return (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED);}}return true;}private boolean canMakeSmores() {return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1);}@TargetApi(Build.VERSION_CODES.M)@Overridepublic void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {switch (requestCode) {case ALL_PERMISSIONS_RESULT:for (String perms : permissionsToRequest) {if (!hasPermission(perms)) {permissionsRejected.add(perms);}}if (permissionsRejected.size() > 0) {if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {if (shouldShowRequestPermissionRationale(permissionsRejected.get(0))) {showMessageOKCancel("These permissions are mandatory for the application. Please allow access.",new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {requestPermissions(permissionsRejected.toArray(new String[permissionsRejected.size()]), ALL_PERMISSIONS_RESULT);}}});return;}}} else {fetchLocation();}break;}}private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener) {new AlertDialog.Builder(MainActivity.this).setMessage(message).setPositiveButton("OK", okListener).setNegativeButton("Cancel", null).create().show();}private void fetchLocation() {SmartLocation.with(this).location().oneFix().start(new OnLocationUpdatedListener() {@Overridepublic void onLocationUpdated(Location location) {latLngString = location.getLatitude() + "," + location.getLongitude();latLng = new LatLng(location.getLatitude(), location.getLongitude());}});}private void fetchDistance(final PlacesPOJO.CustomA info) {Call<ResultDistanceMatrix> call = apiService.getDistance(APIClient.GOOGLE_PLACE_API_KEY, latLngString, info.geometry.locationA.lat + "," + info.geometry.locationA.lng);call.enqueue(new Callback<ResultDistanceMatrix>() {@Overridepublic void onResponse(Call<ResultDistanceMatrix> call, Response<ResultDistanceMatrix> response) {ResultDistanceMatrix resultDistance = response.body();if ("OK".equalsIgnoreCase(resultDistance.status)) {ResultDistanceMatrix.InfoDistanceMatrix infoDistanceMatrix = resultDistance.rows.get(0);ResultDistanceMatrix.InfoDistanceMatrix.DistanceElement distanceElement = infoDistanceMatrix.elements.get(0);if ("OK".equalsIgnoreCase(distanceElement.status)) {ResultDistanceMatrix.InfoDistanceMatrix.ValueItem itemDuration = distanceElement.duration;ResultDistanceMatrix.InfoDistanceMatrix.ValueItem itemDistance = distanceElement.distance;String totalDistance = String.valueOf(itemDistance.text);String totalDuration = String.valueOf(itemDuration.text);storeModels.add(new StoreModel(info.name, info.vicinity, totalDistance, totalDuration));if (storeModels.size() == 10 || storeModels.size() == results.size()) {RecyclerViewAdapter adapterStores = new RecyclerViewAdapter(results, storeModels);recyclerView.setAdapter(adapterStores);}}}}@Overridepublic void onFailure(Call<ResultDistanceMatrix> call, Throwable t) {call.cancel();}});}
}

In the above code, we start by asking for runtime permissions followed by fetching the current location using the SmartLocation Library.

在上面的代码中,我们首先要求运行时权限,然后使用SmartLocation库获取当前位置。

Once we have that in place, we pass the first word from the EditText in the type and the second word in the name parameter of the fetchStores() method that eventually calls the Google Places API web service. We limit the search results to 10.

设置好之后,我们将传递类型来自EditText的第一个单词,并传递fetchStores()方法的name参数的第二个单词,该方法最终调用Google Places API Web服务。 我们将搜索结果限制为10。

For each result, we calculate the distance and time from the store inside the method fetchDistance(). Once it’s done for all the stores, we populate the data inside the RecyclerViewAdapter.java class using a StoreModel.java data class.

对于每个结果,我们计算方法fetchDistance()内距商店的距离和时间。 对所有商店完成后,我们将使用StoreModel.java数据类在RecyclerViewAdapter.java类中StoreModel.java数据。

StoreModel.java code is given below:

StoreModel.java代码如下:

package com.journaldev.nearbyplaces;public class StoreModel {public String name, address, distance, duration;public StoreModel(String name, String address, String distance, String duration) {this.name = name;this.address = address;this.distance = distance;this.duration = duration;}}

The layout for each row of the RecyclerView is given in the xml below:
store_list_row.xml

下面的xml中给出了RecyclerView每行的布局:
store_list_row.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="https://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginBottom="@dimen/activity_horizontal_margin"android:orientation="vertical"><android.support.v7.widget.CardView xmlns:card_view="https://schemas.android.com/apk/res-auto"android:id="@+id/card_view"android:layout_width="match_parent"android:layout_height="wrap_content"card_view:cardCornerRadius="0dp"card_view:cardElevation="5dp"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"android:padding="5dp"><TextViewandroid:id="@+id/txtStoreName"android:layout_width="wrap_content"android:layout_height="wrap_content"android:paddingBottom="5dp"android:textColor="#212121" /><TextViewandroid:id="@+id/txtStoreAddr"android:layout_width="wrap_content"android:layout_height="wrap_content"android:paddingBottom="5dp"android:textColor="#212121" /><TextViewandroid:id="@+id/txtStoreDist"android:layout_width="wrap_content"android:layout_height="wrap_content"android:paddingBottom="5dp" /></LinearLayout></android.support.v7.widget.CardView></LinearLayout>

The RecyclerViewAdapter.java code is given below.

下面给出了RecyclerViewAdapter.java代码。

public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.MyViewHolder> {private List<PlacesPOJO.CustomA> stLstStores;private List<StoreModel> models;public RecyclerViewAdapter(List<PlacesPOJO.CustomA> stores, List<StoreModel> storeModels) {stLstStores = stores;models = storeModels;}@Overridepublic MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.store_list_row, parent, false);return new MyViewHolder(view);}@Overridepublic void onBindViewHolder(MyViewHolder holder, int position) {holder.setData(stLstStores.get(holder.getAdapterPosition()), holder, models.get(holder.getAdapterPosition()));}@Overridepublic int getItemCount() {return Math.min(5, stLstStores.size());}public class MyViewHolder extends RecyclerView.ViewHolder {TextView txtStoreName;TextView txtStoreAddr;TextView txtStoreDist;StoreModel model;public MyViewHolder(View itemView) {super(itemView);this.txtStoreDist = (TextView) itemView.findViewById(R.id.txtStoreDist);this.txtStoreName = (TextView) itemView.findViewById(R.id.txtStoreName);this.txtStoreAddr = (TextView) itemView.findViewById(R.id.txtStoreAddr);}public void setData(PlacesPOJO.CustomA info, MyViewHolder holder, StoreModel storeModel) {this.model = storeModel;holder.txtStoreDist.setText(model.distance + "\n" + model.duration);holder.txtStoreName.setText(info.name);holder.txtStoreAddr.setText(info.vicinity);}}
}

The output of the google places api example application in action is given below:

行动中的Google Places api示例应用程序的输出如下:

Note: Places API isn’t accurate for McDonalds and some food chains, especially for locations in India.

注意:Places API对于麦当劳和某些食品连锁店不正确,尤其是在印度。

One workaround is to pass the value in the parameter name inside double quotes such as:

一种解决方法是在参数name双引号内传递值,例如:

Call call = apiService.doPlaces(placeType, latLngString,"\""+ businessName +"\"", true, "distance", APIClient.GOOGLE_PLACE_API_KEY);

The output comes up like this for my location is given below:

对于我的位置,输出如下所示:

This brings an end to this tutorial. You can download the final google places api example project from the link below.

本教程到此结束。 您可以从下面的链接下载最终的Google Places api示例项目。

Download Google Places API Example Project下载Google Places API示例项目

翻译自: https://www.journaldev.com/13911/google-places-api

places365

places365_Google Places API网络服务示例相关推荐

  1. Android Google Maps API 网络服务用于网络定位、计算路线、获取经纬度、获取详细地址等

    Google Maps API 网络服务 官网地址 : https://developers.google.com/maps/documentation/webservices/?hl=zh-cn 其 ...

  2. as 不显示gradle视图_Python构建RESTful网络服务[Django篇:基于类视图的API]

    系列文章介绍 本系列文章将详细介绍将Django官方引导教程中的投票项目改写为RESTful网络服务.Django官方教程地址https://docs.djangoproject.com/zh-han ...

  3. wordpress rest api 登录_Python构建RESTful网络服务[Django篇:生成API文档]

    链接:https://pan.baidu.com/s/15Mo9adr4Iw2W-um7WK68jA 提取码:ux79 系列文章介绍 本系列文章将详细介绍将Django官方引导教程中的投票项目改写为R ...

  4. 网络服务及配置示例三合一

    网络服务及配置示例三合一 一. OSI简介 OSI简介 OSI:7层次结构/功能 1. 应用层 所有能和用户交互产生网络流量的程序(QQ,邮箱). 典型的应用层服务: 文件传输(FTP) 电子邮件(S ...

  5. 虚拟机重启服务器失败的原因,虚拟机重启网络服务失败,当查看状态显示错误Failed to start LSB.........

    重启网络失败截图 从本质上来看出现这样的问题,是因为拷贝过来的虚拟机重新分配了网卡MAC地址.这样造成的结果是配置文件中MAC与当前网卡MAC不一致.所以只需要修改一下配置文件即可. 用ip addr ...

  6. android自带的nsd发现服务器,Android NSD(网络服务发现)是否与iOS中的Bonjour服务兼容?...

    I will create a server-less local networking App for iOS and Android. the App in both iOS and Androi ...

  7. Muduo 网络编程示例之十:socks4a 代理服务器

    Muduo 网络编程示例之十:socks4a 代理服务器 陈硕 (giantchen_AT_gmail) Blog.csdn.net/Solstice  t.sina.com.cn/giantchen ...

  8. Muduo 网络编程示例之零:前言

    陈硕 (giantchen_AT_gmail) Blog.csdn.net/Solstice Muduo 全系列文章列表: http://blog.csdn.net/Solstice/category ...

  9. 尚硅谷 Linux网络服务数据库 笔记

    目录 网络基础服务 CentOS6与CentOS7区别 常见的网络协议与端口 网关和路由 网络管理命令 SSH管理 TCP Wrappers 简单防火墙 DHCP服务 DHCP的工作原理 DHCP服务 ...

最新文章

  1. Project Tungsten:让Spark将硬件性能压榨到极限
  2. 常见算法:C语言求最小公倍数和最大公约数三种算法
  3. Spring中ApplicationContext加载机制和配置初始化
  4. JMetro 5.2版发布
  5. [java] 找出字符串中出现最多的字符和出现的次数
  6. RabbitMq 发布订阅 Publish/Subscribe fanout/direct
  7. 关于SqlServer导入access数据库,十进制字段的精度过小的问题
  8. [数据预处理] onehot编码:是什么,为什么,怎么样
  9. HDU-4035 Maze 概率DP
  10. Java 在PDF中添加水印——文本/图片水印
  11. Java实现qq邮件发送-支持群发
  12. PS实现割掉狗熊耳朵流血效果
  13. 图论——广度优先搜索
  14. php股票波动率计算公式,因子选股系列:波动率因子的改进,异质波动率
  15. 想学软件开发怎么入手
  16. stm32cubeide驱动LCD1602显示屏
  17. 老子《道德经》第六十五章
  18. 2021年ACM竞赛班训练(十一)2021.5.20-问题 E: 调皮的摩尔-题解
  19. C/C++初始化和去初始化函数
  20. 知乎cookies的介绍_知乎更新隐私政策:不点同意可选“仅浏览”,相关数据一月内删除...

热门文章

  1. 使用struts2中默认的拦截器以及自定义拦截器
  2. webservice wsdl 生成服务
  3. sprintf 函数
  4. win7安装证书时无响应的解决办法
  5. [转载] python set集合如何有序输出_python set集合的用法
  6. [转载] pandas dataframe 提取行和列
  7. ffmpeg下载rtmp flv
  8. codeblocks(其它软件)修改后缀文件的打开默认方式
  9. 一个优质的Vue组件库应该遵循什么样的设计原则
  10. python进程问题