ejs是Embedded JavaScript的简写 1.创建一个ejs模板 var ejs = require(‘ejs‘);
var template = ‘<%= message %>‘;
var context = {message: ‘Hello template!‘};
console.log(ejs.render(template, context)); ...
分类:
Web程序 时间:
2014-12-24 14:57:09
阅读次数:
293
一、使用ContentProvider(内容提供者)共享数据
ContentProvider在android中的作用是对外共享数据,也就是说你可以通过ContentProvider把应用中的数据共享给其他应用访问,其他应用可以通过ContentProvider对你应用中的数据进行添删改查。关于数据共享,以前我们学习过文件操作模式,知道通过指定文件的操作模式为Context.MODE_WORLD_...
分类:
其他好文 时间:
2014-12-24 11:51:11
阅读次数:
151
private List> list = null;
private PackageManager mPackageManager;
private List mAllApps;
private Context mContext;
/**
* 检查系统应用程序,并打开
*/
private void openApp(){
//应用过滤...
分类:
移动开发 时间:
2014-12-24 11:44:34
阅读次数:
142
解释器模式,其实就是编译原理中的语法解释器,如果用在项目中,可以用于实现动态脚本的解析,也就是说项目可以支持用户脚本扩展。但实际上,这种运行时解释,效率很慢,如果不是很需要的话,不建议使用。一种简单实现:Context是上下文场景,比如做一个计算器,那这个Context可以作为一个Calculato...
分类:
其他好文 时间:
2014-12-24 09:47:42
阅读次数:
99
public class EyeView extends FrameLayout {
private Paint paint;
private Bitmap bitmap;
public EyeView(Context context) {
super(context);
init();
}
public EyeView...
分类:
微信 时间:
2014-12-23 21:18:01
阅读次数:
488
public class ParamButton extends Button
{
// com.ts.factoryset.ParamButton
private int mParam;
public ParamButton(Context context)
{
super(context);
}
public ParamButton(Context contex...
分类:
移动开发 时间:
2014-12-23 19:30:00
阅读次数:
166
ThreadedCoreData案例分析该案例展示了CoreData在多线程中是如何使用的。这里使用了ThreadConfinement模式。有两个线程,分别为主线程和后台线程,两个线程中各有自己的NSManagedObjectContext。并且这两个context共享一个persistentStoreCoordinator首先,利用NSURLConnection..
分类:
其他好文 时间:
2014-12-23 17:43:32
阅读次数:
135
Context类 ,说它熟悉,是应为我们在开发中时刻的在与它打交道,例如:Service、BroadcastReceiver、Activity等都会利用到Context的相关方法 ; 说它陌生,完全是因为我们真正的不懂Context的原理、类结构关系。一个简单的问题是,一个应用程序App中存在多少个Context实例对象呢?一个、两个?
在此先卖个关子吧。读了本文,相信您会豁然开朗的 。
...
分类:
移动开发 时间:
2014-12-23 15:37:49
阅读次数:
219
public RequestQueuemRequestQueue = Volley.newRequestQueue(getApplicationContext());一切都从这句代码开始。。。跟着newRequestQueue(Context)到Volley类中public class Volley...
分类:
移动开发 时间:
2014-12-23 11:53:58
阅读次数:
195
android开发,我在我的 activity 插入一个按钮,如果andriod market找不到的话就使用 toast进行提示,在使用的时候出现了一些问题,下面的代码报错了 Context cannot be resolved to a variable
1
2
3
4
5
6
7
Uri
uri = U...
分类:
移动开发 时间:
2014-12-23 10:31:06
阅读次数:
223