android中文字型

ndroid 對中文字型支援很不好~~ 需要加入相應的字型庫(1)建立布局Layout//建立線性布局        LinearLayout

android 對GIF動畫格式的支援

參考APIDEMOS裡面的 BitmapDecode.java 對R.drawable.animated_gif的支援 @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(new SampleView(this));    }        private static class

android EditText 去掉焦點和關閉軟鍵盤

關閉軟鍵盤 private void hideInputSoft() {  try {   InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);   imm.hideSoftInputFromWindow(mContext.getWindow().getDecorView().getWindowToken(), 0);  } catch

android豎立進度條

package com.cardroid.textView;    import android.content.Context;  import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.KeyEvent; import

android listview 反彈效果

重寫listview,通過監聽滑動事件,根據滑動時所處的位置,以及滑動的方向,使用view的內建scrollTo或scrollBy函數來移動view到你手勢互動的距離(此處為一半),然後當確定消費了給事件後,又復原到(0,0)點。當然只有在超出了邊界時才復原。而且復原的過程由TranslateAnimation來控制,這樣的好處在代碼的解釋中。我是基於網路上的listviewpress改了一些(有幾處好像是被篡改了,我又按我的理解將它改正過來,運行後沒問題)。一下是關鍵的代碼,整個代碼見附件中。

Android日記之四

痛苦了這麼久,還是有收穫的。。。自訂listview,每個item包含一個TextView和一個Button,然後想每次點擊後,改變button背景,改變後。等到下次再開啟,也變化了,也就是說要保留改變後的狀態。。。listItemView.xuebutton.setBackgroundResource((Integer)

Android的簡單圖形和view重新整理

建立View:import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;import android.graphics.RectF;import android.view.View;public class MyView extends

從android中調用web service的源碼

package com.android;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.Map.Entry;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import

android Activity之間傳遞對象

android 不同activity之間傳遞對象有兩種方式:Bundle 的 1) public void putSerializable(String key, Serializable value) ; 2)public void putParcelable(String key, Parcelable value)所以傳遞類需要 implements Serializable 或者 implements Parcelable 即可。一)implements Serializable

Android Build: Tips and Tricks

All below build steps are trivial, but i took like a week to get a grip of..  just documenting to be handy.$MYDROID is root of your android source directory.Quick Incremental BuildSetup the environment for your build setup, go to moudle's directory

Android實現全屏方法

 一是在OnCreate中(放在set表單前):      requestWindowFeature(Window.FEATURE_NO_TITLE);     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);    

Android透明無邊框圓形進度條之最簡單實現

http://blog.csdn.net/javasecret/article/details/7579698        很多人在項目中做長時間操作時,比如訪問web service後台資料,都想顯示一個透明無邊框的圓形進度條,如:        不幸的是,Android系統內建的ProgressDialog,無論如何設定Theme、style,或者用java代碼設定什麼屬性,邊框都是去不掉的,至少我現在還不知道怎麼去掉:        怎麼辦?       

android 建立shortcut

1.manifest中添加permis:    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> 2.建立shortcut的intent:                                        Intent shortcut = new Intent(                                               

cocos2d-x 音頻在 Android 播放問題, preloadEffect 函數作用

原文連結:http://blog.csdn.net/zhangxaochen/article/details/8010634一直不知道 preloadEffect 函數作用,只是猜想可能會提高程式啟動效率之類的。結果今天居然碰上了用例o(╯□╰)o看這裡:

[Android分享] Android ListPreference的用法

       首先,我們明確,preference是和資料存放區相關的。       其次,它能協助我們方便的進行資料存放區!為什麼這個地方一定要強調下方便的這個詞呢?原因是,我們可以根本就不使用,我們有另外的N種辦法可以實現同樣的功能!它的出現,相當於為我們提供了一個方便的工具,當然了,這個工具並不是必須的。       preference都應用在什麼情境呢?      

Android中的Surface和SurfaceView之我見

一、什麼是Surface           簡單的說Surface對應了一塊螢幕緩衝區,每個window對應一個Surface,任何View都要畫在Surface的Canvas上(後面有原因解釋)。傳統的view共用一塊螢幕緩衝區,所有的繪製必須在UI線程中進行。        在SDK的文檔中,對Surface的描述是這樣的:“Handle onto a raw buffer that is being managed by the screen

[linphone]ubuntu下,編譯linphone-android

編譯linphone-android遇到不少問題,記錄下來,備用。1.下載代碼,我是通過git下載的,http://www.linphone.org/eng/download/git.htmlgit clone git://git.linphone.org/linphone-android.git --recursive這個只是主工程,下面有好幾個子工程,即submodule,如果下載順利,會自動把子工程一起下載。代碼較大,下載後加上.git約500M,建議下載時找個網速較好的電腦。但如果出錯,

android在apk中擷取root許可權,並執行命令

工程代碼:http://download.csdn.net/detail/victoryckl/4610617    在apk中,有時候需要root許可權,例如通過apk更新系統庫等system的檔案等,避免升級韌體,或者在apk中需要直接存取某些裝置等。下面是在apk中擷取root許可權的方法,前提是裝置已經root過了。   關鍵點在於下面這句,通過執行su產生一個具有root許可權的進程:Process p =

Android編程擷取網路連接狀態(3G/Wifi)及調用網路設定介面

http://www.cnblogs.com/mainroadlee/archive/2011/01/11/Android_Network_State_Checking_And_Setting.html擷取網路連接狀態隨著3G和Wifi的推廣,越來越多的Android應用程式需要調用網路資源,檢測網路連接狀態也就成為網路應用程式所必備的功能。Android平台提供了ConnectivityManager

android模擬器在工作列上,但是不能顯示出視窗

Win xp 系統 工作列上顯示了正在啟動並執行模擬器,但是點擊它,始終看不到模擬器顯示出來。用Alt + Tab 切換也不行。在網上查了下,大概有幾種方法:1.重新裝一下ADT,據說有效果,結果有人天天重裝ADT。2.在啟動自己的AVD時,把“Scale display to real

總頁數: 2771 1 .... 1896 1897 1898 1899 1900 .... 2771 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.