中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > 汽車(chē)電子 > 設(shè)計(jì)應(yīng)用 > 基于Android的公交車(chē)載中控控制系統(tǒng)的實(shí)現(xiàn)

        基于Android的公交車(chē)載中控控制系統(tǒng)的實(shí)現(xiàn)

        作者:張維文 馬杰 孫樹(shù)娟 王彬宇 李利娟 時(shí)間:2015-04-26 來(lái)源:電子產(chǎn)品世界 收藏

          實(shí)現(xiàn)主界面主要代碼及分析:

        本文引用地址:http://www.antipu.com.cn/article/273184.htm

          在res/layout目錄下創(chuàng)建一個(gè)布局文件.xml,使用LinearLayout線性布局,內(nèi)層使用TableView。下面是以地圖展示和手動(dòng)報(bào)站兩個(gè)功能按鈕為例的代碼:

               android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="#005aaa"
          android:gravity="center"
          android:padding="12dip"
          android:text="Location"
          android:textColor="#ffffff"
          android:textSize="18sp" />
               android:id="@+id/Main_Map"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:background="@drawable/btn_bg"
          android:text="地圖展示"
          android:textColor="@android:color/white"
          android:textSize="16sp" />
               android:id="@+id/Main_ReporStation"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:background="@drawable/btn_bg"
          android:text="手動(dòng)報(bào)站"
          android:textColor="@android:color/white"
          android:textSize="16sp" />

          在名為MainActivity的Activity中,建立一個(gè)onCreate()方法,設(shè)置Activity界面標(biāo)題和布局,實(shí)例化各個(gè)Button組件,并對(duì)各個(gè)Button設(shè)置OnClickListener進(jìn)行監(jiān)聽(tīng),當(dāng)點(diǎn)擊不同的Button按鈕時(shí),就會(huì)跳轉(zhuǎn)到不同的功能界面。下面是地圖展示功能實(shí)現(xiàn)工程的代碼:

          mapBtn.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
          String latStr = latitude.getText().toString();
          String lonStr = longitude.getText().toString();
          if (latStr == null || latStr.equals("") || lonStr == null || lonStr.equals("")) {
          Toast.makeText(MainActivity.this, "請(qǐng)先等定位完成后再展示地圖", Toast.LENGTH_LONG).show();
          return;
          }
          Intent intent = new Intent(MainActivity.this,GeoActivity.class);
          intent.putExtra("latitude", latStr);
          intent.putExtra("longitude", lonStr);
          startActivity(intent);
          }
          });

          3.3 網(wǎng)絡(luò)設(shè)置實(shí)現(xiàn)

          客戶端的數(shù)據(jù)存放在客戶端的SQLite數(shù)據(jù)庫(kù)中,服務(wù)器端要想獲得數(shù)據(jù)必須通過(guò)網(wǎng)絡(luò)的傳輸。網(wǎng)絡(luò)設(shè)置界面如圖5所示。

        linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)

        linux相關(guān)文章:linux教程




        關(guān)鍵詞: Android APP SDK GPS Wi-Fi

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉