showMessage('已断开:' + Board_IP);
}
}
}
public class DefaultListener implements OnClickListener {
public void onClick(View v) {
// TODO Auto-generated method stub
showMessage('请先连接ARM板!');
}
}
public class ManualRefresh implements OnClickListener {
public void onClick(View v) {
// TODO Auto-generated method stub
if (AutoRefresh_flag == 1)
AutoRefresh_flag = 0;
m_Handler.postDelayed(m_RefreshImage, 0);
showMessage('手动刷新成功!');
}
}
public class AutoRefresh implements OnClickListener {
public void onClick(View v) {
// TODO Auto-generated method stub
if (AutoRefresh_flag == 0)
AutoRefresh_flag = 1;
m_Handler.postDelayed(m_RefreshImage, 0);
showMessage('自动刷新设置成功!');
}
}
private Runnable m_RefreshImage = new Runnable() {
public void run() {
// TODO Auto-generated method stub
RefreshImage();
if (AutoRefresh_flag == 1)
m_Handler.postDelayed(m_RefreshImage, 100);
else
m_Handler.removeCallbacks(m_RefreshImage);
}
private void RefreshImage() {
// TODO Auto-generated method stub
try {
URL m_URL = new URL('http://' + Board_IP
+ ':8080/?action=snapshot');
URLConnection m_URL_Connection = m_URL.openConnection();
m_URL_Connection.connect();
InputStream m_InputStream = m_URL_Connection.getInputStream();
m_Bitmap = BitmapFactory.decodeStream(m_InputStream);
myImageView.setImageBitmap(m_Bitmap);
m_InputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
public class LED0Listener implements OnClickListener {
public void onClick(View arg0) {
// TODO Auto-generated method stub
LED_flag[0]++;
if (LED_flag[0] % 2 == 1) {
HttpSendCmd('58400F01');
showMessage('LED0已打开!');
} else {
HttpSendCmd('58400F00');
showMessage('LED0已关闭!');
}
}
}
public class LED1Listener implements OnClickListener {
public void onClick(View v) {
// TODO Auto-generated method stub
LED_flag[1]++;
if (LED_flag[1] % 2 == 1) {
HttpSendCmd('58401F01');
showMessage('LED1已打开!');
} else {
HttpSendCmd('58401F00');
showMessage('LED1已关闭!');
}
}
}
public class LED2Listener implements OnClickListener {
public void onClick(View v) {
// TODO Auto-generated method stub
LED_flag[2]++;
if (LED_flag[2] % 2 == 1) {
HttpSendCmd('58402F01');
showMessage('LED2已打开!');
上一篇:Android + Mini2440 无线网络视频监控系统 mjpg-streamer的移植
下一篇:mini2440上Apache php的socket通信
推荐阅读最新更新时间:2024-11-05 22:29
设计资源 培训 开发板 精华推荐
- AM6TW-4818SH35Z 18V 6瓦双输出DC-DC转换器的典型应用
- BPC292封装的SPC58 C,E,G和N线的微型插座模块
- 2023浙江理工大学校三等奖 2021年电赛电源题 三端口DC-DC电路copy
- 基于SLLIMM智能功率模块STGIPQ8C60T-HZ的600W电机控制电源板
- 使用 Microchip Technology 的 ATA8402-6AQY 的参考设计
- LT1171CT、5V/2.5A 高效 5V 降压转换器的典型应用
- 红外避障
- DC1921A,基于 LTC3375EUK 8 通道可编程并行同步降压稳压器的演示板
- AM1DR-1215SZ 15V 1 瓦 DC-DC 转换器的典型应用
- TWR-K20D50M,Kinetis K20 50 MHz 塔式系统模块