筆者正在自學(xué)Android開(kāi)發(fā),隨著學(xué)習(xí)的進(jìn)程的加深,我會(huì)寫(xiě)一些小白級(jí)別的案例,一是為了保存代碼和筆記,二也是為了供同樣熱愛(ài)Android的小伙伴參考。這里寫(xiě)了一個(gè)小案例,叫電話撥號(hào)器。下面詳細(xì)介紹如何做:

對(duì)于我們初學(xué)者來(lái)說(shuō),做案例不同于做項(xiàng)目,我們是為了學(xué)習(xí)所以做案例基本上就是以下三步:
1、做界面UI
2、做業(yè)務(wù)邏輯,就是具體的編程實(shí)現(xiàn)
3、做測(cè)試,可以用模擬器,也可用真機(jī)。(這里說(shuō)一下,如果你的電腦配置不是很高,但有Android的真機(jī)的話,用真機(jī)吧,模擬器真的是太慢了)
首先,做UI,大概是醬紫的:
這個(gè)很簡(jiǎn)單了,需要添加三個(gè)控件“Text View”“Edit Text”“Button”,再加一個(gè)布局,布局可以自己選我用的LinearLayout。
<LinearLayout
android:layout_width="368dp"
android:layout_height="495dp"
android:layout_marginTop="8dp"
android:orientation="vertical"
android:visibility="visible"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="8dp">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:textSize="@dimen/textsize"
android:layout_height="wrap_content"
android:text="@string/text_1" />
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text_2" />
</LinearLayout>
文章名稱:Android電話撥號(hào)器實(shí)例詳解-創(chuàng)新互聯(lián)
瀏覽路徑:http://www.chinadenli.net/article28/dhshcp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、網(wǎng)站營(yíng)銷、Google、網(wǎng)站導(dǎo)航、手機(jī)網(wǎng)站建設(shè)、虛擬主機(jī)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容
營(yíng)銷型網(wǎng)站建設(shè)知識(shí)