Time of Update: 2018-12-06
Android曆程用Eclipse IDE的開發環境。首先下載需要的軟體。1, JDK :http://java.SUN.com/javase/downloads/index.JSP 版本:1.6 u222, Eclipse:http://download.eclipse.org/eclipse/downloads/版本:3.5.2 for Java Developer3, Android
Time of Update: 2018-12-06
發現Ubuntu12.04不能串連小米開發,adb devices不能看到裝置! 搞了一個上午才搞成功! 小米手機利用USB串連到Ubuntu 12.04系統。運行下面的命令:longskywang@bjb0503:~$ lsusbBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 001
Time of Update: 2018-12-06
1、FrameLayout 架構布局 所有控軟只能羅列到左上方,不能進行複雜的布局2、LineLayout 線性布局 可以設定它的垂直或水平屬性值,來排列所有的了元素,所有的的元素都被堆放在其它元素之後。垂直列表的每一行只會有一個元素,而水平列表只有一個行高。線生布局可能進行複雜的布局編排。可以嵌套使用。3、AbsoluteLayout 絕對布局
Time of Update: 2018-12-06
這是一個轉載的總結文章,協助學習非阻塞的網路通訊方法。 對於Android的網路通訊效能的提高,可以使用Java上高效能的NIO (New I/O)
Time of Update: 2018-12-06
Android中的簡訊並沒有正式的content provider可用,在官方文檔中沒有提供定義。不過依然可以自己定義好URI,然後查詢出簡訊內容。例如conetent://sms則是所有簡訊所在的path。
Time of Update: 2018-12-06
1 服務是無介面的可靠的一個組件,可靠是當一個服務啟動的時候一般是不會關閉的,即使該服務依耐的應用進程被Kill了,它也會一直運行,除非記憶體資源緊張、意外關機或是通過代碼來關閉;服務對外部發過來的intent會重複執行,以保證服務品質。 2
Time of Update: 2018-12-06
錯誤產生:Java代碼{dp.sh.Toolbar.CopyToClipboard(this);return false;}" href="http://blog.csdn.net/zeng622peng/archive/2010/12/25/6097346.aspx#">private Context mcontext;
Time of Update: 2018-12-06
鎖定 Activity 運行時的螢幕方向Xml代碼<activity android:name=”.EX01″android:label=”@string/app_name”android:screenOrientation=”portrait” // 豎屏 , 值為 landscape 時為橫屏…………</activity>全屏的Activity 要使一個 Activity 全屏運行,可以在其 onCreate()方法中添加如下代碼實現:Java代碼//
Time of Update: 2018-12-06
http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/ 我對其進行了修改,並加了簡單的注釋,這個例子的不僅是對js的操作,它還對android瀏覽器做了簡單的介紹, 這些我會在注釋中一一講解。 Javascript彈出框有如下三種: Java代碼 alert(); window.confirm("Are you srue?"); window.prompt("Please inpu
Time of Update: 2018-12-06
簡單地理解:margin為外邊框,border為邊框,padding為內邊框。如果上下左右的距離不同可以通過以下的屬性進行設定。margin:android:layout_marginTopandroid:layout_marginBottomandroid:layout_marginLeftandroid:layout_marginRightpadding:android:paddingTopandroid:paddingBottomandroid:paddingLeftandroid:pad
Time of Update: 2018-12-06
新版本在智能提示的時候經常卡死,找了很多辦法,但很多也不管用。今天終於解決了: http://www.cnblogs.com/zenghanxi/archive/2010/08/13/1799229.html 新下了eclipse3.6,很開心,多了一些新功能。好景不長,沒用多久就卡起來了,又下了個最瘦的那個版本都卡,找了好久,關了很多東西都沒有用,終於發現原來是 "Usage Data Collector"
Time of Update: 2018-12-06
// 建立一個toast對象private Toast toast; public void showMsg(String arg) { if (toast == null) { toast = Toast.makeText(this, arg, Toast.LENGTH_SHORT); } else { toast.cancel(); toast.setText(arg); }
Time of Update: 2018-12-06
參考 Android拍照、錄影、錄音代碼範例 public class MyCameraActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
Time of Update: 2018-12-06
先在 Manifest 裡添加許可權<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />然後在 mainActivity 添加方法SQLiteDatabase db; private final String
Time of Update: 2018-12-06
布局檔案<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical" android:layout_width="fill_parent"android:layout_height="fill_parent"><TableLayout
Time of Update: 2018-12-06
建一個AsyncLoadedImage類繼承AsyncTask非同步載入類,調用publishProgress方法更新onProgressUpdate貯存縮圖資訊到Adapter。監聽Adapter Change實現非同步載入縮圖。main.xml<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2018-12-06
關於Android布局,之前給大家分享了不少,感謝這些文章的原作者,先來一起回顧一下:Android中LinearLayout、AbsoluteLayout使用介紹Android布局之RelativeLayout、FrameLayout使用介紹Android布局之TableLayout使用介紹Android布局之TableLayout實現九宮圖好吧,那就天就來講講Android中ListView的用法,原文如下:ListView是一個經常用到的控制項,ListView裡面的每個子項Item可以使
Time of Update: 2018-12-06
main.xml<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/arc_hf_search_result" android:layout_width="match_parent" android:layout_height="match_parent"
Time of Update: 2018-12-06
main.xml主布局檔案,代碼<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"
Time of Update: 2018-12-06
對於之前從事.net或者java開發人員,習慣了從後台擷取網格資料(多行多列DataTable),但轉行從事android開發,難免會不習慣Android調用Webservice時,如果傳回值是一個boolean或者string值時可以通過下面方式接收傳回值:SoapObject soapObject = (SoapObject) envelope.getResponse(); Re = soapObject.getProperty("twgp")