文件名称: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 framework 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 framework 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/
service/.classpath
service/.project
service/.settings/
service/.settings/org.eclipse.jdt.core.prefs
service/AndroidManifest.xml
service/assets/
service/bin/
service/bin/AndroidManifest.xml
service/bin/classes/
service/bin/classes/com/
service/bin/classes/com/example/
service/bin/classes/com/example/service/
service/bin/classes/com/example/service/BuildConfig.class
service/bin/classes/com/example/service/FisrtService.class
service/bin/classes/com/example/service/MainActivity$EndOnClickListener.class
service/bin/classes/com/example/service/MainActivity$MyReceiver.class
service/bin/classes/com/example/service/MainActivity$StartOnClickListener.class
service/bin/classes/com/example/service/MainActivity.class
service/bin/classes/com/example/service/R$attr.class
service/bin/classes/com/example/service/R$drawable.class
service/bin/classes/com/example/service/R$id.class
service/bin/classes/com/example/service/R$layout.class
service/bin/classes/com/example/service/R$menu.class
service/bin/classes/com/example/service/R$string.class
service/bin/classes/com/example/service/R$style.class
service/bin/classes/com/example/service/R.class
service/bin/classes.dex
service/bin/jarlist.cache
service/bin/res/
service/bin/res/drawable-hdpi/
service/bin/res/drawable-hdpi/ic_action_search.png
service/bin/res/drawable-hdpi/ic_launcher.png
service/bin/res/drawable-ldpi/
service/bin/res/drawable-ldpi/ic_launcher.png
service/bin/res/drawable-mdpi/
service/bin/res/drawable-mdpi/ic_action_search.png
service/bin/res/drawable-mdpi/ic_launcher.png
service/bin/res/drawable-xhdpi/
service/bin/res/drawable-xhdpi/ic_action_search.png
service/bin/res/drawable-xhdpi/ic_launcher.png
service/bin/resources.ap_
service/bin/service.apk
service/gen/
service/gen/com/
service/gen/com/example/
service/gen/com/example/service/
service/gen/com/example/service/BuildConfig.java
service/gen/com/example/service/R.java
service/ic_launcher-web.png
service/libs/
service/libs/android-support-v4.jar
service/proguard-project.txt
service/project.properties
service/res/
service/res/drawable-hdpi/
service/res/drawable-hdpi/ic_action_search.png
service/res/drawable-hdpi/ic_launcher.png
service/res/drawable-ldpi/
service/res/drawable-ldpi/ic_launcher.png
service/res/drawable-mdpi/
service/res/drawable-mdpi/ic_action_search.png
service/res/drawable-mdpi/ic_launcher.png
service/res/drawable-xhdpi/
service/res/drawable-xhdpi/ic_action_search.png
service/res/drawable-xhdpi/ic_launcher.png
service/res/layout/
service/res/layout/activity_main.xml
service/res/menu/
service/res/menu/activity_main.xml
service/res/values/
service/res/values/strings.xml
service/res/values/styles.xml
service/res/values-v11/
service/res/values-v11/styles.xml
service/res/values-v14/
service/res/values-v14/styles.xml
service/src/
service/src/com/
service/src/com/example/
service/src/com/example/service/
service/src/com/example/service/FisrtService.java
service/src/com/example/service/MainActivity.java
service/
service/.classpath
service/.project
service/.settings/
service/.settings/org.eclipse.jdt.core.prefs
service/AndroidManifest.xml
service/assets/
service/bin/
service/bin/AndroidManifest.xml
service/bin/classes/
service/bin/classes/com/
service/bin/classes/com/example/
service/bin/classes/com/example/service/
service/bin/classes/com/example/service/BuildConfig.class
service/bin/classes/com/example/service/FisrtService.class
service/bin/classes/com/example/service/MainActivity$EndOnClickListener.class
service/bin/classes/com/example/service/MainActivity$MyReceiver.class
service/bin/classes/com/example/service/MainActivity$StartOnClickListener.class
service/bin/classes/com/example/service/MainActivity.class
service/bin/classes/com/example/service/R$attr.class
service/bin/classes/com/example/service/R$drawable.class
service/bin/classes/com/example/service/R$id.class
service/bin/classes/com/example/service/R$layout.class
service/bin/classes/com/example/service/R$menu.class
service/bin/classes/com/example/service/R$string.class
service/bin/classes/com/example/service/R$style.class
service/bin/classes/com/example/service/R.class
service/bin/classes.dex
service/bin/jarlist.cache
service/bin/res/
service/bin/res/drawable-hdpi/
service/bin/res/drawable-hdpi/ic_action_search.png
service/bin/res/drawable-hdpi/ic_launcher.png
service/bin/res/drawable-ldpi/
service/bin/res/drawable-ldpi/ic_launcher.png
service/bin/res/drawable-mdpi/
service/bin/res/drawable-mdpi/ic_action_search.png
service/bin/res/drawable-mdpi/ic_launcher.png
service/bin/res/drawable-xhdpi/
service/bin/res/drawable-xhdpi/ic_action_search.png
service/bin/res/drawable-xhdpi/ic_launcher.png
service/bin/resources.ap_
service/bin/service.apk
service/gen/
service/gen/com/
service/gen/com/example/
service/gen/com/example/service/
service/gen/com/example/service/BuildConfig.java
service/gen/com/example/service/R.java
service/ic_launcher-web.png
service/libs/
service/libs/android-support-v4.jar
service/proguard-project.txt
service/project.properties
service/res/
service/res/drawable-hdpi/
service/res/drawable-hdpi/ic_action_search.png
service/res/drawable-hdpi/ic_launcher.png
service/res/drawable-ldpi/
service/res/drawable-ldpi/ic_launcher.png
service/res/drawable-mdpi/
service/res/drawable-mdpi/ic_action_search.png
service/res/drawable-mdpi/ic_launcher.png
service/res/drawable-xhdpi/
service/res/drawable-xhdpi/ic_action_search.png
service/res/drawable-xhdpi/ic_launcher.png
service/res/layout/
service/res/layout/activity_main.xml
service/res/menu/
service/res/menu/activity_main.xml
service/res/values/
service/res/values/strings.xml
service/res/values/styles.xml
service/res/values-v11/
service/res/values-v11/styles.xml
service/res/values-v14/
service/res/values-v14/styles.xml
service/src/
service/src/com/
service/src/com/example/
service/src/com/example/service/
service/src/com/example/service/FisrtService.java
service/src/com/example/service/MainActivity.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.