Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

三星I9500 S4狀態欄顯示網速修改教學

編輯:更多教學

想讓S4的狀態欄即時顯示網路速度嗎?透過修改源碼,可以實現「開啟數據或Wi-Fi時顯示網速,關閉時自動隱藏圖示」的效果。

操作步驟如下:

1. 打開 system/app 目錄。

2. 反編譯 systemui.apk,找到 res/layout/status-bar.xml,用 Notepad++ 開啟並搜尋以下程式碼:

<LinearLayout android:gravity="center_vertical" android:id="@+id/statusIcons" android:layout_height="fill_parent" android:layout_width="wrap_content" android:orientation="horizontal"></LinearLayout>

3. 在其上方加入以下程式碼:

<com.android.systemui.statusbar.policy.NetworkSpeedView android:gravity="center" android:layout_height="fill_parent" android:layout_width="wrap_content" android:textColor="@*android:color/white"></com.android.systemui.statusbar.policy.NetworkSpeedView>

提示:並非一定要加在這裡,只要熟悉Android布局,也能放到其他位置。

4. 接著把相關的 smali 檔案加入 com/android/systemui/statusbar/policy 資料夾下(smali.rar)。

5. 最後重新編譯,把檔案放回原處即可。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved