- 博客(132)
- 收藏
- 关注
原创 android eclipse 安装
从 这个网址下载:http://developer.android.com/sdk/index.html#win-bundle解压后的eclipse就可以直接使用。安装svn:help---->install new software,输入网址:http://subclipse.tigris.org/update选择 subclipse plugin 一个选项,进...
2013-10-11 16:22:22
182
原创 android attr.xml 怎么在主工程中设置library项目中背景或者其他一些属性。
怎么在主工程中设置library项目中背景或者其他一些属性值。attr.xml :自定义属性。format值参考: http://huangbo-2020.iteye.com/blog/14776111、自定义属性:<resources><attr name="searchViewCloseIcon" format="reference" />...
2013-04-16 19:38:26
285
原创 android 中theme.xml与style.xml的区别
android 中theme.xml与style.xml的区别:相同点:两者的定义相同。<resources><stylename="theme"parent="android:Theme.Black"><itemname="android:windowNoTitle">true< /item>
2013-04-16 19:03:30
496
原创 android 键盘 搜索键
想让软键盘上的enter键显示搜索图标: xml中设置: android:imeOptions="actionSearch" android:inputType="text".java中: mQueryTextView.setImeOptions(EditorInf...
2013-04-15 16:52:04
237
原创 android activity 自定义标题 工具栏 requestWindowFeature
当应用需要一个相同的标题时或者是工具栏时我们可以使用requestWindowFeature属性:public class AndroidTestActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle...
2013-02-04 17:34:50
163
原创 在一个按钮正下方显示一个popwindow
//这是show一个PopupWindow PopupWindow mPopupWindow; public void showPopupWindow() { LayoutInflater mLayoutInflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); Vie...
2012-11-06 23:48:02
409
原创 wp7 HttpWebRequest 网络请求
这是开始网络请求的方法,网络返回在ResponseCallback处理: private void DoHttpWebRequest() { string url = "http://www.cnblogs.com/linzheng"; var request = HttpWebRequest.Create...
2012-05-15 00:04:36
143
原创 wp7 WebClient请求
这事一个开始加载url的 方法 ,在 加载 完成时发生 webClient_OpenReadCompleted方法: private void DoWebClient() { WebClient webClient = new WebClient(); webClient.OpenReadAsync(new Ur...
2012-05-14 23:52:59
106
原创 wp7 判断网络是否可用,判断网络状态
判断网络是否可用:true为 有网可用,false为无网可用。var network = Microsoft.Phone.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();判断网络状态:方法返回网络类型。 public static string GetNetStates() ...
2012-05-10 00:45:33
127
原创 app widget 进入主客户端代码。
做widget :想点击widget一个按钮时就进入客户端,要和点击应用程序的图标效果一样,纠结了很久,得出代码: if (action.equals("Enter")) { Intent i = new Intent(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_LAUNCHER); ...
2012-04-25 16:56:40
172
原创 eclipse 提示慢 Alt+/
eclipse Alt+/ 这个快捷键提示慢解决:下载org.eclipse.jdt.core_3.6.1.v_A68_R36x.jar,关闭Eclipse,将它放到:Eclipse\plugins下覆盖同名文件.
2012-04-10 17:46:36
250
acitvitygroup edittext 软盘弹出时 底部菜单挤压到上面的问题
userName = (EditText) layout.findViewById(R.id.username); //TODO 显示软盘 使用EditText的getContext InputMethodManager imm = (InputMethodManager)userName.getContext(). getSystemService(Context.INPUT_METH...
2012-03-31 17:28:02
152
原创 widget
1:在清单注册: <receiver android:name="com.youku.widget2.LenovoLeosWidgetDemoWidgetProvider" android:label="@string/app_name" > <intent-filter> <a...
2012-03-13 14:26:40
124
原创 wifi 通知栏上 选择程序时出现你的应用
<activity android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="portrait" androi...
2012-02-08 10:06:22
156
原创 让软盘消失和出现
在程序中加入以下代码时,软键盘会出现:InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.RESULT_SHOWN); .csharpcode, .cshar...
2012-02-07 18:28:50
146
原创 按两次back键返回
Java代码 private long exitTime = 0; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK && event.ge...
2012-02-07 16:45:27
154
原创 创建桌面快捷方式
本文时在activity中创建桌面快捷方式: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if(!IfaddShortCut()) ...
2012-02-07 14:49:01
150
原创 根据图片名字 读取图片
根据图片名字 读取图片 int id_up = context.getResources().getIdentifier(pic, "drawable", "com.wiwigo.app"); 取得的是图片的id
2012-01-17 17:57:57
406
原创 关于tableactivity 中activitygroup 使用spinner 控件报错
这个就和显示dialog一样的道理,都要使用父类显示:解决方法如下:1 这是这个activity要显示的 view R.layout.localview中有spinner 控件View contentView = LayoutInflater.from(this.getParent()).inflate(R.layout.localview,null); setConten...
2012-01-14 11:05:42
172
原创 Linux中在本机获取root权限?
如果没设置root密码可以使用sudo passwd root设置密码然后切换到root使用su root如果不想切换root但是想拥有大部分root权限可以在使用命令时候 加上 sudo,sudo mount 挂载sudo 命令...
2011-11-22 11:26:42
296
原创 linux 安装emacs
第一种:只安装的是默认版本sudo apt-get install erlang第二种:1 获得一个最新 erlang源代码,代码在一个文件之中,他的名字类似otp_src_R11B-4.tar.gz2 按照下面的步骤进行解包,配置,编译,以及安装:$ tar -xzf otp_src_R11B-4.tar.gz$ cd otp_src_R11B-4$ ./con...
2011-11-17 17:24:56
370
原创 erlang 命令编译.erl文件
在home/blue新建文件夹:erl1:此时可以编译这个文件夹下的文件了。首先:输入~$erlcd("/home/blue/erl").c(demo). 2:~$cd /home/blue/erl$erlc(demo).
2011-11-17 11:56:39
1743
原创 erlang 安装使用
1、修改其安装源文件> sudo gedit /etc/apt/sources.list 找到'partner' repository,如下:## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This soft...
2011-11-17 10:51:13
120
原创 打开蓝牙连接
分享时,打开发送蓝牙文件中的链接: Intent intent=new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); //分享的数据类型 intent.putExtra(Intent.EXTRA_SUBJECT,getString(...
2011-11-01 14:58:44
210
原创 获取控件坐标
int[] location = new location[2] ;view.getLocationInWindow(location); //获取在当前窗口内的绝对坐标view.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标location [0]--->x坐标,location [1]--->y坐标...
2011-10-10 18:00:47
220
原创 获取应用详细信息 报错 解决
public static void showInstalledAppDetails(Context context, String packageName) { Intent intent = new Intent(); final int apiLevel = Build.VERSION.SDK_INT; if (api...
2011-09-22 17:41:46
347
原创 安装apk、卸载apk 代码
安装 apk: Intent i = new Intent(Intent.ACTION_VIEW); String filePath = appInfo.getAbsolutePath(); ...
2011-09-19 10:25:33
171
原创 Android监听程序的安装和卸载
在android系统中,安装和卸载都会发送广播,当应用安装完成后系统会发android.intent.action.PACKAGE_ADDED广播。可以通过intent.getDataString()获得所安装的包名。当卸载程序时系统发android.intent.action.PACKAGE_REMOVED广播。同样intent.getDataString()获得所卸载...
2011-09-17 14:30:16
349
1
原创 android 代码混淆
android 代码混淆1 proguard.cfg,这就是混淆所需的proguard脚本啊。 其代码如下: view plain-optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -ve...
2011-09-17 10:42:16
69
原创 Android获取内部和外部内存空间大小
Android.os下的StatFs类主要用来获取文件系统的状态,能够获取sd卡的大小和剩余空间,获取系统内部空间也就是/system的大小和剩余空间等等。看下读取sd卡的:void readSDCard() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED...
2011-09-15 15:03:30
89
原创 在市场中显示
Uri marketUri = Uri.parse("market://details?id=com.metago.astro&feature=top-free"); Intent viewIntent = new Intent(); viewIntent.setData(marketUri); startActivity(viewIntent); ...
2011-09-15 11:31:59
99
原创 android 分享到 代码
Intent intent=new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); //分享的数据类型 intent.putExtra(Intent.EXTRA_SUBJECT, "subject"); //主题 intent.putExtra(Intent.EXTRA_TEXT, "content"...
2011-09-14 14:54:31
100
原创 动画 rotate 让一张图片以它的中心旋转
1 在layout/anim下建立一个anim.xml文件<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android"> <rotate android:interpolator="@an.
2011-09-07 16:54:52
630
原创 帧动画在第一个activity中不能播放
帧动画在第一个activity中不能播放,必须要通过事件触发才行,解决: package com.lik; import android.app.Activity;import android.graphics.drawable.AnimationDrawable;import android.os.Bundle;import android.view.Ke...
2011-07-28 18:04:46
141
原创 文件空指针错误
adapter显示文件列表时,文件列表的数组为空,就报空指针错误,我们在getCount方法: fileList == null ? 0 : fileList.length 这样就不会出现空指针错误了。...
2011-07-24 18:30:02
322
原创 android 数据库 数据倒序排列
/** * 查询所有数据 * @return Cursor */ public Cursor select(){ SQLiteDatabase db =logDatabaseHelper. getReadableDatabase(); return db.query("...
2011-07-20 17:01:18
1946
原创 转换文件大小 b---kb----mb---gb
转换文件大小long mylength = file.length();//得到的大小为bString mylengthString=formatSize(mylength); public static String formatSize(float size) { long kb = 1024; long m...
2011-07-19 13:09:12
295
原创 文件 最后修改时间读取 :格式
读取文件最后修改的时间,以MM月dd日 hh:mm形式显示 long mytime = file.lastModified();String timeStr = timeString( mytime ); private String timeString( long time ){ //方式1 按系统的日期方式 // Calenda...
2011-07-19 11:30:01
243
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人