- 浏览: 278507 次
- 性别:
- 来自: 上海
最新评论
-
flyingsnowff:
支付宝官方在线文档中心:https://doc.open.al ...
如何集成支付宝官方文档 -
timer_yin:
果然是这样
[转帖] 安装Eclipse插件长时间卡在 calculating requirements and dependencies -
dai_lm:
lyx0224 写道强~~~~~过奖,只是总结了前人的智慧,拼 ...
通过Wifi实现设备间的通信 -
lyx0224:
强~~~~~
通过Wifi实现设备间的通信 -
Goro:
帅!
自己封装的支持自动对焦的CameraView
文章列表
用handler就可以了
private Handler handler = new Handler();
private Runnable runnable = new Runnable() {
public void run() {
update();
handler.postDelayed(this, 5000);
}
};
开始计时
handler.removeCallbacks(runnable);
handler.postDelayed(runnable, 5000);
停止计时
handler.removeCallbacks(ru ...
自定义类的equals函数
- 博客分类:
- Java
仅作笔记使用
public class VectorQueue {
private final Vector<VectorItem> queue;
private class VectorItem {
private final Object item;
private final int quantity;
public VectorItem(Object item, Integer quantity) {
this.item = item;
this.quantity = quantity;
}
@Over ...
可以选择用耳机还是扬声器播放(蓝牙的就留到下次吧),要求SDK不小于5
public class MainActivity extends Activity implements OnClickListener {
private AudioManager mAudioManager;
private MediaPlayer mMediaPlayer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setCont ...
1. 声明对象(调用无参的构造函数)
Class<?> clz = Class.forName("package.ClassName");
Object obj = clz.newInstance();
2. 声明方法
Class<?> clz = Class.forName("package.ClassName");
Method method1 = clz.getMethod("method_without_parameter");
method1.invoke(obj);
Met ...
由于无法设置FrameLayout的Gravity,所以只能通过重写onLayout事件实现居中的效果了
@Override
protected void onLayout(boolean changed, int left, int top, int right,
int bottom) {
super.onLayout(changed, left, top, right, bottom);
// align child to center
int width = right - left;
int height = bottom - top;
fi ...
在Android上模拟WP7的MetroUI
MetroItem
import android.view.View;
public class MetroItem {
private View mMetroView = null;
private int mRow = 0;
private int mRowSpan = 1;
private int mCol = 0;
private int mColSpan = 1;
/**
* @param v
* @param row
* @param col
*/
publi ...
public static Date getGreenwichTime(Date date)
{
TimeZone tzGreenwich = TimeZone.getTimeZone(TIME_ZONE_GREENWICH);
// convert time to Greenwich
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(date.getTime() - tzGreenwich.getOffset(date.getTime()));
return cal.getTime();
...
原文地址:http://qyiyunso.blog.163.com/blog/static/35077686201111101851181/
把"Contact all update sites during install to find required software"前面的勾去掉,然后点击下一步,这样之后问题迎刃而解了。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace Uri
{
class Builder
{
private string scheme = "http";
private string host = "";
private StringBuilder path;
pri ...
设置代理
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:port
删除代理
git config --system (or --global or --local) --unset http.proxy
关闭SSL验证
git config --global http.sslVerify false
下载代码
git clone http://server.com/source.git
提交本地branch至remote
git push <remote ...
Uri.Builder与String互转
- 博客分类:
- Android
Uri.Builder -> String
Uri.Builder builder = new Uri.Builder();
builder.encodedPath("http://xxx.xxx.xxx.xxx:xxxx");
builder.appendEncodedPath("xxx/xxx/xxx");
builder.appendQueryParameter("key", "value");
String url = builder.toString();
String -> ...
// support from API 4
final int screenSize = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
switch (screenSize) {
case Configuration.SCREENLAYOUT_SIZE_SMALL:
break;
case Configuration.SCREENLAYOUT_SIZE_NORMAL:
break;
case Configuration.SCR ...
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Date;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import ...
ADT 离线包下载地址
- 博客分类:
- Android
更新ADT真是件苦恼的事啊
20.0.0的下载地址
http://dl.google.com/android/ADT-20.0.0.zip
更新到21.0.0了,同理
http://dl.google.com/android/ADT-21.0.0.zip
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Web.Script.Serialization;
namespace SocketServer
{
public class SocketHost
{
private ...