资源简介

Android超声波通信例子,手机之间,手机与超声波设备间的超声波通信

资源截图

代码片段和文件信息

package generalplus.com.GPComAir5Demo;

import generalplus.com.GPComAir5Demo.R;
import generalplus.com.GPComAir5Lib.ComAir5Wrapper;
import generalplus.com.GPComAir5Lib.ComAir5Wrapper.DisplayCommandValueHelper;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.ScrollView;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.ToggleButton;

public class MainActivity extends Activity {

private ComAir5Wrapper m_ComAir5 = new ComAir5Wrapper();
private static String DBGTag = “GPComAir5MainActivity“;

private MediaPlayer mPlayer = null;
private TabHost mTabHost;
private ScrollView scrollView1;
private ProgressBar progressBar1;
private ToggleButton toggleButton_Decode_Record toggleButton_Encode_AutoTest toggleButton_Settings_SaveRawData;
private TextView textView_Decode_Command textView_Decode_HistoryCommand textView_Encode_Command;
private Button button_Encode_Minus button_Encode_Plus button_Encode_Send button_Settings_Set;
private EditText editText_Settings_CentralFreq editText_Settings_idf;
private boolean bTxMode = false;

int i32Cmd i32Count;
AutoRunTest autoRunTest;
DisplayCommandValueHelper displayHelper = new DisplayCommandValueHelper() {

@Override
public void getCommand(int count int cmdValue) {
i32Cmd = cmdValue;
i32Count = count;
runOnUiThread(new Runnable(){

@Override
public void run() {
// TODO Auto-generated method stub
PlayCmdSound(i32Cmd);
textView_Decode_Command.setText(String.valueOf(i32Cmd));
textView_Decode_HistoryCommand.setText(“[“ + i32Count + “] Command: “ + i32Cmd + “\n“ + textView_Decode_HistoryCommand.getText().toString());
scrollView1.fullScroll(View.FOCUS_UP);
}

});
}

};


@Override
public void onBackPressed() {
// TODO Auto-generated method stub
autoRunTest.bRun = false;
super.onBackPressed();
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_BEHIND);// Screenlock
m_ComAir5.SetDisplayCommandValueHelper(displayHelper);
mTabHost = (TabHost) findViewById(R.id.tabhost1);
mTabHost.setup();
TabHost.TabSpec spec1 = mTabHost.newTabSpec(“tab1“);
spec1.setContent(R.id.decodeLayout);
spec1.setIndicator(“Decode“ getResources().getDrawable(R.drawable.mic));
mTabHost.addTab(spec1);
TabHost.TabSpec spec2 = mTabHost.new

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        475  2013-08-02 15:25  ComAir5Demo_V1.0.3\.classpath

     文件       4169  2013-08-02 15:08  ComAir5Demo_V1.0.3\.cproject

     文件       1097  2013-08-02 15:01  ComAir5Demo_V1.0.3\.project

     文件       1209  2013-08-26 15:20  ComAir5Demo_V1.0.3\AndroidManifest.xml

     文件        942  2013-08-26 15:31  ComAir5Demo_V1.0.3\ComAir5Demo_ReleaseNote.txt

     文件     556198  2013-07-30 10:11  ComAir5Demo_V1.0.3\libs\android-support-v4.jar

     文件      46620  2013-08-16 09:18  ComAir5Demo_V1.0.3\libs\armeabi\libGPComAir5Lib.so

     文件        781  2013-07-30 10:11  ComAir5Demo_V1.0.3\proguard-project.txt

     文件        562  2013-08-02 15:25  ComAir5Demo_V1.0.3\project.properties

     文件       3503  2013-07-30 10:36  ComAir5Demo_V1.0.3\res\drawable-hdpi\ic_launcher.png

     文件       2648  2013-07-30 10:52  ComAir5Demo_V1.0.3\res\drawable-hdpi\mic.png

     文件       9376  2013-04-19 17:39  ComAir5Demo_V1.0.3\res\drawable-hdpi\settings.png

     文件       7712  2013-07-30 10:56  ComAir5Demo_V1.0.3\res\drawable-hdpi\sound.png

     文件       1528  2013-07-30 10:36  ComAir5Demo_V1.0.3\res\drawable-ldpi\ic_launcher.png

     文件        919  2013-07-30 10:53  ComAir5Demo_V1.0.3\res\drawable-ldpi\mic.png

     文件       3215  2013-04-19 17:39  ComAir5Demo_V1.0.3\res\drawable-ldpi\settings.png

     文件       2382  2013-07-30 10:56  ComAir5Demo_V1.0.3\res\drawable-ldpi\sound.png

     文件       2032  2013-07-30 10:36  ComAir5Demo_V1.0.3\res\drawable-mdpi\ic_launcher.png

     文件       2648  2013-07-30 10:52  ComAir5Demo_V1.0.3\res\drawable-mdpi\mic.png

     文件       4916  2013-04-19 17:39  ComAir5Demo_V1.0.3\res\drawable-mdpi\settings.png

     文件       3708  2013-07-30 10:56  ComAir5Demo_V1.0.3\res\drawable-mdpi\sound.png

     文件       4785  2013-07-30 10:35  ComAir5Demo_V1.0.3\res\drawable-xhdpi\ic_launcher.png

     文件       4239  2013-07-30 10:52  ComAir5Demo_V1.0.3\res\drawable-xhdpi\mic.png

     文件      14215  2013-04-19 17:39  ComAir5Demo_V1.0.3\res\drawable-xhdpi\settings.png

     文件      12299  2013-07-30 10:56  ComAir5Demo_V1.0.3\res\drawable-xhdpi\sound.png

     文件       7025  2013-07-30 09:08  ComAir5Demo_V1.0.3\res\drawable-xxhdpi\ic_launcher.png

     文件       9129  2013-07-30 10:54  ComAir5Demo_V1.0.3\res\drawable-xxhdpi\mic.png

     文件      14215  2013-04-19 17:39  ComAir5Demo_V1.0.3\res\drawable-xxhdpi\settings.png

     文件      26295  2013-07-30 10:55  ComAir5Demo_V1.0.3\res\drawable-xxhdpi\sound.png

     文件       1813  2013-07-30 11:52  ComAir5Demo_V1.0.3\res\layout\activity_main.xml

............此处省略115个文件信息

评论

共有 条评论