摘要: 简单说,IntentService是继承于Service并处理异步请求的一个类,在IntentService内有一个工作线程来处理耗时操作,启动IntentService的方式和启动传统Service一样,同时,当任务执行完后,IntentService会自动停止,而不需要我们去手动控制。另外,可以... 阅读全文
posted @ 2014-10-21 15:54 魏滋珑 阅读(2186) 评论(3) 推荐(2) 编辑

摘要: 1、开始->运行(windos+r)中敲cmd,DOS界面2、cd到tomcat的bin目录下3、运行命令service.bat install 这里可以指定注册服务的名字,然后就可以把tomcat注册成系统服务了。4、然后去服务里面修改,设置成开机自动启动5、删除服务运行 service.bat uninstall+你的服务名字 阅读全文
posted @ 2013-09-24 10:13 魏滋珑 阅读(600) 评论(0) 推荐(0) 编辑

摘要: 方法一: 1、tabcontent和tabs交换位置 2、tabcontent的android:layout_weight="1" 方法二: 1、tabcontent和tabs交换位置 2、将tabcontent放到一个relativeLayout中,然后加上这句android:layout_alignParentBottom="true" 阅读全文
posted @ 2013-08-30 17:12 魏滋珑 阅读(1027) 评论(0) 推荐(2) 编辑

摘要: 1、SQLiteDataBase对象的query()接口:public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having,String orderBy,String limit)Query the given table, returning a Cursor over the result set.Parameterstable The ta... 阅读全文
posted @ 2013-08-28 15:14 魏滋珑 阅读(1459) 评论(0) 推荐(1) 编辑

摘要: 安卓客户端通过socket与服务器端通讯一般可以按照以下几个步骤:(1).通过IP地址和端口实例化Socket,请求连接服务器:socket = new Socket(HOST, PORT); //host:为服务器的IP地址 port:为服务器的端口号(2).获取Socket流以进行读写,并把流包装进BufferWriter或者PrintWriter:PrintWriter out = new PrintWriter( new BufferedWriter( new OutputS... 阅读全文
posted @ 2013-08-27 15:47 魏滋珑 阅读(985) 评论(2) 推荐(1) 编辑

摘要: 1、Android判断是Pad或者手机 public boolean isTabletDevice() { TelephonyManager telephony = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); int type = telephony.getPhoneType(); if (type == TelephonyManager.PHONE_TYPE_NONE) { ... 阅读全文
posted @ 2013-08-23 08:49 魏滋珑 阅读(592) 评论(3) 推荐(0) 编辑

摘要: 大家都知道 Android 的 Activity 是存着历史栈的,比如从 A -> B -> C,C 完成 finish 后回到 B,把所有的Activity 都 finish了,程序就自然退出了。 当然在 finish 的同时也需要是否自己程序的其他资源。所以需要想个办法把 Activity 给存起来。然后在程序退出的地方调用它们的 finish()方法。使用全局变量。对了,第一个想到的就是继承 Application,代码入下: public class AgentApplication extends Application { private List ac... 阅读全文
posted @ 2013-08-19 14:37 魏滋珑 阅读(2000) 评论(4) 推荐(3) 编辑

摘要: 1,调web浏览器Uri myBlogUri = Uri.parse("http://xxxxx.com");returnIt = new Intent(Intent.ACTION_VIEW, myBlogUri);2,地图Uri mapUri = Uri.parse("geo:38.899533,-77.036476");returnIt = new Intent(Intent.ACTION_VIEW, mapUri);3,调拨打电话界面Uri telUri = Uri.parse("tel:100861");returnIt = 阅读全文
posted @ 2013-08-15 15:08 魏滋珑 阅读(423) 评论(0) 推荐(1) 编辑
 
摘要: 1、SQLiteDataBase对象的query()接口:public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having,String orderBy,String limit)Query the given table, returning a Cursor over the result set.Parameterstable The ta... 阅读全文
posted @ 2013-08-15 14:13 魏滋珑 阅读(501) 评论(0) 推荐(0) 编辑
 
摘要: 1 package com.iteye.androidtoast; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import android.app.Activity; 7 import android.content.Intent; 8 import android.os.Bundle; 9 import android.view.View; 10 import android.view.View.OnClickListener; 11 import android.widget.Arr... 阅读全文
posted @ 2013-08-15 11:18 魏滋珑 阅读(736) 评论(2) 推荐(1) 编辑

2014年3月6日

摘要: servie是系统的组件,它由系统进程托管(servicemanager);它们之间的通信类似于client和server,是一种轻量级的ipc通信,这种通信的载体是binder,它是在linux层交换信息的一种ipc。而thread是由本应用程序托管。1). Thread:Thread 是程序执行的最小单元,它是分配CPU的基本单位。可以用 Thread 来执行一些异步的操作。2). Service:Service 是android的一种机制,当它运行的时候如果是Local Service,那么对应的 Service 是运行在主进程的 main 线程上的。如:onCreate,onStart 阅读全文
posted @ 2014-03-06 11:24 魏滋珑 阅读(432) 评论(1) 推荐(1) 编辑

2013年8月27日

摘要: 一、 SQLite介绍 SQLite是android内置的一个很小的关系型数据库。SQLite的官网是http://www.sqlite.org/,可以去下载一些文档或相关信息。博客中有一篇有稍微详细一点的介绍,大家可以去看一下。二、 SQLiteOpenHelper的使用方法SQLiteOpenHelper是一个辅助类来管理数据库的创建和版本。可以通过继承这个类,实现它的一些方法来对数据库进行一些操作。所有继承了这个类的类都必须实现下面这样的一个构造方法:public DatabaseHelper(Context context, String name, CursorFactory fac 阅读全文
posted @ 2013-08-27 17:56 魏滋珑 阅读(6352) 评论(0) 推荐(1) 编辑

2013年8月19日

摘要: What is Application Application和Activity,Service一样是android框架的一个系统组件,当android程序启动时系统会创建一个 application对象,用来存储系统的一些信息。通常我们是不需要指定一个Application的,这时系统会自动帮我们创建,如果需要创建自己 的Application,也很简单创建一个类继承 Application并在manifest的application标签中进行注册(只需要给Application标签增加个name属性把自己的 Application的名字定入即可)。 android系统会为每个程序运行时.. 阅读全文
posted @ 2013-08-19 09:13 魏滋珑 阅读(233) 评论(0) 推荐(0) 编辑