文件名称:android_service

  • 所属分类:
  • android开发
  • 资源属性:
  • [Android] [Java] [源码]
  • 上传时间:
  • 2012-11-26
  • 文件大小:
  • 942kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • wu***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

本次实验主要是学习怎样在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
(系统自动生成,下载前可以参看下载内容)

下载文件列表

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

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org