-
Archives
- January 2012
- October 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- August 2010
- July 2010
- July 2009
- February 2009
- December 2008
- November 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- January 2008
- December 2007
- November 2007
- April 2007
- November 2006
-
Meta
Category Archives: Android
How to get Serial Number, Mac, or ANDROID ID of an Android Device(ZZ)
Hi, I think many of you thought which is best to retrieve from the Android Device, so that you can be sure the device will not trick you and the identifier you asked is unique and unchangeable. For example we … Continue reading
Posted in Android, Mobile, 技术为本, 文摘转贴
Leave a comment
关于waitForCondition导致死锁的问题(zz)
waitForCondition 基本都出现在继承了类 GLSurfaceView 的情况下 , 出现死锁的位置一般是引用 egl.eglCreateWindowSurface(…) 或者 mEgl.eglSwapBuffers(…) 这两个方法的时候 . 避免出现 waitForCondition 的方法总结 : 在绘制线程中必须先合法的获取Surface 才能开始绘制内容,在SurfaceHolder.Callback.surfaceCreated() 和SurfaceHolder.Callback.surfaceDestroyed() 之间的状态为合法的,另外在Surface 类型为 SURFACE_TYPE_PUSH_BUFFERS 时候是不合法的.
Posted in Android, Mobile, 技术为本, 文摘转贴
Leave a comment
What’s this: __attribute__((packed))
今天在Android的代码里面看到了“__attribute__((packed))”,不清楚什么意思,上网搜了一下,大概明白了。就是让struct按照紧凑模式排列,中间不留任何缝隙。这样在不同的处理器,不同的网络传输等情况都不会出现对齐问题了。很好很强大。 参考链接:http://www.linuxquestions.org/questions/programming-9/whats-this-__attribute__-packed-193570/ 后面是摘录网页上的解释,写的很好。
Posted in Android, C&C++, 技术为本
Leave a comment
android.widget.Gallery getView, newView, bindView
在使用Gallery时,每一次bindView的同时也会有newView,这是Gallery的特殊性。从代码来看,Gallery从makeAndAddView里调用了 child = mAdapter.getView(position, null, this); 第二个参数是null,所以getView里面就调用了newView,然后bindView,而不是直接bindView。
Posted in Android, 技术为本
Leave a comment
undefined reference to `__cxa_end_cleanup’
在使用Android里面使用stlport的时候出现错误 undefined reference to `__cxa_end_cleanup’ 经查证,最后解决了该问题,是exception的问题。 去掉了try, catch和throw等语句,就OK了。 主要还要去掉:-fexceptions 后面附上参考链接。 http://groups.google.com/group/android-ndk/browse_thread/thread/3cde35eec53e0753?fwc=1&pli=1 http://groups.google.com/group/android-ndk/browse_thread/thread/a5dd86e985e191fc/dae0067602d7bd0c?pli=1 https://groups.google.com/group/android-ndk/browse_thread/thread/513d5ba12c8981d0/6b0958e8e16854a1?hl=fr&ie=UTF-8&q=undefined+reference+to+%60__cxa_end_cleanup%27&pli=1#6b0958e8e16854a1
Posted in Android, 技术为本
3 Comments
No module defined for the given PRODUCT_POLICY (android.policy_phone)
今天编译android的时候出现了一个编译错误: No module defined for the given PRODUCT_POLICY (android.policy_phone) frameworks/policies/base/PolicyConfig.mk:22: *** No module defined for the given PRODUCT_POLICY (android.policy_phone). Stop. 先是怀疑自己哪个地方改错了,经比对检查,都没问题。 最后发现根目录有个Android.mk,原来是它在作祟。 删除即可搞定。
分布式编译 – 加速Android的编译(尚未解决)。
由于Android的代码量太大,所以,编译需要很久,都是以小时为单位的。多核处理器能加速编译,但是一旦把-j4加上,全速用四核进行编译,那么其他事情就做不了了,一切都变得很缓慢。鉴于这种情况,有同事建议采用分布式编译,并推荐了distcc和windows下的IncrediBuild。 简单看了一下,加速编译是没有问题的,但是怎么用到Android的编译系统上,还有待考究。没有太多时间,暂时搁置吧。