随笔分类 -  Android_Mars学习笔记

摘要:一、简介 1.在main.xml中用TabHost、TabWidget、FrameLayout标签作布局 2.在MainActivity中生成TabHost、TabSpec,调用setIndicator()、setContent()、addTab(),用Intent指明要跳转的tab对应的class 阅读全文
posted @ 2016-02-17 18:11 shamgod 阅读(227) 评论(0) 推荐(0)
摘要:一、简介 1.在onListItemClick()中new Intent,Intent以存储序列化后的mp2Info对象作为参数,启动serivce 2.DownloadService在onStartCommand()中通过intent 获取mp3info,开启新线程,利用HttpDownloade 阅读全文
posted @ 2016-02-17 15:38 shamgod 阅读(309) 评论(0) 推荐(0)
摘要:一、项目设计 二、歌曲列表简介 1.利用java.net.HttpURLConnection以流的形式下载xml文件为String 2.自定义ContentHandler--》Mp3ListContentHandler 3.利用自定义的ContentHandler和javax.xml.parsers 阅读全文
posted @ 2016-02-17 10:26 shamgod 阅读(266) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)activity_main.xml 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/t 阅读全文
posted @ 2016-02-16 18:00 shamgod 阅读(337) 评论(0) 推荐(0)
摘要:一、代码 1.xml(1)activity_main.xml 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/ 阅读全文
posted @ 2016-02-16 17:57 shamgod 阅读(201) 评论(0) 推荐(0)
摘要:一、流程 1.编写service,重写onBind(Intent intent),返回自定义的Binder 2.自写义Binder,提供一个可访问的方法,以传递数据 3.点击界面按钮会开启service,过程为,通过Intent的setClass指定要开启的service,再通过bindServic 阅读全文
posted @ 2016-02-16 16:52 shamgod 阅读(216) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-16 16:49 shamgod 阅读(189) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-16 13:02 shamgod 阅读(231) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-16 11:15 shamgod 阅读(164) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-15 23:01 shamgod 阅读(195) 评论(0) 推荐(0)
摘要:一、简介 二、代码1.xml(1)activity_main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 阅读全文
posted @ 2016-02-15 22:09 shamgod 阅读(199) 评论(0) 推荐(0)
摘要:一、代码 1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:or 阅读全文
posted @ 2016-02-15 18:53 shamgod 阅读(159) 评论(0) 推荐(0)
摘要:一、简介 一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 androi 阅读全文
posted @ 2016-02-14 23:39 shamgod 阅读(210) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-14 15:56 shamgod 阅读(188) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)activity_main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 an 阅读全文
posted @ 2016-02-14 13:51 shamgod 阅读(254) 评论(0) 推荐(0)
摘要:一、流程 1.自定义Handler,重写handleMessage(Message msg),用msg得到bundle,从而得到传递过来的数据 2.开启android.os.HandlerThread,获取looper,据此为参数new一个自定义的Handler 3.以new出来的自定义的Handl 阅读全文
posted @ 2016-02-13 21:35 shamgod 阅读(194) 评论(0) 推荐(0)
摘要:一、流程 1.点击按钮,则代码会使handler把updateThread压到队列里去,从而执行updateThread的run() 2.run()里会通过msg.arg1 = i 和bundle来写参,通过执行updateBarHandler.sendMessage(msg)把消息压入消息队列,会 阅读全文
posted @ 2016-02-13 18:36 shamgod 阅读(216) 评论(0) 推荐(0)
摘要:一、运行结果 一、代码1.xml(1)activity_main.xml 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.androi 阅读全文
posted @ 2016-02-13 18:10 shamgod 阅读(259) 评论(0) 推荐(0)
摘要:一、代码1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:ori 阅读全文
posted @ 2016-02-13 16:59 shamgod 阅读(214) 评论(0) 推荐(0)
摘要:一、代码 1.xml(1)main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:or 阅读全文
posted @ 2016-02-13 16:57 shamgod 阅读(174) 评论(0) 推荐(0)

haha