Time of Update: 2018-12-04
拿到android項目,是一個apk的包。這裡麵包含編譯後的代碼和資源檔兩部分。其中資源檔的反向工程,可以參見簡單分析apk檔案中的資訊。而編譯後的代碼部分,需要藉助兩個工具:dex2jar,用於將dex檔案轉換為jar檔案; jd-gui,將jar檔案反向工程為java代碼。 dex2jar的連結在:http://code.google.com/p/dex2jar/下載然後解壓縮,可以直接在windows下或者linux下運行。命令參數比較簡單:./dex2jar.sh
Time of Update: 2018-12-04
android命令,挑幾個常用的記錄一下。1. 查看android版本列表命令:./android list target 2. 根據查看的版本號碼創立模擬器命令:./android create avd -n magicyu -t 8顯示:Created AVD'mytest' based on Google APIs (Google Inc.),with thefollowing hardware config:hw.lcd.density=240
Time of Update: 2018-12-04
其實解壓、打包boot.img沒什麼難度一看就會咯!! 1.先下附件:工具。 點擊開啟連結 6.0 KB, 下載次數: 60) 解壓到bin檔案夾裡,方便以後使用。 2.解壓boot.img檔案 去到boot.img所在的檔案夾,輸入下面的命令:split.pl boot.img Page size: 2048 (0x00000800) Kernel size: 2240184 (0x00222eb8)
Time of Update: 2018-12-04
package com.tware.pdfdrop;import java.io.File;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.TextView;public class
Time of Update: 2018-12-04
TextView控制項學習1 建立TextView對象有兩種方法:1.1 在程式中建立TextView對象;TextView tv=new TextView(this); tv.setText("您好"); setContentView(tv);1.2 在XML布局檔案中使用;(推薦使用這種方法)<TextViewandroid:id="@+id/tv" android:layout_width="fill_parent"
Time of Update: 2018-12-04
到目前為止,已經瞭解了如何使用Intent對象去調用其他activity。接下來說一說Intent對象是如何使用的。1. 可以通過給Intent的構造器傳遞一個action:[java] view plaincopystartActivity(new Intent("net.learn2develop.SecondActivity")); 2. 可以直接指定Activity組件,像這樣:[java] view
Time of Update: 2018-12-04
在上一節,我們已經知道了在按MENU鍵的時候,如何顯示選項菜單。但是,除了選項菜單,你也可以顯示一個操作功能表。操作功能表通常是和activity中的組件相關聯的。當使用者長按一個組件的時候,它的操作功能表就會被觸發。例如,使用者長按一個Button,一個操作功能表就有可能被顯示。如果想要把一個組件與一個操作功能表聯絡在一起,就需要在組件上面調用setOnCreateContextMenuListener()。下面展示如何顯示一個操作功能表(Context Menu)。1.
Time of Update: 2018-12-04
在上一節中,大家已經看到了,PreferenceActivity這個類允許使用者在運行時去建立和修改喜好設定資訊。如果想要使用這些喜好設定資訊,你就需要使用SharedPreferences這個類。1. 繼續使用上一節中的工程,在UsingPreferences.java中添加一些代碼。public class UsingPreferencesActivity extends Activity {/** Called when the activity is first created. */@
Time of Update: 2018-12-04
DBAdapter已經建立好了,現在我們可以去使用資料庫了。下面的章節,將介紹常規的CRUD(增加,讀取,更新,刪除)。往表中新增連絡人...。1. 使用之前的項目,在DatabasesActivity.java中添加一些代碼。public class DatabasesActivity extends Activity { /** Called when the activity is first created. */ @Override public void
Time of Update: 2018-12-04
adb是主機與android裝置通訊的基礎,前面提到的ddms也是基於adb,只是做了圖形化而已。adb的主要命令有adb devices: 會列出所有與主機串連的android裝置。adb -s emulator-5554 , 當有多個設別與主機串連時,用-s指定與那個裝置串連。adb install hello.apk 安裝應用程式到android裝置adb pull <remote> <local> , adb push
Time of Update: 2018-12-04
AutoCompleteTextView: An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of
Time of Update: 2018-12-04
最近寫一個項目,涉及到viewpager,而變態的客戶要求不滑動。 方法很簡單 重寫viewpager就可以了,現在將代碼貼出.import android.content.Context;import android.support.v4.view.ViewPager;import android.util.AttributeSet;import android.view.MotionEvent;public class
Time of Update: 2018-12-04
說明:以下經驗是轉載的,出處在後面。對TextView的滾動高度興趣,有時間會做一個具體的測試……作者意圖:本來是想做一個顯示文字資訊的,當文字很多時View的高度不能超過一個固定的值,當文字很少時View的高度小於那個固定值時,按View的高度顯示。因為ScrollView沒有maxHeight,無法滿足需求,只好另找方法了。 View本身是可以設定ScrollBar,這樣就不一定需要依賴ScrollView了。TextView有個屬性maxLine,這樣也就滿足了需求了,只要設定一個Text
Time of Update: 2018-12-04
導語:美國IT網站CNET今天撰文稱,與微軟和蘋果不同,Google重點打造的Chrome OS和Android兩款作業系統有著完全不同的理念。雖然這會令Google的發展方向模糊不清,但由於這兩大系統所涉足的領域都已經成為當今科技界的重要發展趨勢,因此它們之間並不相互排斥。 以下為文章全文: 兩大系統 Google並非唯一一家擁有兩款作業系統的大型科技公司,但卻是唯一一家採用差距如此之大的方法經營兩款作業系統的企業。 Android和Chrome
Time of Update: 2018-12-04
1. 得到存放裝置的目錄:/SDCARD(一般情況下)SDPATH=Environment.getExternalStorageDirectory()+"/";2. 判斷SD卡上的檔案夾是否存在:通過File對象的exists()方法。 /** * 判斷檔案是否已經存在; * / public boolean checkFileExists(String filepath) { File file=new File(SDPATH+filepath);
Time of Update: 2018-12-04
http://tianmeng126.blog.163.com/blog/static/10800956820115981114488/ untun下USB串連Android手機後,使用adbdevices出現如下: List of devices attached???????????? no
Time of Update: 2018-12-04
建立項目Creating a new project with build.xmlIf you've already created your project and followedthe above instructions, you can skip this section. If not, you can may eithercreate a new Android project using the regular Eclipse method (via New >Other.
Time of Update: 2018-12-04
http://www.cnblogs.com/shengdoushi/archive/2011/01/13/1934181.html#viewSourcehttp://www.douban.com/note/74862515/http://blog.csdn.net/hecker385/article/details/6678621 建立一個OpenGLRenderer 實現 GLSurfaceView.Renderer介面:onSurfaceCreated :
Time of Update: 2018-12-04
TextView是用來顯示文本的,有時需要給TextView中的個別字設定為超連結,或者設定個別字的顏色、字型等,那就需要用到Spannable對象,可以藉助Spannable對象實現以上設定。res-layout-main.xml: <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2018-12-04
Aandroid開發過程中經常會用到點擊螢幕然後做出某種反映,那麼到底如何?點擊螢幕的某一位置,或者某一圖片來實現某種動作呢?Android系統支援的觸屏事件有按下,彈起,移動,雙擊,長按,滑動。其實要實現這些時間只要我們重寫view的方法onTouchEvent即可按下(ACTION_DOWN):顧名思義按下指當收觸碰到螢幕的一霎那即為DOWN。下面我來舉例告訴大家,如何?按下的時候實現某種操作。class MyView extends SurfaceView implements