我是一名Android程序开发的初学者......但是我给了一个任务来开发Android手机中的示波器..我在调试程序时已经有了一些程序。 我已经为使用这些代码示波器..按钮开发Android示波器
run_buton = (ToggleButton) findViewById(R.id.tbtn_runtoggle);
run_buton.setOnClickListener(this);
rb1 = (RadioButton)findViewById(R.id.rbtn_ch1);
rb2 = (RadioButton)findViewById(R.id.rbtn_ch2);
和
public static final int rbtn_ch1 = 0;
public static final int rbtn_ch2 = 0;
public static final int txt_ch1pos = 0;
public static final int txt_ch2pos = 0;
public static final int button_connect = 0;
public static final int WaveformArea = 0;
public static int btn_position_down;
public static int tbtn_runtoggle;
public static int btn_position_up;
btn_pos_up = (Button) findViewById(R.id.btn_position_up);
btn_pos_down = (Button) findViewById(R.id.btn_position_down);
btn_pos_up.setOnClickListener(this);
btn_pos_down.setOnClickListener(this);
和我R.id.之后设置的所有东西是一个整数/场.. 这在R档如下图所示
然而Eclispe的告诉我,我有计划在最后三场......这是“btn_posiion_down”,“tbtn_runtoggle”和“btn_postion_up” .. 它显示错误,说“情况的表述应该是常数表达式” ......我不明白这是什么意思?该脚本的第一句话得到错误...
case R.id.btn_position_up :
if(rb1.isChecked() && (ch1_pos<38)){
ch1_pos += 1; ch1pos_label.setPadding(0, toScreenPos(ch1_pos), 0, 0);
sendMessage(new String(new byte[] {ADJ_POSITION, CHANNEL1, ch1_pos}));
}
else if(rb2.isChecked() && (ch2_pos<38)){
ch2_pos += 1; ch2pos_label.setPadding(0, toScreenPos(ch2_pos), 0, 0);
sendMessage(new String(new byte[] {ADJ_POSITION, CHANNEL2, ch2_pos}));
}
break;
五月人好心地告诉我会发生什么?
嗨,我正在开发一个用示波器录音的应用程序。我不知道如何获得示波器。请提供一些示例代码。谢谢。 – 2012-06-06 15:46:13