android開發(fā)中文件夾和文件對(duì)應(yīng)的含義,Activity的使用
來源:實(shí)搜網(wǎng)絡(luò) 2015-09-12
Src :編寫的源文件。
Gen:默認(rèn)生成的java文件,不要修改
Android:jar文件
Assets:可以放置文件,可放置任何文件
Res:可以放置文件,其中的文件會(huì)在R.java中生成對(duì)應(yīng)ID的信息
下面的drawable分別是圖片大小文件夾,不同版本的分辨率放置不同的圖片
Layout是控件位置和屬性,布局文件:
Manifest package,應(yīng)用程序的包名
AndroidManifest.xml
Application 應(yīng)用程序配置,android:icon配置圖標(biāo)可以應(yīng)用R.java中的資源,android:label配置標(biāo)簽。
1, 每個(gè)Activity都是一個(gè)類,需要集成Activity。
protected void onCreate(Bundle savedInstanceState)
2, 需要復(fù)寫onCreate方法,當(dāng)Activity第一次運(yùn)行的時(shí)候會(huì)調(diào)用其方法。
3, 每個(gè)Activity都需要在manifest中進(jìn)行配置
4, 在layout中的activity中設(shè)置文本的布局。如:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/mytext" 取得生成的ID在R.java中
android
實(shí)搜網(wǎng)絡(luò)為您提供網(wǎng)絡(luò)推廣,網(wǎng)絡(luò)營(yíng)銷,網(wǎng)站建設(shè),SEO優(yōu)化,微信開發(fā),網(wǎng)站托管等服務(wù),服務(wù)熱線:0311-66697360