- 浏览: 172383 次
- 性别:
- 来自: 深圳
-
最新评论
-
solomon0104:
sraining 写道瞎扯,,自己试验一下,垃圾
Android 注册广播的两种方式区别 -
org_zhanghua:
为什么我这边上传成功后,提示下载json请指导一下:http: ...
spring mvc ajaxfileupload上传文件 -
zhongzixing:
你好,由于公司网络需要设置代理,并且需要用户和密码才能上网。我 ...
android SDK安装出现Failed to fetch URL http://dl-ssl.google.com/android/repository/a -
kuanye345:
博主 给个demo 啊
使用百度地图画轨迹 -
dou_yer:
有没有源码可以提供啊。。谢谢。
带进度条的通知栏
文章列表
如果你还为出门坐车而发难吗?如果回家还要去火车站查询车次和价位烦恼吗?如果你手上有部android手机,那么就不必发难了,你可以下载这款出行通,帮你解决问题。
出行通是针对出门坐火车,公交车查询,查看天气,位置,日期的一款android上的应用程序,目前最新版本1.0
其主要功能有: 1.全国公交查询,公交线路查询,公交始站至终点站查询。并给出相应的方案,并在地图上显示全程公交路线。 2.全国列车查询,可以通过车次查询,到站终点站查询,站台查询。 3.地图定位功能,可以进行定位到自己所在位置,查看周边。 4.日历,提供农历以及24节气的一款万年历。 5.天气预报 ...
这里主要实现了。省份和城市的二级关联。选择省份。二级对应的就是省份所有的城市
下面看代码;
1.activity
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.test_layout); ...
百度地图画轨迹连接线。
package com.life.hua.activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Point;
import android.os.Bun ...
关于spinner 在一个activity 使用了tabactivity 出现 (unable to add window)无法添加到窗体
最近发现直接setcontentview(layout);是不行的。必须要从父窗体加载你的那个子窗体才不会出现添加不了窗体
再看看spinner 会谭出一个dropdown item的选项卡。因为弹出是从最开始的view作为父窗体。
解决方法:
setContentView(“your layout");
改成
View contentView = LayoutInflater.from(this.getParent()).inflate( ...
今天安装sdk2.2发现没更新到google apis。想下这不就创建不了带地图的SDK了吗。在网上查了看到解决方法
把需要的Google apis 相应的API 都下载来。
http://dl-ssl.google.com/android/repository/google_apis-3-r03.zip
http://dl-ssl.google.com/android/repository/google_apis-4_r02.zip
http://dl-ssl.google.com/android/repository/google_apis-5_r01.zip
http://dl-ssl.g ...
查找全部多媒体文件。
public ArrayList<Map<String, String>> getData(){
ArrayList<Map<String, String>> data = new ArrayList<Map<String, String>>();
ContentResolver cr =mContext.getContentResolver();
Uri audio_uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Str ...
之前听说gallery做图片浏览很不错。最近也听到一朋友要做这个,听他说要改gallery源码,我想应该不用那么复杂吧。
游览图片就是点击图片放大,看代码吧。
package com.hua.com;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import ...
1.首先要得到你的debug keystore位置:
打开Eclipse--->Windows--->Preferences--->Android--->Build
查看默认的debug keystore位置,例如:C:Documents and Settings(你电脑的名字).androiddebug.keystore
2.在cmd中执行: (可以先定位到jdk的bin目录下)
#:keytool -list -alias androiddebugkey - keystore " C:Documents and Setti ...
1.使用googleMap 项目必须使用google APIS
2.必须申请key
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.map);
mapView = (MapView)findViewById(R.id.map);
// 设置显示模式
// mapView.setTraffic(true);
mapView.setSatellite(true);//是否卫星模式
ma ...
vibrator是android提供的震动类,获得vibrator方法很简单直接getSystemService(Context.VIBRATOR_SERVICE)
然后直接调用vibrate(long[] pattern, int repeat)这个方法,第一个参数long[] pattern是一个节奏数组,比如{1, 200},
而第二个参数是重复次数,-1为不重复,而数字直接表示的是具体的数字,和一般-1表示无限不同.
触摸事件,当手触摸屏幕时震动。
@Override
public boolean onTouchEvent(MotionEvent event) { ...
简单容易的UDP消息发送和接受;UDP是user datagram protocol的简称 户数据包协议,
是 OSI 参考模型中一种无连接的传输层协议,提供面向事务的简单不可靠信息传送服务。
接下来看代码
server:
public void sendMsg(){
int port = 8080;
String host = "192.168.1.129";
int length=1500;
try {
System.out.println(InetAddress.getByName("localhost" ...
所谓socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄。应用程序通常通过"套接字"向网络发出请求或者应答网络请求。
getInputStream方法获得网络连接输入,同时返回一个IutputStream对象实例
getOutputStream方法连接的另一端将得到输入,同时返回一个OutputStream对象实例
建立server端的socket监听是否有请求过来
public static void doListener() {
ServerSocket serverSocket = null;
int p ...
有些时候需要做类似于电话,短信未读情况,显示在屏幕上方时。就要用到notificationManager通知。
下面有个列子:
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon,
"收到任务", System.currentTimeMillis());
//通知内容 ...
安装完SDK和ADT时貌似出现些问题。
Description Resource Path Location Type
Error executing aapt. Please check aapt is present at C:\Program Files\android-sdk-windows\platform-tools\aapt.exe BeiJingPoliceLB line 1 Android ADT Problem
解决方法:
1、Eclipse—>Window—>Android SDK And AVD Manager(或者直接在Android解压目录底下运行SDK ...