2015年6月11日 星期四

[Android] setOnClickListener

@Override
protected void onCreate(Bundle savedInstanceState) {  

  //type1
 ib_goback = (Button) findViewById(R.id.ib_goback);
 ib_goback.setOnClickListener(new OnClickListener() {
  @Override
  public void onClick(View v) {
   Intent intent = new Intent(Login.this, BeginAdvertisement.class);
   startActivity(intent);
   Login.this.finish();
  }  
 }); 
  
 //type2
 con = (Button) findViewById(R.id.btn_CON);
 Buttonclick btnclick = new Buttonclick();
 con.setOnClickListener(btnclick);
}

//type2
class Buttonclick implements Button.OnClickListener {

 @Override
 public void onClick(View v) {
  // TODO Auto-generated method stub

  switch (v.getId()) {
  case R.id.btn_CON:

   break;

  default:
   break;
  }
 }
}

2015年6月4日 星期四

[test] motion detection (192.168.18.143)

time lapse

set

get

recycle recording enable

recycle recording disable

==========================================

recycle recording 

set
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:5:0:

get
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:get:5

recycle recording enable
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:0:1

recycle recording disable
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:0:0

======
head count
set
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:2:581,52,581,288;167,149,508,149;136,305,381,305:

http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:4:2:581,52,581,288;167,149,508,149;136,305,381,305:

get
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:get:3
==========================================

motion 

set

motion enable
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:1

motion disable
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:0

--------------------------------------------------------------------

triger time
set
10 sec
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:1:5

15 sec
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:1:15

30 sec
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:1:30

get
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:get:1

-----------------------------------------------------------------------
all regions(need to restart)
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:0:20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95;20,95:

all regions(set directly)
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:4:0:3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90;3,90:60:000102030405060708091011143314151617181920212223:
當all regions與 multi regions相互切換,必須下停止與開啟指令,all regions才會生效
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:0
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:1

----------------------------------------------------------------------

multi regions
(VGA 640*360, 不論 liveview 解析度為何,送出的x, y座標階從(0,0)到(640,360))
A: http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:1:0,0,0,0,area1,20,95;0,0,320,180,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:

B: http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:1:0,0,0,0,area1,20,95;320,0,640,180,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:

C: http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:1:0,0,0,0,area1,20,95;0,180,320,360,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:

D: http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:3:1:0,0,0,0,area1,20,95;320,180,640,360,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:

當all regions與 multi regions相互切換,必須下停止與開啟指令,multi regions才會生效
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:0
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:set:0:1

---------------------
1 zone
0,0,320,180,area1,20,95;0,0,0,0,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:

2 zone
0,0,0,0,area1,20,95;320,0,640,180,area2,20,95;0,0,0,0,area3,20,95;0,0,0,0,area4,20,95;0,0,0,0,area5,20,95:
---------------------

liveview 

setting

http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:4:0:

http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:4:1:

http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=record:set:4:2:


getting
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=getsetting


rotation

-----------------------------
get

motion detection status(enable/disable)
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:get:0

multi regions status(all positions)
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=motion:get:3
======================
google drive
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=google-drive_auth
======================
getsetting
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=getsetting

snapshot
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=snapshot

thumbnailhttp://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=thumbnail

wifiscan
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=wifiscan

time zone synchronize
http://192.168.18.143/cgi-bin/cgi-cmd.cgi?command=settime:2015-05-15,16:11:12