文件名称:android_service
介绍说明--下载内容均来自于网络,请自行研究使用
本次实验主要是学习怎样在activity中启动一个service,启动的service的生命周期顺序是哪些,然后service通过广播机制向特定的activity传递数据,传送数据当然用的是intent,然后接收到该广播的activity读取intent中的数据,根据读取到的数据来更新activity的UI。
关于怎样通过service广播机制来更新activity的UI,可以阅读网上的这篇文章:http://www.pocketdigi.com/20110303/197.html
需要注意的是service类是继承的android框架中的Service类,程序中需要将写好的service在AndriodManiFest.xml中进行注册,注册方法和activity的注册类似。
本程序的activity中有2个按钮和1个TextView,2个按钮分别用来启动service和停止service,然后在activtiy和service的生命周期函数中各自在后台打印出相关语句,同时为了方便观察,程序也直接将相关语句输出到了textview中。-This experiment to learn how to start a service in the activity start service order of the life cycle of which, and service through the broadcast mechanism to transfer data to a specific activity, transmission of data, of course with the An intent, and then receives the broadcast activity to read the intent of the data, according to the read data to update the activity of the UI. This article can be read online on how to update the activity through the service broadcast mechanism UI: http://www.pocketdigi.com/20110303/197.html need to pay attention to in the service class in the service class is inherited android fr a mework The program will need to write the service in AndriodManiFest.xml register, similar to the method of registration and the registration of the activity. The activity of this program have two buttons and a TextView, 2 buttons are used to start the service and stop service, and then activtiy and service life cycle function in the background print out statements at the s
关于怎样通过service广播机制来更新activity的UI,可以阅读网上的这篇文章:http://www.pocketdigi.com/20110303/197.html
需要注意的是service类是继承的android框架中的Service类,程序中需要将写好的service在AndriodManiFest.xml中进行注册,注册方法和activity的注册类似。
本程序的activity中有2个按钮和1个TextView,2个按钮分别用来启动service和停止service,然后在activtiy和service的生命周期函数中各自在后台打印出相关语句,同时为了方便观察,程序也直接将相关语句输出到了textview中。-This experiment to learn how to start a service in the activity start service order of the life cycle of which, and service through the broadcast mechanism to transfer data to a specific activity, transmission of data, of course with the An intent, and then receives the broadcast activity to read the intent of the data, according to the read data to update the activity of the UI. This article can be read online on how to update the activity through the service broadcast mechanism UI: http://www.pocketdigi.com/20110303/197.html need to pay attention to in the service class in the service class is inherited android fr a mework The program will need to write the service in AndriodManiFest.xml register, similar to the method of registration and the registration of the activity. The activity of this program have two buttons and a TextView, 2 buttons are used to start the service and stop service, and then activtiy and service life cycle function in the background print out statements at the s
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Android开发历程_13(Service的使用).pdf
service
.......\.classpath
.......\.project
.......\.settings
.......\.........\org.eclipse.jdt.core.prefs
.......\AndroidManifest.xml
.......\assets
.......\bin
.......\...\AndroidManifest.xml
.......\...\classes
.......\...\.......\com
.......\...\.......\...\example
.......\...\.......\...\.......\service
.......\...\.......\...\.......\.......\BuildConfig.class
.......\...\.......\...\.......\.......\FisrtService.class
.......\...\.......\...\.......\.......\MainActivity$EndOnClickListener.class
.......\...\.......\...\.......\.......\MainActivity$MyReceiver.class
.......\...\.......\...\.......\.......\MainActivity$StartOnClickListener.class
.......\...\.......\...\.......\.......\MainActivity.class
.......\...\.......\...\.......\.......\R$attr.class
.......\...\.......\...\.......\.......\R$drawable.class
.......\...\.......\...\.......\.......\R$id.class
.......\...\.......\...\.......\.......\R$layout.class
.......\...\.......\...\.......\.......\R$menu.class
.......\...\.......\...\.......\.......\R$string.class
.......\...\.......\...\.......\.......\R$style.class
.......\...\.......\...\.......\.......\R.class
.......\...\classes.dex
.......\...\jarlist.cache
.......\...\res
.......\...\...\drawable-hdpi
.......\...\...\.............\ic_action_search.png
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-ldpi
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-mdpi
.......\...\...\.............\ic_action_search.png
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-xhdpi
.......\...\...\..............\ic_action_search.png
.......\...\...\..............\ic_launcher.png
.......\...\resources.ap_
.......\...\service.apk
.......\gen
.......\...\com
.......\...\...\example
.......\...\...\.......\service
.......\...\...\.......\.......\BuildConfig.java
.......\...\...\.......\.......\R.java
.......\ic_launcher-web.png
.......\libs
.......\....\android-support-v4.jar
.......\proguard-project.txt
.......\project.properties
.......\res
.......\...\drawable-hdpi
.......\...\.............\ic_action_search.png
.......\...\.............\ic_launcher.png
.......\...\drawable-ldpi
.......\...\.............\ic_launcher.png
.......\...\drawable-mdpi
.......\...\.............\ic_action_search.png
.......\...\.............\ic_launcher.png
.......\...\drawable-xhdpi
.......\...\..............\ic_action_search.png
.......\...\..............\ic_launcher.png
.......\...\layout
.......\...\......\activity_main.xml
.......\...\menu
.......\...\....\activity_main.xml
.......\...\values
.......\...\......\strings.xml
.......\...\......\styles.xml
.......\...\values-v11
.......\...\..........\styles.xml
.......\...\values-v14
.......\...\..........\styles.xml
.......\src
.......\...\com
.......\...\...\example
.......\...\...\.......\service
.......\...\...\.......\.......\FisrtService.java
.......\...\...\.......\.......\MainActivity.java
service
.......\.classpath
.......\.project
.......\.settings
.......\.........\org.eclipse.jdt.core.prefs
.......\AndroidManifest.xml
.......\assets
.......\bin
.......\...\AndroidManifest.xml
.......\...\classes
.......\...\.......\com
.......\...\.......\...\example
.......\...\.......\...\.......\service
.......\...\.......\...\.......\.......\BuildConfig.class
.......\...\.......\...\.......\.......\FisrtService.class
.......\...\.......\...\.......\.......\MainActivity$EndOnClickListener.class
.......\...\.......\...\.......\.......\MainActivity$MyReceiver.class
.......\...\.......\...\.......\.......\MainActivity$StartOnClickListener.class
.......\...\.......\...\.......\.......\MainActivity.class
.......\...\.......\...\.......\.......\R$attr.class
.......\...\.......\...\.......\.......\R$drawable.class
.......\...\.......\...\.......\.......\R$id.class
.......\...\.......\...\.......\.......\R$layout.class
.......\...\.......\...\.......\.......\R$menu.class
.......\...\.......\...\.......\.......\R$string.class
.......\...\.......\...\.......\.......\R$style.class
.......\...\.......\...\.......\.......\R.class
.......\...\classes.dex
.......\...\jarlist.cache
.......\...\res
.......\...\...\drawable-hdpi
.......\...\...\.............\ic_action_search.png
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-ldpi
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-mdpi
.......\...\...\.............\ic_action_search.png
.......\...\...\.............\ic_launcher.png
.......\...\...\drawable-xhdpi
.......\...\...\..............\ic_action_search.png
.......\...\...\..............\ic_launcher.png
.......\...\resources.ap_
.......\...\service.apk
.......\gen
.......\...\com
.......\...\...\example
.......\...\...\.......\service
.......\...\...\.......\.......\BuildConfig.java
.......\...\...\.......\.......\R.java
.......\ic_launcher-web.png
.......\libs
.......\....\android-support-v4.jar
.......\proguard-project.txt
.......\project.properties
.......\res
.......\...\drawable-hdpi
.......\...\.............\ic_action_search.png
.......\...\.............\ic_launcher.png
.......\...\drawable-ldpi
.......\...\.............\ic_launcher.png
.......\...\drawable-mdpi
.......\...\.............\ic_action_search.png
.......\...\.............\ic_launcher.png
.......\...\drawable-xhdpi
.......\...\..............\ic_action_search.png
.......\...\..............\ic_launcher.png
.......\...\layout
.......\...\......\activity_main.xml
.......\...\menu
.......\...\....\activity_main.xml
.......\...\values
.......\...\......\strings.xml
.......\...\......\styles.xml
.......\...\values-v11
.......\...\..........\styles.xml
.......\...\values-v14
.......\...\..........\styles.xml
.......\src
.......\...\com
.......\...\...\example
.......\...\...\.......\service
.......\...\...\.......\.......\FisrtService.java
.......\...\...\.......\.......\MainActivity.java