随笔分类 -  Android

Activity 跳转动画 全局定义
摘要:定义application 的theme 定义style 动画slide_left_enter -->slide_left_exit -->slide_right_enter ... 阅读全文
posted @ 2015-12-29 17:27 QZB 阅读(293) 评论(0) 推荐(0)
Android Calander Event
摘要:必须权限 Calendar Event Url private static String calanderURL = ""; private static String calanderEventURL = ""; private static String calanderRemi... 阅读全文
posted @ 2015-07-21 14:21 QZB 阅读(403) 评论(0) 推荐(0)
Google Maps Android API v2
摘要:1.找到你的debug.keystore文件在Eclipse工具下,选择windows-->Preference-->Android-->Build,其中Default debug keystore的值便是debug.keystore的路径了。2.获取 机器的MD5和SHA1的值cmd cd sdk路径\toolskeytool -exportcert -alias androiddebugkey -keystore "debug.keystore的路径" -list -v -storepass android -keypass androidMD5:12 阅读全文
posted @ 2013-01-04 16:01 QZB 阅读(219) 评论(0) 推荐(0)
根据一个Activity字符串名字获得Acitivity的Class对象
摘要:className=包名+Class名称 Intent intent = new Intent(); intent.setClass(mContext, Class.forName(className)); startActivity(intent); 阅读全文
posted @ 2012-05-15 10:41 QZB 阅读(1449) 评论(0) 推荐(0)
android 退出程序
摘要:1:android.os.Process.killProcess(android.os.Process.myPid());finish();System.exit(0);2:Intent intent=new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_HOME);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);System.exit(0);PS:使用第二种方式退出 会出现本来下载到sdcard的html文件自动删除,没有搞清 阅读全文
posted @ 2012-04-25 15:21 QZB 阅读(197) 评论(0) 推荐(0)
android 获取md5值 google map key申请
摘要:找到.android文件夹,如:C:\Documents and Settings\biao\.android新建文件cmd.bat,文件内容:cmd,保存。双击打开cmd.bat文件.输入:keytool -v -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android确认即可得到结果,复制你的MD5值。到 http://code.google.com/intl/pl/android/maps-api-signup.html 获取你key值即可。 阅读全文
posted @ 2012-04-18 09:02 QZB 阅读(515) 评论(0) 推荐(0)
Android 如何在代码中将PX转换成DIP
摘要://px转换成dip public int dip2px(Context context, float dipValue){ final float scale = context.getResources().getDisplayMetrics().density; return (int)(dipValue * scale + 0.5f); } 下面是如何调用:a1.setPadding(a1.getPaddingLeft()+this.dip2px(this, 5... 阅读全文
posted @ 2011-10-09 11:40 QZB 阅读(577) 评论(0) 推荐(1)
获取时间并替换到String.xml 中
摘要:调用System.currentTimeMillis()获得当前时间SimpleDateFormat format=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");Date date=new Date(System.currentTimeMillis());Log.i("myDebug", ""+date);Log.i("myDebug", ""+format.format(date));/*打印结果: * Thu Sep 15 10:22:27 GMT 阅读全文
posted @ 2011-09-15 10:40 QZB 阅读(445) 评论(0) 推荐(0)
android GestureDetector 手势的判断
摘要:import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.GestureDetector;import android.view.GestureDetector.OnGestureListener;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.TextView;impo 阅读全文
posted @ 2011-09-02 15:42 QZB 阅读(3445) 评论(0) 推荐(0)
android 通过Google Weather Api 获取天气预报
摘要:获取天气的链接地址根据经纬度获取:http://www.google.com/ig/api?weather=,,,31174165,121433841【如中山的经纬度是:22.516997123628076,113.39263916015625 必须都乘以1000000才能作为参数】int a=(int)22.516997123628076*1000000;int b=(int)113.39263916015625*1000000;String strUrl ="http://www.google.com/ig/api?hl=zh-cn&weather=,,,"+a 阅读全文
posted @ 2011-08-31 15:45 QZB 阅读(6272) 评论(3) 推荐(1)
android WebService
摘要:适合手机的WebService客户端SDK KSOAP2:http://code.google.com/p/ksoap2-android/downloads/listhttp://files.cnblogs.com/xiaobuild/KSOAP2_SDK.rar将下载后的jar文件复制到工程的lib目录中(如果没有该目录,可以新建一个,当然,也可以放在其他的目录中)。并在工程中引用这个jar包如何调用WebService打开webServic链接,如http://macau.sanvio.net/ReadOrderWebService/wsReadOrder.asmx?op=GetNewsP 阅读全文
posted @ 2011-08-30 15:21 QZB 阅读(1229) 评论(0) 推荐(1)
android SAX 解析 xml文档【转】
摘要:res/layout/main014.xmView Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_ 阅读全文
posted @ 2011-08-25 15:02 QZB 阅读(916) 评论(1) 推荐(1)
android IO流 写入 读出
摘要:String –> InputStreamInputStrem is = new ByteArrayInputStream(str.getBytes());ByteArrayInputStream stream = new ByteArrayInputStream(str.getBytes());InputStream–>StringinputStream input;StringBuffer out = new StringBuffer(); byte[] b = new byte[4096]; for (int n; (n = input.read(b)) != -1;) .. 阅读全文
posted @ 2011-08-24 16:05 QZB 阅读(1658) 评论(0) 推荐(0)
android window 零碎知识
摘要:Window属性列举如下:FEATURE_OPTIONS_PANEL = 0; 功能不明,参见后面的说明(默认使能)FEATURE_NO_TITLE = 1; 无标题栏FEATURE_PROGRESS = 2; 在标题栏上显示加载进度,例如webview加载网页时(条状进度条)FEATURE_LEFT_ICON = 3; 在标题栏左侧显示一个图标FEATURE_RIGHT_ICON = 4; 在标题栏右侧显示一个图标FEATURE_INDETERMINATE_PROGRESS = 5; 不确定的进度(圆圈状等待图标)FEATURE_CONTEXT_MENU = 6; 上下文菜单,相当于PC上. 阅读全文
posted @ 2011-08-19 15:45 QZB 阅读(571) 评论(0) 推荐(1)
StartActivityButtonListener 很简洁 值得学习
摘要:@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initUI(); } private void initUI() { setContentView(R.layout.main); findViewById(R.id.toCheckboxSnippetButton).setOnClickListener( ne... 阅读全文
posted @ 2011-08-18 16:06 QZB 阅读(422) 评论(0) 推荐(0)
java.net.*获取网络数据
摘要:1 import java.io.ByteArrayOutputStream; 2 import java.io.File; 3 import java.io.FileOutputStream; 4 import java.io.InputStream; 5 import java.net.HttpURLConnection; 6 import java.net.URL; 7 8 public class NetTool { 9 10 /** 11 * 获得url代码数据 12 * */13 public static String getHtml(... 阅读全文
posted @ 2011-08-15 16:01 QZB 阅读(590) 评论(1) 推荐(0)
Android SDK Permission大全访问权限
摘要:android.permission.ACCESS_CHECKIN_PROPERTIES 允许读写访问"properties"表在checkin数据库中,改值可以修改上传( Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded) android.permission.ACCESS_COARSE_LOCATION 允许一个程序访问CellID或WiFi热点来获取粗略的位置(Allows an 阅读全文
posted @ 2011-08-12 10:49 QZB 阅读(826) 评论(0) 推荐(2)