06 2011 档案
如何用手机赚钱——admob
摘要:想用手机赚钱?如果你是程序员,那就在android软件中投放AdMob广告吧。其实非常简单。主要有以下步骤: 1.登陆http://zhcn.admob.com/中文网站 注册账号或者使用google账号。我使用的是google账号 点击点击 根据提示输入应用程序名称 软件包名 提交后。进入站点和应用程序 点击管理设置 抄下发布者ID 备用。 2.加入admob jar包下载备用 打... 阅读全文
posted @ 2011-06-30 23:38 AlexCheng 阅读(850) 评论(0) 推荐(0)
经典解析23 种设计模式
摘要:Factory(工厂模式), Builder(建造模式), Factory Method(工厂方法模式), Prototype(原始模型模式),Singleton(单例模式), Facade(门面模式), Adapter(适配器模式), Bridge(桥梁模式), Composite(合成模式), Decorator(装饰模式), Flyw... 阅读全文
posted @ 2011-06-29 10:32 AlexCheng 阅读(227) 评论(0) 推荐(0)
解决:Bitrac博客后台登录验证码错误的问题
摘要:今天为发布android软件新建的一个博客,用的是Bitrac程序。因为它非常适合程序员使用,里面内置了代码编辑器。文章发布后,代码部分会显示相应的样式。 我将下载的程序上传到空间,根据说明登陆后台,发现老是提示验证码错误。我确定用户名和密码是正确的。 后来发现解决这个问题的方法非常简单,只需要修改web.config文件的appSettings节点,将其修改为博客的域名就可以了。例如我的博客域名... 阅读全文
posted @ 2011-06-28 17:07 AlexCheng 阅读(235) 评论(0) 推荐(0)
Notification和NotificationManager的基本使用方法
摘要:1. NotificationManager和Notification用来设置通知。 通知的设置等操作相对比较简单,基本的使用方式就是用新建一个Notification对象,然后设置好通知的各项参数,然后使用系统后台运行的NotificationManager服务将通知发出来。 基本步骤如下: 1)得到NotificationManager: String ns = Context... 阅读全文
posted @ 2011-06-20 13:51 AlexCheng 阅读(280) 评论(0) 推荐(0)
微软Webcast课程下载软件iReaper正式登陆Android平台
摘要:微软Webcast课程下载软件iReaper正式登陆Android平台,我叫它iReaper for Android。目前正处于测试阶段,功能比较单一。 目前支持 1.视频下载 2.课程代码下载 3.讲义下载 4.问答下载 附上截图,敬请期待! 1.下载地址:(将.rar改为apk) 2011.0624 iReaper for android 0.1.11.0624 201... 阅读全文
posted @ 2011-06-19 21:10 AlexCheng 阅读(481) 评论(0) 推荐(0)
解决Invalid file name: must contain only [a-z0-9_.]的错误
摘要:android开发过程中如果出现:res\layout\itemList.xml: Invalid file name: must contain only [a-z0-9_.]错误。原因在于layout文件命名。该布局文件的命名是不能出现大写字母的。只能以小写字母,下划线和.命名 阅读全文
posted @ 2011-06-14 09:39 AlexCheng 阅读(1020) 评论(0) 推荐(0)
Android中获取网络图片的三种方法
摘要:android中获取网络图片是一件耗时的操作,如果直接获取有可能会出现应用程序无响应(ANR:Application Not Responding)对话框的情况。对于这种情况,一般的方法就是耗时操作用线程来实现。下面列三种获取url图片的方法: 1.直接获取:(容易:ANR,不建议) mImageView = (ImageView)this.findViewById(R.id.imageT... 阅读全文
posted @ 2011-06-11 12:27 AlexCheng 阅读(410) 评论(0) 推荐(0)
androidmanifest.xml权限中文说明
摘要:程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下: android.permission.ACCESS_CHECKIN_PROPERTIES 允许读写访问”properties”表在checkin数据库中,改值可以修改上传( Allows read/write access to the “properties” table in t... 阅读全文
posted @ 2011-06-10 14:16 AlexCheng 阅读(270) 评论(0) 推荐(0)
Android文件下载
摘要:文件下载步骤 1.创建一个HttpURLConnection对象 HttpURLConnection urlConn=(HttpURLConnection)url.openConnection(); 2.获得一个InputStream对象 urlConn.getInputStream() 3.访问网络权限 android.permission.INTERNET 访问SCARD 1.... 阅读全文
posted @ 2011-06-10 08:30 AlexCheng 阅读(224) 评论(0) 推荐(0)
Microsoft WebCast API说明
摘要:newsID 课程编号(唯一) headline 课程名称 description 课程简介 url 课程网页链接,为相对路径,绝对路径请在之前添加 http://www.microsoft.com/china/msdn level 课程难度等级 date 课程开始时间 speaker 讲师 title 讲师职称 resume 讲师简介 prod... 阅读全文
posted @ 2011-06-09 07:49 AlexCheng 阅读(275) 评论(0) 推荐(0)
android http通信——HttpURLConntection
摘要:Java代码 String urlpath="http://i2.sinaimg.cn/dy/dsgb/20083.jpg"; try { URL url=new URL(urlpath); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setConnec... 阅读全文
posted @ 2011-06-07 09:34 AlexCheng 阅读(246) 评论(0) 推荐(0)
Andriod中的Handler机制
摘要:Handler的定义: 主要接受子线程发送的数据, 并用此数据配合主线程更新UI. 解释: 当应用程序启动时,Android首先会开启一个主线程 (也就是UI线程) , 主线程为管理界面中的UI控件,进行事件分发, 比如说, 你要是点击一个 Button ,Android会分发事件到Button上,来响应你的操作。 如果此时需要一个耗时的操作,例如: ... 阅读全文
posted @ 2011-06-07 09:20 AlexCheng 阅读(147) 评论(0) 推荐(0)
Android UI设计秘笈
摘要:作为开发者,为啥我们要关心UI?因为UI越好,用户会感觉你的软件质量越好,第一印象更好;于是他们会给你更好的评分;于是你的软件会有更好的排名;于是,会有更多人装你的软件,你也就能赚到更多钱。 五不要和九要 五不要: 1. 不要照搬其他平台上的UI设计。应该让用户感觉是在使用一个真正的 Android 软件,在你的品牌显示和平台整体观感之间做好平衡。 2. 不要过度使用模态进度条和确认对话框... 阅读全文
posted @ 2011-06-07 09:12 AlexCheng 阅读(229) 评论(0) 推荐(0)
为模拟器建立SDcard
摘要:为模拟器建立SDcard 。(以下均为命令形式,除了“回车”按键操作,和提示步骤的“>>”之外) win+r (打开 运行命令)>> cmd 回车>>D: 回车>>cd D:/sdk/tools 回车>> (这样就可以了) 继续 命令:mksdcard 512M D:\sdcard.img >> 稍等 弹出输入状态后再输入:emulator -avd android -sdcard ... 阅读全文
posted @ 2011-06-07 08:33 AlexCheng 阅读(192) 评论(0) 推荐(0)
Contacts分析
摘要:● 新建联系人界面menu菜单join按钮功能: 1. 无修改时什么都不做。 2. 有修改时先将修改后的内容保存到数据库,再跳转到合并联系人界面。 ● EntitySet修改时机: 1. 编辑界面打开时调用bindEditors()方法,添加对应要显示的文本框时,一个文本框对 应一个ValuesDelta。 2. 点击每一项中的加号按钮添加一个文... 阅读全文
posted @ 2011-06-07 08:24 AlexCheng 阅读(240) 评论(0) 推荐(0)
android半透叠加对照表
摘要:Java代码 paint.setColor(Color.WHITE); for (int i = 0; i < 255; i++) { for (int j = i; j < 255; j++) { Bitmap b1=Bitmap.createBitmap(3, 1,Config.ARGB_8888); int[] pixels=new int[3]; pix... 阅读全文
posted @ 2011-06-04 11:04 AlexCheng 阅读(575) 评论(0) 推荐(0)
隐式调用 Intent 大全
摘要://调用浏览器 Java代码 Uri uri = Uri.parse(""); Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it); //显示某个坐标在地图上 Java代码 Uri uri = Uri.parse("geo:38.899533,-77.036476"); Intent i... 阅读全文
posted @ 2011-06-03 09:16 AlexCheng 阅读(266) 评论(0) 推荐(0)
android程序自动安装apk
摘要:Xml代码 Java代码 Uri uri = Uri.fromFile(new File("/sdcard/temp.apk")); //这里是APK路径 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri,"application/vnd.android.package-arch... 阅读全文
posted @ 2011-06-03 08:59 AlexCheng 阅读(442) 评论(0) 推荐(0)
android文字滚动
摘要:这个实例的本意展示j2me的字体,和滚屏的实现。我只实现了android自带的三种字体. 下面给出效果图: 下面给出MainView的代码 Java代码 package com.wjh.demon_6; import android.content.Context; import android.graphics.Canvas; import andro... 阅读全文
posted @ 2011-06-03 08:57 AlexCheng 阅读(444) 评论(0) 推荐(0)
Visual Studio 2010广告
摘要: 阅读全文
posted @ 2011-06-02 17:43 AlexCheng 阅读(173) 评论(0) 推荐(0)
android layout_weight讲解
摘要:在网上看了一些对Layout_weight的讲解,有些说的比较片面,只列举了一种情况,然后自己通过实验和一些比较好的文章总结了一下,特此记录下来,以备以后所用。Layout_weight是线性布局,也就是LinearLayout里面用到的,下面通过实验来看这个Layout_weight的特性。 1.当控件的属性android:layout_width="fill_parent"时,布局文件如下:... 阅读全文
posted @ 2011-06-02 16:01 AlexCheng 阅读(165) 评论(0) 推荐(0)
Android程序员入门(中文版) PDF版 下载
摘要:下载地址 阅读全文
posted @ 2011-06-02 14:21 AlexCheng 阅读(240) 评论(0) 推荐(0)
使用surfaceView
摘要:在那本书用的是GameCanvas,我就用surfaceView实现了和实例2相同的效果 效果图: 下面给出MainView 的代码 Java代码 package com.wjh.demon_3; import android.content.Context; import android.graphics.Canvas; import android.graph... 阅读全文
posted @ 2011-06-02 10:42 AlexCheng 阅读(419) 评论(0) 推荐(0)
android系统信息获取
摘要:一、内存(ram): android的总内存大小信息存放在系统的/proc/meminfo文件里面,可以通过读取这个文件来获取这些信息: Java代码 publicvoidgetTotalMemory(){ Stringstr1="/proc/meminfo"; Stringstr2=""; try{ FileReaderfr=newFileReader... 阅读全文
posted @ 2011-06-02 08:35 AlexCheng 阅读(278) 评论(0) 推荐(0)
android保存全局变量
摘要:需要在多个activity或者service之间共享数据 1、自定义Application Java代码 public class DemoApplication extends Application { private HashMap map = new HashMap(); public void put(String key,Object object){ map.pu... 阅读全文
posted @ 2011-06-02 08:26 AlexCheng 阅读(350) 评论(0) 推荐(0)
获取可视区域的Rect对象(顺带获取状态栏和标题栏高度的方法)
摘要:这个有什么用捏,这里举一个例子,当我们使用系统自带的AlertDialog时,弹出对话框之后,我们只能按上面的按钮或者手机上的返回键才可以取消对话框,如果我们希望点击对话框视图区域外的某处也能关闭我们的对话框,这时就需要用到我们今天讲到的知识点了。 我直接贴出代码分析一下吧! Java代码 /** * * 重写onTouchEve... 阅读全文
posted @ 2011-06-02 08:22 AlexCheng 阅读(425) 评论(0) 推荐(0)
android自动换行
摘要:这个实例主要是运用字体的只是,但是android自带就几种,虽然android有提供可以自己转载字体的功能,但我试了下,没发现成功的,所以我代码里面就没有弄了,就弄了自带的。明天再试试效果,发现书本的代码不怎么适合android,当字体变大时,会出现按两次才能换行的bug。以后我会修订这个bug 下面是效果图: mainView的代码: Java代码 package com.... 阅读全文
posted @ 2011-06-02 08:16 AlexCheng 阅读(655) 评论(0) 推荐(0)