Android缺乏手势问题

近来研究Android,发现里面有ScaleGestureDetector,竟然没有RotateGestureDetector。只能搜索到第三方的:

通过Guesture方法实现Rotate
http://code.almeros.com/android-multitouch-gesture-detectors#.Ufc2VRYzMgV
https://github.com/Almeros/android-gesture-detectors

直接再View上实现Rotate
https://github.com/MikeOrtiz/TouchImageView
https://github.com/jasonpolites/gesture-imageview
https://github.com/codepanda-ch/android-gestureimageview

官方的Scale例子
http://developer.android.com/training/gestures/scale.html

Android texture限制问题

问题描述:今天开发Make Face,调试时发现程序突然挂了,也没有报错。看了LogCat,看到如下log:
Bitmap too large to be uploaded into a texture (3264x2448, max=2048x2048)
问题分析:硬件加速的时候,对图片的大小有限制。不同设备可能有不同的最大值。
问题解决:方法有两种
第一种:关闭硬件加速
1.Application级别

<application android:hardwareAccelerated="true" ...>

2.Activity级别

<application android:hardwareAccelerated="true">
    <activity ... />
    <activity android:hardwareAccelerated="false" />
</application>

3.Window级别

getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);

4.View级别

myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

第二种:使用BitmapRegionDecoder加载
http://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html

Android的icon设计

应用程序图标 (Icon)应当是一个 Alpha 通道透明的32位 PNG 图片。由于安卓设备众多,一个应用程序图标需要设计几种不同大小,如:
LDPI (Low Density Screen,120 DPI),其图标大小为 36 x 36 px。
MDPI (Medium Density Screen, 160 DPI),其图标大小为 48 x 48 px。
HDPI (High Density Screen, 240 DPI),其图标大小为 72 x 72 px。
xhdpi (Extra-high density screen, 320 DPI),其图标大小为 96 x 96 px。

Android中的R.class

大家都知道R.class总是出问题,现在我来总结下问题,并如何排除。

一般问题:
1.在xml文件中代码错误或者格式错误
2.布局文件的文件名有大写字母
3.含有相同文件名、格式的xml文件

解决方法:
首先肯定是找到出错的原因并改正,然后可以执行以下任何一个方法更新R文件。
1.先执行project—clean,再执行Project--Build Automaticaly
2.右击你的工程(项目)——>Android Tools——>Fix Project Properties
3.修改string.xml,随便改动一下,可更新R文件