四大組件
Activities——UI,app能看到的UI界面都是activities
Services——負責處理後臺數據,用戶看不到的,例如播放音樂等,上傳數據,拉取視頻資源
Broadcast Receivers——處理app和其他程序之前通信,例如app使用過程中有電話打來
Content Providers——可使用android提供api存儲數據。請求由ContentResolver類的方法來處理。這些數據可以是存儲在文件系統、數據庫或者其他其他地方。
helloworld
https://www.runoob.com/android/android-hello-world-example.html
- 注:packagename命名
Log
文件中引入,使用
import android.util.Log;
...
class{
private static final String TAG = "MainActivity";
Log.d(TAG, "create finish");
}