android四大组件&helloworld例子

四大组件

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命名
    android四大组件&helloworld例子

Log

文件中引入,使用
import android.util.Log;

...
class{
private static final String TAG = "MainActivity";
Log.d(TAG, "create finish");
}

android四大组件&helloworld例子

猜你喜欢

转载自blog.51cto.com/10541556/2432034