The graphical user interface for an Android app is built using a hierarchy of View and ViewGroup objects. View objects are usually UI widgets such as buttons or text fields and ViewGroup objects are invisible view containers that define how the
Respond to the Send ButtonTo respond to the button's on-click event, open the main.xml layout file and add the android:onClick attribute to the <Button> element:<Button
How you run your app depends on two things: whether you have a real Android-powered device and whether you're using Eclipse. This lesson shows you how to install and run your app on a real device and on the Android emulator, and in both
當我們修改了google 開放出來的類。所謂開放的類與開放的API,這個只是javadoc的範疇,並不是java中public和private,也就是說,對於源碼的編譯無所謂,只是對javadoc的產生有影響關於類的開放和隱藏,是通過doc的注釋{@hide}來控制的。比如 Environment 這個類,我們新增了幾個成員方法,編譯的時候就會出現如下的錯誤:******************************You have tried to change the API from
In order to reuse the Fragment UI components, you should build each as a completely self-contained, modular component that defines its own layout and behavior. Once you have defined these reusable Fragments, you can associate them with an Activity
Android BroadcastReceiver介紹: broadcastReceiver是android的四大組件之一,大部分的廣播是系統發出來的。例如,螢幕關閉,電池電量不足等等。應用同樣可以建立廣播,例如:當下載完成的時候,要讓其他的應用知道這個情況,需要用到broadcastreceiver,receiver沒有介面,它可能會建立一個status bar notification通知使用者。broadcastreceiver
Use Density-independent PixelsOne common pitfall you must avoid when designing your layouts is using absolute pixels to define distances or sizes. Defining layout dimensions with pixels is a problem because different screens have different pixel
之前項目裡面需要解碼h264視頻,使用的是ffmpeg,解碼出來的是yuv,最好的顯示方法是通過opengl es 2.0來實現視頻的顯示,如果不會opengl es 2.0的話,那麼就必須將yuv2rgb然後在繪製映像,而yuv2rgb我只知道兩種方法1.通過ffmpeg裡面的sws_scale來實現,不過這種方法比較慢,2.這是我之前使用的方法在http://wss.co.uk/pinknoise/yuv2rgb/
以前用到的沒整理,現在整理下,方便用: 一般介面返回一個list我們不能直接傳遞,定義為static類型吧,佔用記憶體又太大,所以我們想辦法定義為普通變數,通過itent傳遞,這個時候我們就必須把自訂的model實現序列化,繼承Parcelable介面。直接貼代碼: public class CityListInfo implements Parcelable; List<CityListInfo> cityListInfos =