本文主要是介绍android EasyLink给wifi模块配网,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
相关文章 博客 http://blog.csdn.net/u010924834/article/details/49491349
本文使用的是庆科wifi模块
http://developer.mico.io/downloads 庆科的开发者地址 有配网的sdk demo下载
下载下来的demo 有可能gradle不过 可以找他们工程师 android studio项目 ,看别人项目 细心 耐心 下面是主要配网代码
package com.example.administrator.easylinkdemo;import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast;import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;import java.util.List;import io.fogcloud.easylink.api.EasyLink; import io.fogcloud.easylink.helper.EasyLinkCallBack; import io.fogcloud.easylink.helper.EasyLinkParams; import io.fog.fog2sdk.MiCODevice; import io.fogcloud.fog_mdns.helper.SearchDeviceCallBack;public class MainActivity extends AppCompatActivity implements View.OnClickListener {private static final String TAG = "MainActivity";private EasyLink elink;private MiCODevice mMiCODevice;private EditText ex_password;private Spinner mSpinner;private List<String> mList;private ArrayAdapter<String> mAdapter;private WifiUtils mWifiUtils;private String ssId;private LayoutInflater mLayoutInflater;private LinearLayout lin_showmdns;@Override protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);lin_showmdns = (LinearLayout) findViewById(R.id.showmdns);mLayoutInflater = LayoutInflater.from(this);mWifiUtils = new WifiUtils(this);elink = new EasyLink(this);mMiCODevice = new MiCODevice(this);Button btn_start = (Button) findViewById(R.id.start);Button
这篇关于android EasyLink给wifi模块配网的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!