- 博客(51)
- 收藏
- 关注
原创 note-50 GLUT light_&_material_01
openGL 灯光与材质例子. 顺带完成了一个颇复杂的平面分级算法, 修正版,列出了所有易错的地方: 1. 开启了 GL_XXX_ARRAY 后一定要使用对应的pointer, 否则就把 GL_XXX_ARRAY disable 掉. 2. 法线不一定要设置, openGL会自动为每一Vertex生成一个默认的, 自己设置当然可控性更好. 3. initLight...
2013-04-07 00:28:34 118 1
原创 note-50 CPP GLUT
一个 GLUT + glDrawElement 的基本范例, 要注意的地方已经有说明. 包括双缓冲需要注意的命令 #include <gl/GLUT.h>float angle=0;GLfloat vertices[]={ 1,1,1, -1,1,1, -1,-1,1, 1,-1,1, 1,1,-1, -1,1,-1, -1...
2013-04-04 21:38:18 104
原创 note-49 SoftReference
from:http://www.eoeandroid.com/archiver/tid-201077.html SoftReference的语义就是当内存不够用的时候,GC会回收SoftReference所引用的对象。所以,在memory sensitive的程序中将某些大型数据设置成SoftReference再合适不过了。创建一个SoftReference:Java代码 收...
2013-02-17 16:30:42 105
原创 note-48 SharePreference
from:http://blog.csdn.net/listening_music/article/details/6611786 SharedPreferences介绍: 做软件开发应该都知道,很多软件会有配置文件,里面存放这程序运行当中的各个属性值,由于其配置信息并不多,如果采用数据库来存放并不划算,因为数据库连接跟操作等耗时大大影响了程序的效率,因此我们...
2013-02-16 16:04:16 107
原创 note-47 ViewPager
from:http://www.open-open.com/lib/view/open1328833592437.htmlhttp://www.open-open.com/lib/view/open1330003503468.html 说明:ViewPager用于实现多页面的切换效果,该类存在于Google的兼容包里面,所以在引用时记得在Builld...
2013-02-16 12:45:07 95
原创 note-46 ViewFlipper
from:http://blog.csdn.net/sjf0115/article/details/7262064 如何实现手机上手动滑动翻页效果呢?呵呵,在这里我们就给你们介绍一下吧。一般实现这个特效会用到一个控件:ViewFlipper<1>View切换的控件—ViewFlipper这个控件是什么呢?请注意观看博文Android学习笔记之...
2013-02-16 10:36:13 74
原创 note-45 Timer and TimerTask
from:http://java.chinaitlab.com/advance/525535.html 这两个类使用起来非常方便,可以完成我们对定时器的绝大多数需求 Timer类是用来执行任务的类,它接受一个TimerTask做参数 Timer有两种执行任务的模式,最常用的是schedule,它可以以两种方式执行任务:1:在某个时间(Data),2:在某...
2013-02-04 13:48:52 88
原创 note-44 HttpURLConnection and HttpClient
from: http://blog.csdn.net/ainibaifenbai/article/details/6711564 HttpURLConnection和HttpClient联网2011-08-23 13:59 830人阅读 评论(0) 收藏 举报 Android中提供的HttpURLConnection和HttpClient接口可以用来开发...
2013-02-04 11:31:53 79
原创 note-43 AsyncTask
from: AsyncTask的用法 在开发Android应用时必须遵守单线程模型的原则: Android UI操作并不是线程安全的并且这些操作必须在UI线程中执行。在单线程模型中始终要记住两条法则: 1. 不要阻塞UI线程 2. 确保只在UI线程中访问Android UI工具包 当一个程序第一次启动时,Android会同时启动一个对应的主线...
2013-02-04 09:27:09 74
原创 note-42 custom radioButton
from:http://blog.csdn.net/wanglong0537/article/details/6434728 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
2013-02-02 10:00:06 120
原创 note-41 activity group
from:例子:http://www.cnblogs.com/over140/archive/2010/09/07/1820876.htmlhttp://www.cnblogs.com/answer1991/archive/2012/05/08/2489844.html原理:http://blog.csdn.net/yang765441183/article/details/...
2013-02-02 09:56:25 76
原创 note-40 关于发布应用
由于有米SDK 更新到 3.08 , 很多网上原有的教程已经不适用.ID和密码直接嵌入程序中, 不再在Manifest中注册, 用法上有很大的改变, 但同时也方便了很多. 还是官方的更新靠谱:http://wiki.youmi.net/Youmi_Android_Banner_Version_3.08 SDK嵌入步骤准备工作步骤一.将 youmi-android.jar 导...
2012-12-26 17:27:25 138
原创 note 39-关于启动界面,屏幕尺寸,自适应函数,与屏幕密度
android 不会自动检测屏幕密度, 所有屏幕密度默认都当作 1 (160dpi )处理 . 因此问题就来了, 我的模拟器密度是1, 因此所有像素设置都没有问题. 但在我的屏幕密度 1.5 (240 dpi )的手机上, 所有单位都自动乘了1.5 ! 幸好网上有高人:http://www.cnblogs.com/wangtianxj/archive/2011/03/18/19883...
2012-12-07 16:35:34 85
原创 note 38-Bluetooth
1. get a BluetoothAdapter instance by BluetoothAdapter.getDefaultAdapter(); 2. use an intent with uri BluetoothAdapter.ACTION_REQUEST_ENABLE to open the blue tooth 3. get a devices Set by adap...
2012-12-05 15:45:49 119
原创 note 37-Gson & Json
Too easy ,just see the code: package com.json_test;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import andr...
2012-12-05 13:49:39 83
原创 note 36- Animation
A. normal animation: can be set by code or set by XML . Use animationSet and XXXanimation ,very easy: package com.animation_test_02;import android.app.Activity;import android.grap...
2012-12-04 16:30:41 84
原创 note 35- View and the OnDraw Function
from: http://www.oschina.net/question/54100_29060 The android canvas has many fun functions to help me to draw the view . The warning point is , onDraw function WILL NOT update every fra...
2012-12-03 22:22:24 86
原创 note 34-AppWidgetProvider and deeper into PendingIntent
About pendingIntent: 1. PendingIntent is used in the situation that controling the remote process components . For example , to control an AppWidget, to control the notification. 2. Wraping a...
2012-12-03 15:38:36 88
原创 note 33- SeekBar and RatingBar
Too easy to use , just see: package com.progressbar_test03;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.wi...
2012-12-02 13:09:52 105
原创 note 32-ExpandableListActivity and SimpleExpandableListAdapter
1. extends ExpandableListActivity . 2. prepare the main.xml with an ExpandableListView , set the default id android:id/list ; 3. prepare the parent group layout with a TextView ; ...
2012-12-01 17:46:12 82
原创 note-31 Show dialog , DatePicker , AutoCompleteTextView
A. show dialog: 1. set a dialog id . 2. context.showDialog(int dialogId); 3. override onCreateDialog(int dialogId) function , use switch case to filter the Ids to return...
2012-11-30 17:37:34 70
原创 note 30- Spinner
A. default spinner : 1. must set a string-array in the string.xml2. use function : ArrayAdpater. createFromResource(Context context, int strArrayId, int...
2012-11-30 15:50:13 63
原创 note 29- a stupid mistake of IO;
byte[] buffer=new byte[4*1024]; int len; while((len=input.read(buffer))!=-1){ //the 0 is the starting of buffer,not the starting of ouput;...
2012-11-29 15:14:46 120
原创 note 28-TabHost and Custom setup
from: http://blog.csdn.net/west8623/article/details/7453814 http://blog.csdn.net/zingck/article/details/7454316 http://blog.csdn.net/yxz329130952/article/details/7740383 1. U...
2012-11-29 11:53:01 56
原创 note 27-notification and PendingIntent
from: http://blog.csdn.net/zeng622peng/article/details/6180190 http://www.pocketdigi.com/20100905/89.html 1.PendingIntent.getActivity(Context context, int requestCode, Intent inte...
2012-11-28 14:09:35 60
原创 note 26-deeper into BaseAdapter and ListView
original from: http://blog.csdn.net/mayingcai1987/article/details/6273606 I added some personal note to the original code , so , just notice the notes as below: package com.dy...
2012-11-28 09:18:14 61
原创 note 25- Service
from: http://blog.csdn.net/pugongying1988/article/details/7239124 1. register a service in manifest file . A stupid mistake that takes me one hour is that , the Four Big Parts(Activity, Conten...
2012-11-27 11:12:29 69
原创 note 24-set up ServerSocket in android
note: That means The Server terminal is in the android device; 1. allow all internet permission in the manifest file , before <application> label; <uses-permission android:name="andr...
2012-11-27 11:12:16 69
原创 note 23- 关于 LayoutInflater , Activity.findViewById() 和 View.findViewById()
经过一些实验,终于比较清楚地理解了 LayoutInflater 的真正作用. 这个实验要从一个问题说起: 为什么 Activity 里有 findViewById() 方法 , 而 View 里也有同样的 findViewById() ? 起初我以为这两个方法有什么地方是不一样的,但其实基本上是相同的, 同样的通过 id 获取自身的子组件 . 只是在Activity中它会间接返回Acti...
2012-11-27 11:12:05 109
原创 note 22-System service
from: http://hi.baidu.com/wentaokou/item/d482e10ab8720a046d904848 1. 说明 android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作。比如MountService监听是否有SD卡安装及移除,ClipboardService提供剪切板功能,Pa...
2012-11-27 11:11:47 87
原创 note 21-cuntom component
from: http://www.cnblogs.com/tt_mc/archive/2010/05/28/1746307.html http://blog.csdn.net/notice520/article/details/6667827 custom component : 1. make an custom layout xml file as a...
2012-11-27 11:11:38 165
原创 note 20- BroadcastReceiver and Intent
1. if I want my application activity to catch broadcast. I must register the receiver and set an intent filter which indicates the intent actions to be interested . 2. if I want my applicatio...
2012-11-26 11:27:26 105
原创 note 19- SAX and XMLReader and assets folder in android
IBM SAX doc:http://www.ibm.com/developerworks/cn/xml/x-saxhandle/ 方法名称 方法说明public void setDocumentLocator(Locator locator) 设置一个可以定位文档内容事件发生位置的定位器对象public void startDocument() throws SAXExceptio...
2012-11-26 11:27:15 87
原创 note 18- Http download and file write permission
1. instance a HttpURLConnection , by Url.openConnection(); url=new URL(String url);2. get an inputstream from HttpURLConnection.getInputStream();3. get a String or write the input stream to a...
2012-11-26 11:27:00 105
原创 note 17-some different VO in android
1. Message + Bundle - pass through different HandlerThread ;2. ContentValue - pass to SQLDatabase ;3. Intent + Bundle - pass through diffe...
2012-11-26 11:26:47 177
原创 note 16- SQL lauguage and some personal point for android
Android is completely decouple even in the application level . All couples are set down-stairs to the system level . It is very amazing . different parts (Activity , ContentProvider , Service...
2012-11-26 11:26:36 79
原创 note 15-ListView , SQLDatabase , and ContentProvider
about ListActivity: 1. Activity extends a ListActivity , setListAdapter(listAdt) . 2. listAdt is a SimpleAdapter(Context context , List list , Layout listlayout , String[] projectionKey , in...
2012-11-25 20:00:46 88
原创 note 14 Handler and Looper
1. instance a new HandlerThread , and start it . 2. instance a new Handler , set a looper from HandlerThread . 3. Two thread can communicate by Message (for exp , press a button to stop the ...
2012-11-25 20:00:38 63
原创 note 13-android progress bar
firstBar.setVisibility(View.VISIBLE);firstBar.setVisibility(View.GONE); different type of style: <ProgressBar android:id="@+id/firstBar" style="?android:attr/progressBa...
2012-11-25 20:00:29 69
原创 note 12-android radio button and checkbox and Toast
RadioGroup.setOnCheckedChangeListener(genderGroupListener); CheckBox.setOnCheckedChangeListener(swimListener); note: there are two different listenener public void onChecked...
2012-11-25 20:00:19 59
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人