android文件瀏覽器源碼
❶ android怎麼修改源碼
在Android界面的系統status bar上添加home,back,menu三個菜單,並完成對應的系統功能。並有higlight效果,修改status bar 高度和status bar上的文字尺寸。
這需要修改android sdk才能完成,我用的是eclair.下面就我的操作進行敘述。
1.首先完成界面顯示效果。
需要修改文件
./frameworks/base/services/java/com/android/server/status/StatusBarPolicy.java,仿照mBatteryIcon等icon的添加方式添加自定義的icon,圖片名稱指定就好了。另外還要記得修改./frameworks/base/core/res/res/values/arrays.xml,這里定義了icon的slot,並且決定了icon的擺放順序。
這樣,你需要的icon按鍵就可以顯示在系統的status bar上面了。
2.判斷touch event是否按動了某個icon
需要修改的文件
./frameworks/base/services/java/com/android/server/status/StatusBarView.java
首先在onTouchEvent函數中,獲取當前event的坐標,然後比較是否在某個按鍵范圍之內。由於系統對於statusBar的范圍已經有了定義,所以這里只需要比較橫坐標就可以了。
其次,也是這一步最關鍵的,怎麼獲取具體某一個icon的左右邊界坐標呢?系統的status bar左邊顯示的圖標都是notification, 右邊顯示的是系統icon. 也就是說左邊icon屬於mNotificationIcons,右邊的icon屬於mStatusIcons. 在文件StatusBarView.java中出現的offset = getViewOffset(mStatusIcons),得到mStatusIcons的最左邊的icon的left橫坐標。用N = mStatusIcons.getChildCount()得到共有幾個系統icon,其中包含visibility為false的icons.用mStatusIcons.getChildAt(N-i)得到的是從右邊數第i個的icon view. 這個view的getLeft()+offset就是這第i個icon的左邊橫坐標,對應的getRight()+offset就是這第i個icon的右邊橫坐標。本例中home鍵是右邊第2個icon.
3.定義icon響應事件
這里使用的方法是在StatusBarView.java中向
./frameworks/base/services/java/com/android/server/status/StatusBarPolicy.java發送一個Broadcast,讓StatusBarPolicy來完成具體的事件操作。這里需要注意的是不僅要在./frameworks/base/core/java/android/content/Intent.java中定義intent,還要在StatusBarPolicy的構造函數中添加該intent的過濾動作,即filter.addAction(Intent.ACTION_BACKICON_CHANGED).例如,按動了back鍵,如果當前事件為action_up,就向系統發送一個keyEvent,keyCode為KeyEvent.KEYCODE_BACK. 這里借用的是./frameworks/base/cmds/input/src/com/android/commands/input/Input.java中的sendKeyEvent函數,直接拷貝過來,按照需要稍微修改一下形參就可以了,過程不要修改。
需要說明的是,當點擊statusBar可以拉出來一個notification列表,當這個列表顯示出來的時候,這三個back, menu, home鍵的響應速度會非常慢,所以這時不響應事件並隱藏這三個鍵。具體做法是在StatusBarView的onTouchEvent()中判斷mService.mExpanded或者 mService.mTracking為真時就不做響應。mService是StatusBarService對象。隱藏三個鍵也是用Broadcast來做的,但這個intent是由StatusBarServie發出來的,當mExpandedVisible = false時顯示,當mExpandedVisible = true時隱藏。
這里還同時完成了highlight換圖的動作,也是用Broadcast來做得,處理過程一樣,就是需要區分action_down和action_up就可以了。
4.調整status bar的高度
如果你需要顯示較大的屏幕尺寸,同時statusBar的高度要拉大,上面的icon的size也需要調大。為了協調一致,顯示時間的字體和notification顯示的日期的字體也需要調大。具體做法如下:
a.調節status bar icon的size: 只調節status_bar.xml的textSize標簽似乎不起作用,同時又修改了./base/services/java/com/android/server/status/StatusBarIcon.java的t.setTextSize(32);語句才成功。不知道修改status_bar.xml的<com.android.server.status.AnimatedImageView>標簽下的layout_height值是不是必須的,反正我是一起都給改了。
b.調節status bar height: ./base/core/res/res/values/dimens.xml 找得我好辛苦!不知道還需不需要修改./base/core/res/res/values/themes.xml中的Window attributes的windowTitleSize值,反正我也給改了。
c.調節notification顯示日期字體的大小,修改status_bar.xml的<com.android.server.status.DateView>的textSize值。
到這里,就完成了所有工作,看看效果吧。
❷ 如何在安卓手機查看html源代碼
網路「查看網頁源碼」,有很多支持查看網頁源碼的在線站點
❸ 誰有Android系統的源碼
1、通過 ubuntu 軟體中心安裝 wine;
2、通過 ubuntu 軟體中心安裝 winetricks;
3、通過 winetricks 在 shell中輸入: winetricks mfc42
1、通過 wine windows 的方式啟動代理伺服器
2、設置瀏覽器代理伺服器
3、設置shell代理伺服器:
在shell中輸入 sudo gedit /etc/bash.bashrc
在文件 /etc/bash.bashrc 中添加:如下內容
export http_proxy=http://127.0.0.1:8580/export https_proxy=http://127.0.0.1:8580/
通過shell安裝如下的組件:
1、sudo apt-get install bison g++-multilib git gperf libxml2-utils
2、新建一個存放源碼的目錄,如:mkdir ~/andorid/source
3、在源碼目錄中輸入命令:repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
其中: android-4.0.1_r1是android源碼的版本,更多的版本可以通過下面的方式查詢:http://source.android.com/source/build-numbers.html
4、修改source/.repo/manifest/default.xml 文件中的 fetch 的值為:
git://Android.git.linaro.org/
通過如下的指令來設置郵箱和用戶名
git config --global user.name "<your name>" ----修改用戶名git config --global user.email "<your email>" ----修改email
5、在source目錄下輸入指令:repo sync
便開始了代碼的下載
❹ 如何編輯android 系統源碼
1、通過 ubuntu 軟體中心安裝 wine;
2、通過 ubuntu 軟體中心安裝 winetricks;
3、通過 winetricks 在 shell中輸入: winetricks mfc42
1、通過 wine windows 的方式啟動代理伺服器
2、設置瀏覽器代理伺服器
3、設置shell代理伺服器:
在shell中輸入 sudo gedit /etc/bash.bashrc
在文件 /etc/bash.bashrc 中添加
通過shell安裝如下的組件:
1、sudo apt-get install bison g++-multilib git gperf libxml2-utils
2、新建一個存放源碼的目錄,如:mkdir ~/andorid/source
3、在源碼目錄中輸入命令:repo init -u -b android-4.0.1_r1
其中: android-4.0.1_r1是android源碼的版本,更多的版本可以通過下面的方式查詢:
4、修改source/.repo/manifest/default.xml 文件中的 fetch 的值為:
git://Android.git.linaro.org/
通過如下的指令來設置郵箱和用戶名
git config --global user.name "<your name>" ----修改用戶名git config --global user.email "<your email>" ----修改email
5、在source目錄下輸入指令:repo sync
便開始了代碼的下載
方便他人亦是方便自己,如果覺得還行就點下下邊的投票吧,這樣可以幫助其他人更快的找到解決問題的方法;有疑問的也可留言哦, 謝謝!
❺ 有沒有可以在 iOS 和 Android 上查看網頁源碼的瀏覽器
.aspx是動態文件必須在服務上才可以的。如 /a.aspx直接用瀏覽器去打開是不行的!
❻ android 源碼log怎麼查看
基本都是android framework層的源碼了。而且最近發現了一個比較不錯的github插件:OctoTree,它 是一個瀏覽器插件,它可以讓你在Github 看代碼時,左邊欄會出現一個樹狀結構,就像我們在IDE 一樣。當我們看一個項目的結構,或者想看具體的某個文件,這樣就會很方便。
怎麼樣這樣查看源代碼的話是不是很方面?
好了說一下我們今天需要介紹的Log對象,它位於android framework層utils包下,是一個final class類:查看其具體定義:
public final class Log {
/**
* Priority constant for the println method; use Log.v.
*/
public static final int VERBOSE = 2;
/**
* Priority constant for the println method; use Log.d.
*/
public static final int DEBUG = 3;
/**
* Priority constant for the println method; use Log.i.
*/
public static final int INFO = 4;
/**
* Priority constant for the println method; use Log.w.
*/
public static final int WARN = 5;
/**
* Priority constant for the println method; use Log.e.
*/
public static final int ERROR = 6;
/**
* Priority constant for the println method.
*/
public static final int ASSERT = 7;
private Log() {
}
/**
* Send a {@link #VERBOSE} log message.
* @param tag Used to identify the source of a log message. It usually identifies
* the class or activity where the log call occurs.
* @param msg The message you would like logged.
*/
public static int v(String tag, String msg) {
return println(LOG_ID_MAIN, VERBOSE, tag, msg);
}
/**
* Send a {@link #VERBOSE} log message and log the exception.
* @param tag Used to identify the source of a log message. It usually identifies
* the class or activity where the log call occurs.
* @param msg The message you would like logged.
* @param tr An exception to log
*/
public static int v(String tag, String
❼ 怎樣查看 Android APP 源代碼
用壓縮軟體打開apk文件,解壓出根目錄中的classes.dex文件
使用cmd ,dex2jar.bat classes.dex命令將classes.dex轉換為jar
再用jd-gui打開該jar就可以查看源碼了,如果apk安全性好的話,有些代碼是看不到的
❽ 如何獲取android源代碼
當前的Android代碼託管在兩個方:https://github.com/android 和https://android.googlesource.com之前在 android.git.kernel.org上也有託管,不過現在重定向到了https://android.googlesource.com好在都支持git訪問。
google提供的repo工具實際上是一個內部操作git工具來簡化操作Android源碼的Python腳本。經過嘗試,直接使用git工具在ubuntu下可以實現cloneAndroid源碼。下面介紹一下方法:
1.獲取當前的在github上託管的Androidgitrepositories:
github頁面為:https://github.com/android/following。不過這個頁面不支持通過wget"https://github.com/android/following"或者curl"https://github.com/android/following"的方式訪問,錯誤信息如下:
這個時候需能做的只能是"tryagain"了。
需要說明的是"不要試圖同時並發執行多個gitclone命令",這樣會導致大量出現上面貼圖中的錯誤,另外,整個clone過程中耗時最多的gitrepository如下:
kernel_common.gitkernel_msm.gitplatform_frameworks_base.gitplatform_prebuilt.git其中platform_prebuilt.git是google提供的預編譯好的二進制文件,包含:各種庫文件,jar包,可執行程序等等,如果只是閱讀Android源代碼,這個gitrepository可以不用clone.