邦邦熊官网升级的通知栏在哪?

一个APP下载升级的Demo通知栏实时更新下载进度一
APP下载升级,通知栏实时更新下载进度功能的说明:
& & 提供一个升级的按钮,当用户按下升级的按钮时,进入APP升级下载过程,这时通知栏显示下载进度,并且实时更新下载进度,当下载完成后,提示点击通知栏进行APP安装!下载的APP存放在SD卡的下载目录下(KonkaApplication).
图解APP下载升级过程:
& & & & & & & & & &&& & & && & & & &&
核心代码:
1.MainActivity.java
public class MainActivity extends Activity implements OnClickListener {
/*down APP name/
public static final String appName = &updateAppTest&;
/*down APP address*/
public static final String downUrl = &/data/wisegame/bd47bdf/shenmiaotaowang2.apk&;
private Button updateButton =
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
updateButton = (Button)findViewById(R.id.updateButton);
updateButton.setOnClickListener(this);
public void onClick(View view) {
// TODO Auto-generated method stub
if(view == updateButton){
/*update service*/
Intent intent = new Intent(this,UpdateService.class);
intent.putExtra(&Key_App_Name&,appName);
intent.putExtra(&Key_Down_Url&,downUrl);
startService(intent);
2.FileUtil.java
* 类描述:FileUtil
@author hexiaoming
public class FileUtil {
public static File updateDir =
public static File updateFile =
/*保存升级APK的目录*/
public static final String KonkaApplication = &konkaUpdateApplication&;
public static boolean isCreateFileS
* 方法描述:createFile方法
String app_name
* @see FileUtil
public static void createFile(String app_name) {
if (android.os.Environment.MEDIA_MOUNTED.equals(android.os.Environment.getExternalStorageState())) {
isCreateFileSucess =
updateDir = new File(Environment.getExternalStorageDirectory()+ &/& + KonkaApplication +&/&);
updateFile = new File(updateDir + &/& + app_name + &.apk&);
if (!updateDir.exists()) {
updateDir.mkdirs();
if (!updateFile.exists()) {
updateFile.createNewFile();
} catch (IOException e) {
isCreateFileSucess =
e.printStackTrace();
isCreateFileSucess =
3.UpdateService.java
* 升级服务
* @author hexiaoming
public class UpdateService extends Service {
public static final String Install_Apk = &Install_Apk&;
/download progress step*/
private static final int down_step_custom = 3;
private static final int TIMEOUT = 10 * 1000;// 超时
private static String down_
private static final int DOWN_OK = 1;
private static final int DOWN_ERROR = 0;
private String app_
private NotificationManager notificationM
private Notif
private Intent updateI
private PendingIntent pendingI
private RemoteViews contentV
public IBinder onBind(Intent arg0) {
* 方法描述:onStartCommand方法
Intent intent, int flags, int startId
UpdateService
public int onStartCommand(Intent intent, int flags, int startId) {
app_name = intent.getStringExtra(&Key_App_Name&);
down_url = intent.getStringExtra(&Key_Down_Url&);
// create file,应该在这个地方加一个返回值的判断SD卡是否准备好,文件是否创建成功,等等!
FileUtil.createFile(app_name);
if(FileUtil.isCreateFileSucess == true){
createNotification();
createThread();
Toast.makeText(this, R.string.insert_card, Toast.LENGTH_SHORT).show();
/*stop service/
stopSelf();
return super.onStartCommand(intent, flags, startId);
/* update UI/
private final Handler handler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case DOWN_OK:
/*下载完成,点击安装*/
Uri uri = Uri.fromFile(FileUtil.updateFile);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri,&application/vnd.android.package-archive&);
pendingIntent = PendingIntent.getActivity(UpdateService.this, 0, intent, 0);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(UpdateService.this,app_name, getString(R.string.down_sucess), pendingIntent);
//notification.setLatestEventInfo(UpdateService.this,app_name, app_name + getString(R.string.down_sucess), null);
notificationManager.notify(R.layout.notification_item, notification);
/*安装APK/
//installApk();
//stopService(updateIntent);
/*stop service*/
stopSelf();
case DOWN_ERROR:
notification.flags = Notification.FLAG_AUTO_CANCEL;
//notification.setLatestEventInfo(UpdateService.this,app_name, getString(R.string.down_fail), pendingIntent);
notification.setLatestEventInfo(UpdateService.this,app_name, getString(R.string.down_fail), null);
/*stop service*/
//onDestroy();
stopSelf();
//stopService(updateIntent);
/Stop service/
//stopService(intentname)
//stopSelf();
private void installApk() {
// TODO Auto-generated method stub
/*下载完成,点击安装*/
Uri uri = Uri.fromFile(FileUtil.updateFile);
Intent intent = new Intent(Intent.ACTION_VIEW);
/加这个属性是因为使用Context的startActivity方法的话,就需要开启一个新的task/
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(uri,&application/vnd.android.package-archive&);
UpdateService.this.startActivity(intent);
* 方法描述:createThread方法, 开线程下载
UpdateService
public void createThread() {
new DownLoadThread().start();
private class DownLoadThread extends Thread{
public void run() {
// TODO Auto-generated method stub
Message message = new Message();
long downloadSize = downloadUpdateFile(down_url,FileUtil.updateFile.toString());
if (downloadSize & 0) {
// down success
message.what = DOWN_OK;
handler.sendMessage(message);
} catch (Exception e) {
e.printStackTrace();
message.what = DOWN_ERROR;
handler.sendMessage(message);
* 方法描述:createNotification方法
UpdateService
public void createNotification() {
//notification = new Notification(R.drawable.dot_enable,app_name + getString(R.string.is_downing) ,System.currentTimeMillis());
notification = new Notification(
//R.drawable.video_player,//应用的图标
R.drawable.ic_launcher,//应用的图标
app_name + getString(R.string.is_downing),
System.currentTimeMillis());
notification.flags = Notification.FLAG_ONGOING_EVENT;
//notification.flags = Notification.FLAG_AUTO_CANCEL;
Notification 的显示/
contentView = new RemoteViews(getPackageName(),R.layout.notification_item);
contentView.setTextViewText(R.id.notificationTitle, app_name + getString(R.string.is_downing));
contentView.setTextViewText(R.id.notificationPercent, &0%&);
contentView.setProgressBar(R.id.notificationProgress, 100, 0, false);
notification.contentView = contentV
updateIntent = new Intent(this, AboutActivity.class);
updateIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//updateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
pendingIntent = PendingIntent.getActivity(this, 0, updateIntent, 0);
notification.contentIntent = pendingI
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(R.layout.notification_item, notification);
* down file
* @throws MalformedURLException
public long downloadUpdateFile(String down_url, String file)throws Exception {
int down_step = down_step_// 提示step
int totalS// 文件总大小
int downloadCount = 0;// 已经下载好的大小
int updateCount = 0;// 已经上传的文件大小
InputStream inputS
OutputStream outputS
URL url = new URL(down_url);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setConnectTimeout(TIMEOUT);
httpURLConnection.setReadTimeout(TIMEOUT);
// 获取下载文件的size
totalSize = httpURLConnection.getContentLength();
if (httpURLConnection.getResponseCode() == 404) {
throw new Exception(&fail!&);
//这个地方应该加一个下载失败的处理,但是,因为我们在外面加了一个try---catch,已经处理了Exception,
//所以不用处理
inputStream = httpURLConnection.getInputStream();
outputStream = new FileOutputStream(file, false);// 文件存在则覆盖掉
byte buffer[] = new byte[1024];
int readsize = 0;
while ((readsize = inputStream.read(buffer)) != -1) {
/*如果下载过程中出现错误,就弹出错误提示,并且把notificationManager取消*/
if (httpURLConnection.getResponseCode() == 404) {
notificationManager.cancel(R.layout.notification_item);
throw new Exception(&fail!&);
//这个地方应该加一个下载失败的处理,但是,因为我们在外面加了一个try---catch,已经处理了Exception,
//所以不用处理
outputStream.write(buffer, 0, readsize);
downloadCount +=// 时时获取下载到的大小
/* 每次增张3%/
if (updateCount == 0 || (downloadCount * 100 / totalSize - down_step) &= updateCount) {
updateCount += down_
// 改变通知栏
contentView.setTextViewText(R.id.notificationPercent,updateCount + &%&);
contentView.setProgressBar(R.id.notificationProgress, 100,updateCount, false);
notification.contentView = contentV
notificationManager.notify(R.layout.notification_item, notification);
if (httpURLConnection != null) {
httpURLConnection.disconnect();
inputStream.close();
outputStream.close();
return downloadC
源码下载地址:
http://download.csdn.net/detail/hfreeman
> 本站内容系网友提交或本网编辑转载,其目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请及时与本网联系,我们将在第一时间删除内容!
进入关于界面,点击检测新版本,如果发现服务器上的版本比本地应用的版本高,就弹出升级提示,用户选择升级,就进入APP下载,在通知栏显示当前下载进度,下载完成后,用户点击通知栏,就可以完成应用安装.
这部分升级功能,相对于&&一个APP下载升级的Demo(通知栏实时更新下载进度)------(一)&&来说, ...
下载文件会阻塞UI主线程,所以需要new一个新线程来执行下载操作,通过handler执行更新UI进度条操作.代码如下: public class AndroidTest extends Activity { private static final String TAG = &AndroidTest&; private ProgressB ...
大家好,我正在开发一下下载的功能,遇到了一些问题. 我使用的是 DownloadManager 执行下载,用 ContentObserver 来监控下载进度. 我遇到的问题是,离开了Activity ,再重新回来该Activity,我就失去了监控下载的进度. 我尝试过各种保存download Id ,但是就是无法让download 的状态和 Activity ...
ASIHttpRequset 遵守&ASIProgressDelegate&协议 @property (nonatomic, retain) ASIHTTPRequest * // 下载路径
self.request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: ...
22:40:57 上传 下载附件 (152.49 KB) 6.jpg (68.46 KB, 下载次数: 9) 5.jpg (66.22 KB, 下载次数: 7) 4.jpg (62.22 KB, 下载次数: 7) 2.jpg (152.11 KB, 下载次数: 11) 1.jpg (157.39 KB, 下载次数: 11) 什么是so ...
Android应用检查版本更新后,在通知栏下载,更新下载进度,下载完成自动安装,效果图如下: 检查当前版本号 AndroidManifest文件中的versionCode用来标识版本,在服务器放一个新版本的apk,versioncode大于当前版本,下面代码用来获取versioncode的值 PackageInfo packageInfo = context ...
Android应用检查版本更新后,在通知栏下载,更新下载进度,下载完成自动安装,效果图如下: 检查当前版本号 AndroidManifest文件中的versionCode用来标识版本,在服务器放一个新版本的apk,versioncode大于当前版本,下面代码用来获取versioncode的值 PackageInfo packageInfo = context ...
Android应用检查版本更新后,在通知栏下载,更新下载进度,下载完成自动安装.接下来通过本文给大家介绍Android程序版本更新之通知栏更新下载安装的相关知识,需要的朋友参考下吧Android应用检查版本更新后,在通知栏下载,更新下载进度,下载完成自动安装,效果图如下: o检查当前版本号 AndroidManifest文件中的versionCode用来标识 ...24小时客服热线400-
邦邦熊行业动态&&&News
最新资讯&&&New
联系我们&&&Contact
地址:福建省厦门市湖里区火炬路56-58号火炬广场北5楼
电话: 400-
搜索&&&Search
你的位置: >
?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]?[]
总数:28条&&当前页数:1/2&&上一页&&
Copyright 2012
版权所有 All Rights Reserved
公司地址:福建省厦门市湖里区火炬路56-58号火炬广场北5楼 联系电话: 电子邮件:s
售前QQ客服
售后QQ客服
售前旺旺客服企业邮局升级通知
尊敬的客户:   您好!   非常感谢您一直以来对35互联的支持与信任!   35互联新一代垃圾过滤模式,其采用的64位智能垃圾过滤系统,在反垃圾功能方面有很大的飞跃,无需用户再进行手工培训。为了让广大邮局用户远离垃圾邮件的干扰,体验64位邮件系统的超强过滤功能,我司将于<font color="#ff-10-27 时间:18:00 至 20:00对您正在使用的企业邮局进行全面的平滑升级。 升级后的邮件系统因使用了特殊的垃圾邮件处理方式将会提高邮件系统的处理速度及系统的稳定性。此次将分别对<font color="#ff2.50.67、211.152.50.211 、218.85.134.175上的用户进行升级,其它服务器上的用户也将陆续进行升级,敬请继续关注!   升级前/后邮件收发服务器正确的设置如下,为了不影响您在客户端软件(如Outlook/Foxmail)上的正常使用,请重新校对, 以域名
为范例: &   web 登陆邮箱:
  接收邮件服务器(pop3):   发送邮件服务器(smtp):
&& 1、<font color="#ff2.50.67邮件系统与邮件解析相关的配置:
  mail    A    211.152.50.67   smtp    A    211.152.50.67   pop    A    211.152.50.67   mx     A    211.152.50.227         MX    .    优先级:10 && 2、<font color="#ff2.50.211邮件系统与邮件解析相关的配置:
  mail    A    211.152.50.211   smtp    A    211.152.50.211   pop    A    211.152.50.211   mx     A    211.152.50.227         MX    .    优先级:10 && 3、<font color="#ff.134.175邮件系统与邮件解析相关的配置:
  mail    A    218.85.134.175   smtp    A    218.85.134.175   pop    A    218.85.134.175   mx     A    218.85.134.170         MX    .    优先级:10
  若域名DNS为我司的,我们将自动为您进行解析变更。如域名DNS为其他服务商,请您参考如上范本于<font color="#ff-10-27 20:00以后修正解析,<font color="#ff-11-03 18:00后我们将不保证配置不对的用户可接收到邮件。   若您在使用过程中,有任何问题及建议,欢迎随时与我们联系。(联系方式请参阅:)
  再次感谢您的积极配合!
                             35互联客户服务中心
                              日
分公司链接您的位置: &
紧急通知网站升级 正文
紧急通知网站升级
篇一:网页升级紧急通知 紧急页面升级通知 为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请全校精品课程以及精品课程建设立项项目的课程负责人尽快组织课程组成员做好由旧平台向新平台的数据迁移和更新工作,具体事项通知如下: 1、新的网络教学平台已于上学期投入使用,教师可以用学校的锐捷账号从以下网址进行登录http://资料站.资料站.cn/,进入页面后点击左下角&快速通道&里的&资料站教室&,直接进入新网络教学平台。 2、因现在旧平台无法直接访问,如需要旧网络教学平台中以前上传的课程资料,请从新平台首页进入《新网络教学平台培训课程》下的&课件与教案&,下载&旧平台数据下载ppt&,参照ppt里的步骤安装软件,下载课程资料(如有技术问题,请联系教务处教学科,以便帮助解决,联系电话6资料站679)。
3、新平台使用的培训录像和培训ppt已经挂在新平台的《新网络教学平台培训课程》下,在&课件与教案&下可以下载(包括录像和ppt),以供老师学习制作技巧。
4、因旧网络课堂已运行多年,其上的资料可能为较早前上传的旧资料,全校精品课程以及精品课程建设立项项目的课程负责人应组织课程组成员对原有课程资料进行更新,并上传到新网络教学平台。
5、请各课程组于x月xx日前做好迁移和更新工作,教务处将组织专家对精品课程以及精品课程建设立项项目的资料迁移和更新工作进行检查、评定,并作为以后转型升级为精品资源共享课的依据。
6、其他课程(非精品课程以及精品课程建设立项项目)可参照以上进行数据的迁移和更新。
教务处篇二:网站更新公告
告 感谢您一直关注学院网站。为更好、更全面地展示学院的发展建设成果,学院网站即日起改版升级。调试期间部分网站数据滞后、陈旧信息处于更新状态,给您的查询和阅读带来不便,敬请谅解! 特此公告
Xxxxxx学院 二一二年三月二十九日
:由于网站系统升级,正在更新中,请稍后访问,谢谢您的支持对 由于我院原网站内容陈旧、功能不全,不能满足广大学员的需求,应广大学员和朋友们的建议,现对原网站内容及功能格式进行系统更新。原网站中的内容及各项通知以现有网站内容为准 为了能为广大客户提供更优质的服务,“名信”网站正在调整和升级,届时将以全新的姿态与大家见面。敬请关注。
为此给您带来的不便,请见谅,在此感谢大家以来对名信的支持。篇三:关于宿舍网网络升级改造的通知附件1
附件1: 一、运营商账号绑定流程 1.打开浏览器,在浏览器地址栏内输入,进入自服务界面:
2.输入账号和密码,账号为个人学号,密码为个人身份证后6位。(示例如下) 点击登录进入个人自服务界面:
3.点击右侧“业务办理”模块中的“绑定运营商账号”,进入绑定账号界面:4.根据自己购买的运营商账号,在相应的表格中填入。如购买移动账号,则在移动那一栏填写:(运营商密码如果不记得,可拨打各运营商售后密码重置)
5.填写无误后,点击“提交”,账号绑定完成:
二、拨号上网 宿舍网割接后将无法通过运营商账号直接拨号网,届时个人将使用“学号+域名”作为账号来进行拨号。(如移动用户:@cmcc,电信:@telecom,联通:@Unicom)相关拨号流程如下所示: Windows XP创建宽带连接: 1、 打开桌面上的“网络邻居”,点击“查看网络连接”。
2、点击“创建一个新的连接”。3、点击下一步
2、选中第一个“连接到Internet”,点击下一步。
网页升级紧急通知紧急页面升级通知为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请...
网页升级紧急通知紧急页面升级通知为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请...
网页升级紧急通知紧急页面升级通知为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请...
网页升级紧急通知紧急页面升级通知为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请...
网页升级紧急通知紧急页面升级通知为进一步加强我校课程建设工作,丰富我校优秀的网络教学资源,充分发挥网络教学平台的辅助作用,推进原有精品课程向精品资源共享课转型升级,请...
声明:该文章系网友上传分享,此内容仅代表网友个人经验或观点,不代表本网站立场和观点;若未进行
原创声明,则表明该文章系转载自互联网;若该文章内容涉嫌侵权,请及时向蚂蚁网投诉!
推荐范文百科

我要回帖

更多关于 邦邦熊儿童定位手表 的文章

 

随机推荐