资源简介
MainActivity.java
代码片段和文件信息
package com.car_shape_demo;
import java.util.ArrayList;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.net.DhcpInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.format.Formatter;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bkrcl.control_car_video.camerautil.CameraCommandUtil;
import com.coordinate_demo.Coordinates;
public class MainActivity extends Activity {
private ImageView show_viewdiap_view;
private TextView wifi_ipCamera_ipr_numg_numblue_num;
private EditText r_maxg_maxblue_max;
private EditText r_ming_minblue_min;
private TextView fruit_show;
private CheckBox CheckBox_rCheckBox_gCheckBox_b;
private String cameraIP;
private Bitmap bitmap = null;
private boolean flag = true;
private WifiManager wifiManager;
// 服务器管理器
private DhcpInfo dhcpInfo;
// 小车ip
private String IPCar;
private CameraCommandUtil cameraCommandUtil;
// 广播名称
public static final String A_S = “com.a_s“;
// 广播接收器
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context arg0 Intent arg1) {
cameraIP = arg1.getStringExtra(“IP“);
progressDialog.dismiss();
phThread.start();
phHandler.sendEmptyMessage(30);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Init();
wifi_Init();
}
private boolean wifi_flag = false;
private void wifi_Init()
{
wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if(wifiManager.isWifiEnabled())
{
wifi_flag = true;
// 得到服务器的IP地址
dhcpInfo = wifiManager.getDhcpInfo();
IPCar = Formatter.formatIpAddress(dhcpInfo.gateway);
phHandler.sendEmptyMessage(20);
// 注册广播
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(A_S);
registerReceiver(myBroadcastReceiver intentFilter);
cameraCommandUtil = new CameraCommandUtil();
search();
} else {
Toast.makeText(MainActivity.this “请开启WIFI并重启应用“ Toast.LENGTH_LONG).show();
}
}
private void Init()
{
show_view = (ImageView)findViewById(R.id.show_view);
diap_view = (ImageView)findViewById(R.id.diap_view);
show_view.setOnTouchListener(new ontouchlistener());
相关资源
- java_random_util_list.zip
- 魔乐李兴华零基础学Java系列视频教程
- 第一行代码JavaPDF.txt
- 《Java编程规范第三版》PDF.txt
- javaweb网上商城视频加源码.txt
- Java秒杀系统方案全套视频.zip
- JAVA例题.rar
- alex-word-filter-2.0.jar
- 张人杰双向词汇Java敏感词过滤3.0.ra
- Java设计模式-32讲地址.zip
- Java架构师.txt
- java.txt
- 郭java.txt
- 传智播客Javaweb视频课堂笔记源码全部
- LoadBox.java
- it十八掌大数据4个月全套课程永久有
- 李兴华全新JSP教程项目实战.txt
- ApacheJMeter_http.jar60720
-
javaxm
ltoHTML.zip - 基于Android的天气预报app的设计与实现
- Java深入微服务原理改造房产销售平台
- 144达内1805java培优班课程.txt
- JavaSSM开发大众点评网站视频.txt
- java项目视频20套最新地址.txt
- javaweb.txt
- Java并发编程高阶技术-高性能并发框架
- 毕向东Java教程全套包含35天.rar
- JavaEE就业webSSHSSMJava仿在线教育网站
- 优效学院--JAVA高级架构师(30.85G).
- Rxjava.txt
评论
共有 条评论