main thread in android application

In android sdk document, it's mentioned that all components(Activity, Service, etc) run on the main thread. The main thread is the thread where our code works on.Conventionally, when talk about a Service, we think it this way: void service() {

Android裡面的匿名類與匿名內部類使用

      在android開發中經常碰到匿名類(和匿名內部類)的使用,那麼匿名類和一般情況下使用的類有什麼不同,從實現的功能來講是一樣的,但是使用匿名更加簡潔方便,形式上有點像new一個介面或類的感覺,但是我們必須記住介面是不可以new出來的(執行個體化),我們要在內部重寫需要的介面的方法,這樣就new出了一個實現介面方法的對象,但是這個對象的類名不可見,所以叫做匿名類。下面是功能相同的兩段代碼,分別用上述兩種寫法實現:匿名類形式如下:new <類或介面> <類的主體>

android基礎AlertDialog使用

android中建立對話方塊相對來說比較簡單new一個AlertDialog.Builder,然後設定它的一些資訊比如顯示內容,標題,是否可以通過返回鍵取消對話方塊,確定按鈕,取消按鈕等等。、      new AlertDialog.Builder(EX03_12.this) .setTitle(R.string.app_about) .setMessage(R.string.app_about_msg)

android 撥打到電話與傳送簡訊

       通過調用android系統提供的電話與簡訊功能,可以簡單的實現傳送簡訊,撥打到電話,但是必須在AndroidManifest.xml裡面配置相應許可權,定位到1 <application 2 3 /application>標籤外面一層,撥打到電話的許可權為android.permission.CALL_PHONE,傳送簡訊的許可權為android.permission.SEND_SMS.而內部代碼主要是寫按鈕的單擊事件就可以了,覆寫 onClick()事件傳送簡訊: 1

Android單元測試與日誌輸出

 AndroidTestCase如果對要存取資源或者其他一些依賴於Activity內容相關的操作進行單元測試,則需擴充AndroidTestCase介面(Extend this if you need to access Resources or other things that depend on Activity Context.) 1 2 public class testServiceApp extends AndroidTestCase 3 { 4 public

Android 4.1果凍豆新特性詳解

Android 4.1果凍豆新特性詳解  發布會已經結束,Android新一代的4.1版本,代號Jelly Bean(果凍豆)的新系統已經正式問世,除了新架構、全新通知欄和搜尋功能之外,實際上這個新系統還有許多新的特性,在發布會上不能完整的展示,現在我們就對這些新特點逐一解析,讓你看到4.1版系統會不會值得大家期待。  1.更快、更流暢、更靈敏  在演講中,大家除了聽到果凍豆這個詞之外,還有一個Project

Android中調用Web Services

Android中調用Web Services有很多方法,我們現在使用的是ksoap,它是SOAP web services的用戶端包,ksoap現在版本為2.0.它的一個主要優點就是對dotNET相容性比較不錯。首先下載ksoap的包檔案(),在Eclispe的Package Explorer中右鍵項目,Build Path>Add

Android為Spinner添加資料

Android中的Spinner就是下拉框,點擊時會出現挑選清單,從中可以選擇資料。Spinner中的資料必須來自Adapter,因此給它添加資料時需要先定義模板,也就是layout中的xml檔案。<?xml version="1.0" encoding="utf-8"?><TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tvCateItem"

【部落格園用戶端】部落格園Android用戶端更新:離線下載、本地收藏、RSS閱讀

如果還不知道這個應用的,請看前一篇文章《部落格園Android用戶端正式發布》。距離上次發布應用已經過去了三個多月,突然發現時間過得很快,這段時間裡大概花了一個月的時間把代碼基本重寫了一遍並把主要的功能加上了,因為白天工作都很忙,所以只能利用晚上和周末的時間來做新版本的開發,這期間一方面由於是新版本開發中會遇到一些技術問題,另一方面總是被各種瑣事纏身,並不能將時間利用發揮到極致,所以,讓各位久等了。視頻示範視頻地址:http://v.youku.com/v_show/id_XMzgyODA1Mz

Android開發系列(三)

        這是更加android開發文檔,寫的我的第一個Android開發項目,就是在螢幕上顯示一個簡單的Hello World。      首先介紹幾個概念:      AVD,AVD的全稱為:AndroidVirtual

native programming on android

Besides programming with java, we're also able to do native programming with c or c++ on android platform.To do so, we need a cross compiler target on arm processor for our working platform( windows or linux). So I downloaded Sourcery G++ Lite 2009q3

communicate with service on android

While doing android programming, it's a common sense to use Activity to interact with users and use Service to perform time consuming tasks (actually, such tasks are usually performed on a new thread spawned by the service). A classic example is

Android版‘音樂一點通’音樂播放器詳情

項目描述:音樂一點通是一款整合本地音樂,網路音樂的音樂播放器,不僅介面美觀,而且更加人性化,可以完全替換Android內建的播放器。 特點描述:   

logging in android

Android provides a set of powerful log utilities to make our developing life easier. If you've ever used the OutputDebugString function and the DebugView on windows, you'll find they works very similar to android's counterpart in the sense of user

native programming with android building system

In the previous post, native programming on android, I showed how to use code sourcery toolchain to do native programming on android. But in that way, we must link c library statically into our application, which is not desirable. So, in this post,

android property system

Property system is an important feature on android. It runs as a service and manages system configurations and status. All these configurations and status are properties. A property is a key/value pair, both of which are of string type.From the

video player demo in android

In this post, I'll show some basic operations in android with a simple video player. The demo shows how to:Use explicit intentList video files with ListView, ContentProvider & MediaProviderRetrieve data from another Activity with

Beginning Android Development

Recently, I get start doing some development on android platform. Having skimmed through android sdk document, I find it’s a very interesting platform with a lot of new concepts compared to other platforms. So, I'd like to write a serial of blog

streaming audio on android

Streaming media refers to the capability of playing media data while the data is being transferred from server. The user doesn't need to wait until full media content has been downloaded to start playing. In media streaming, media content is split

stream audio via udp on android

In this post, I tried to play small audio data chunks with AudioTrack to show the feasibility of streaming audio. It's not straightforward enough. So I updated the sample code to actually transfer audio data with udp.As the image below shows, the

總頁數: 2802 1 .... 81 82 83 84 85 .... 2802 Go to: 前往

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

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

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