732003684

导航

上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页

2013年3月13日 #

Gson解析json数据

摘要: 1.从服务端获取的json数据,经由gson反序列化后,ui显示出来public void getJsonData() { JsonDataGetApi api = new JsonDataGetApi(); JSONArray jArr; JSONObject jobj; try { //调用GetAccountData方法 jArr = api.getArray("GetAccountData"); //从返回的Account Array中取出第一个数据 ... 阅读全文

posted @ 2013-03-13 11:31 732003684 阅读(3262) 评论(0) 推荐(0) 编辑

2013年3月12日 #

service broadcast更新activity界面

摘要: package com.ct.dynamicui;import android.os.Bundle;import android.app.Activity;import android.content.Intent;import android.content.IntentFilter;import android.graphics.Color;import android.view.Menu;import android.widget.TextView;public class MainActivity extends Activity { public static String T... 阅读全文

posted @ 2013-03-12 17:51 732003684 阅读(2663) 评论(0) 推荐(0) 编辑

broadcast 和 service的简单结合使用

摘要: package com.ct.mytestsab;import com.ct.mytestsab.MyService.ServiceBinder;import android.os.Bundle;import android.os.IBinder;import android.app.Activity;import android.content.ComponentName;import android.content.Intent;import android.content.ServiceConnection;import android.view.Menu;public class Ma 阅读全文

posted @ 2013-03-12 17:21 732003684 阅读(875) 评论(0) 推荐(0) 编辑

broadcast------->基础

摘要: 1、注册2、怎么动作3、怎么发送4、由啥接收条件5、应用例子注册:1、动态注册随activity的销毁而销毁2、静态注册(在manifest.xml)中注册,注册到系统中,不会随activity的销毁而销毁动作:1.系统给的2、自定义的 “包名”+“.”+"动作描述"发送:sendbroadcast(intent)接收:由满足动作的activity接收应用例子:电量计等package com.ct.mytestbroad;import android.os.Bundle;import android.app.Activity;import android.content.I 阅读全文

posted @ 2013-03-12 16:31 732003684 阅读(180) 评论(0) 推荐(0) 编辑

service之startService()--->音乐播放器的例子

摘要: /** * MusicService.java * com.androidtest.service * * Function: TODO * * ver date author * ────────────────────────────────── * 2011-5-15 Leon * * Copyright (c) 2011, TNT All Rights Reserved.*/package com.zuiniuwang.service;import java.io.Serializable;import an... 阅读全文

posted @ 2013-03-12 15:54 732003684 阅读(944) 评论(0) 推荐(0) 编辑

service--->开启线程

摘要: package com.ct.helloservice;import android.app.Service;import android.content.Intent;import android.os.Handler;import android.os.HandlerThread;import android.os.IBinder;import android.os.Looper;import android.os.Message;import android.widget.Toast;public class HelloService extends Service { pri... 阅读全文

posted @ 2013-03-12 14:35 732003684 阅读(2222) 评论(0) 推荐(0) 编辑

service

摘要: http://blog.csdn.net/nkmnkm/article/details/7343373 阅读全文

posted @ 2013-03-12 14:11 732003684 阅读(100) 评论(0) 推荐(0) 编辑

Android bound service 详解二:派生Binder类

摘要: 如果你的service仅被自己的应用使用并且不需跨进程工作,那么你可以实现你自己的Binder类使得你的客户端能直接使用service的公开接口方法.注:这只在客户端和service位于同一应用和同一进程中时才能工作,其实大多数都是这种情况.例如,在一个音乐应用需要把它的activity绑定到它自己的播放音乐的后台service时,这种方式就会很好地工作.下面是如何建立它:在你的service中,创建一个Binder实例,提供以下三种功能之一:Binder包含一些可供客户端调用的公开方法.返回当前的Service实例,它具有一些客户端可以调用的公开方法.或者,返回另一个类的实例,这个类具有客户 阅读全文

posted @ 2013-03-12 11:37 732003684 阅读(210) 评论(0) 推荐(0) 编辑

Android bound service 详解一:基础

摘要: 概述 绑定的service是在一个客户端-服务端接口中的服务.绑定的ervice允许组件(比如activities)绑定到service,发送请求,接收回应,甚至执行进程间通讯(IPC).绑定的service一般只生存于为其它应用组件服务其间并且不会永远行于后台. 本文档向你展示了如何创建一个绑定的service,包括如何从其它应用组件绑定到service.然而,你应该也去参考Service的文档来学习更多通用知识,比如如何从servcie发出通知,如何设置service为前台运行,等等.绑定到一个"运行的"Service 如同在Service文档中所述,你可以创建一个既是"运行的"又是... 阅读全文

posted @ 2013-03-12 11:14 732003684 阅读(208) 评论(0) 推荐(0) 编辑

五大组件之activity(4)----------保存activity的状态的更多事项

摘要: 处理系统配置变化很多设备可以在运行时改变系统配置,比如屏幕方向,键盘布局以及语言等。当类似的变化发生时,系统会把运行的activity重启(调用onDestroy(),然后调用onStart(),――哦~,没有调用onRestart()),如果你的activity能跟据这些变化做出相应的处理,那么你的程序将更稳定可爱。那么如何应付这些变化呢,最好的办法就是写好状态保存/恢复方法们。比如onSaveInstanceState(),onRestoreInstanceState()/onCreate()。对于系统配置改变的详细信息以及基体应对方法,请观“处理运行时配置变化”一节。协调activity 阅读全文

posted @ 2013-03-12 11:09 732003684 阅读(128) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 18 下一页