12 2012 档案

摘要:DefinitionsAnintis aprimitive. It isnotanObject. Anintis a high performance, streamlined beast for calculating numbers in the range -2,147,483,648 [-231] aka Integer.MIN_VALUE to +2,147,483,647 [231-1] aka Integer.MAX_VALUE. Anintis a bare bones32-bitchunk of information.intvariables aremutable. Unl 阅读全文
posted @ 2012-12-24 11:08 Qiengo 阅读(358) 评论(0) 推荐(0)
摘要:前言 话说开发用了各种Adapter之后感觉用的最舒服的还是BaseAdapter,尽管使用起来比其他适配器有些麻烦,但是使用它却能实现很多自己喜欢的列表布局,比如ListView、GridView、Gallery、Spinner等等。它是直接继承自接口类Adapter的,使用BaseAdapter时需要重写很多方法,其中最重要的当属getView,因为这会涉及到ListView优化等问题,其他的方法可以参考链接的文章BaseAdapter与其他Adapter有些不一样,其他的Adapter可以直接在其构造方法中进行数据的设置,比如SimpleAdapter adapter = ... 阅读全文
posted @ 2012-12-21 17:02 Qiengo 阅读(332) 评论(0) 推荐(0)
摘要:1.sleep()使当前线程(即调用该方法的线程)暂停执行一段时间,让其他线程有机会继续执行,但它并不释放对象锁。也就是如果有Synchronized同步块,其他线程仍然不同访问共享数据。注意该方法要捕获异常比如有两个线程同时执行(没有Synchronized),一个线程优先级为MAX_PRIORITY,另一个为MIN_PRIORITY,如果没有Sleep()方法,只有高优先级的线程执行完成后,低优先级的线程才能执行;但当高优先级的线程sleep(5000)后,低优先级就有机会执行了。总之,sleep()可以使低优先级的线程得到执行的机会,当然也可以让同优先级、高优先级的线程有执行的机会。2. 阅读全文
posted @ 2012-12-21 16:24 Qiengo 阅读(247) 评论(0) 推荐(0)
摘要:AsyncTask实际上就是一个线程池,AsyncTask在代码上比handler要轻量级别,而实际上要比handler更耗资源,因为AsyncTask底层是一个线程池!而Handler仅仅就是发送了一个消息队列,连线程都没有开。但是,如果异步任务的数据特别庞大,AsyncTask这种线程池结构的优势就体现出来了。android的ui线程操作并不是安全的,并且和用户直接进行界面交互的操作都必须在ui线程中进行才可以。这种模式叫做单线程模式。我们在单线程模式下编程一定要注意:不要阻塞ui线程、确保只在ui线程中访问ui组件AsyncTask是抽象类,定义了三种泛型类型 Params,Prog.. 阅读全文
posted @ 2012-12-21 15:08 Qiengo 阅读(301) 评论(0) 推荐(0)
摘要:public abstract classAsyncQueryHandlerextendsHandlerA helper class to help make handling asynchronousContentResolverqueries easier.使用场景:在一般的应用中可以使用ContentProvider去操作数据库。这在数据量很小的时候是没有问题的,但是如果数据量大了,可能导致UI线程发生ANR异常(超过5秒)。当然你也可以写个Handler去做这些操作,只是你每次使用ContentProvider时都要再写个Handler,必然降低了效率。因此当数据量较大时,最好还是使用 阅读全文
posted @ 2012-12-21 11:42 Qiengo 阅读(478) 评论(0) 推荐(0)
摘要:This article's purpose is to generate a static/shared library which can be used in android ndk.Software Version: Cygwin 1.7.15-1 Android SDK 4.0.3 (API 15) Android NDK r81.Install Android-ndk and CygwinInstallNDK.Download the zip file and unzip itto thedestination folder.my isD:\Android\android- 阅读全文
posted @ 2012-12-20 12:24 Qiengo 阅读(374) 评论(0) 推荐(0)
摘要:BlockingQueueArrayBlockingQueueDelayQueueLinkedBlockingQueuePriorityBlockingQueueSynchronousQueueBlockingDequeLinkedBlockingDequeBlockingQueueTheBlockingQueueinterface in thejava.util.concurrentclass represents a queue which is thread safe to put into, and take instances from. In this text I will sh 阅读全文
posted @ 2012-12-19 15:02 Qiengo 阅读(3090) 评论(0) 推荐(0)
摘要:2012-12-19 统计的当前android手机主要分辨率,主要来源于中关村。看完以下数据统计之后,请决定dm版要采用的分辨率,谢谢商超通dm版本,支持分辨率和对应的android手机如下:当前市面上可见的分辨率 说明 中关村数据(包括已停产)1280×720像素 ---大部分高档机型,高清屏,该类手机越来越多 127款手机960×640像素--主要是魅族系列手机 12款手机960×540像素--相对分散,htc,摩托居多 163款手机854×480像素---相对分散,主要是摩托,联想 98款80... 阅读全文
posted @ 2012-12-19 11:30 Qiengo 阅读(324) 评论(0) 推荐(0)
摘要:Androidis aLinux-basedoperating systemdesigned primarily fortouchscreenmobile devices such assmartphonesandtablet computers. Initially developed by Android, Inc.,whomGooglefinancially backed and laterpurchased in 2005,Android was unveiled in 2007along with the founding of theOpen Handset Allianc... 阅读全文
posted @ 2012-12-13 16:54 Qiengo 阅读(500) 评论(0) 推荐(0)
摘要:Android is a software stack for mobile devices that includes an operating system, middleware and key applications. TheAndroid SDKprovides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.FeaturesApplication frameworkenabling .. 阅读全文
posted @ 2012-12-13 11:46 Qiengo 阅读(977) 评论(0) 推荐(0)
摘要:o(∩_∩)oString result = String.format("The format method is %s!", "great");// result now equals "The format method is great!".You don't need to use numbers to indicate positioning. By default, the position of the argument is simply the order in which it appears in th 阅读全文
posted @ 2012-12-11 12:20 Qiengo 阅读(1114) 评论(0) 推荐(1)
摘要:1.android:configChanges="keyboardHidden|orientation"<activity android:name=".TwitterActivity$AppListFragment" android:configChanges="keyboardHidden|orientation" />If you use this,then android won't restart activity when screen is rotated.Instead,onConfiguratio 阅读全文
posted @ 2012-12-06 17:07 Qiengo 阅读(309) 评论(0) 推荐(0)
摘要:These classes focus on the best Android user experience for your app. In some cases, the success of your app on Android is heavily affected by whether your app conforms to the user's expectations for UI and navigation on an Android device. Follow these recommendations to ensure that your app loo 阅读全文
posted @ 2012-12-06 12:38 Qiengo 阅读(922) 评论(0) 推荐(1)