6种加快Android手机速度的方法

外边下雪

外边下雪

2016-03-31 14:49

有了下面这个6种加快Android手机速度的方法教程,不懂6种加快Android手机速度的方法的也能装懂了,赶紧get起来装逼一下吧!

6种加快Android手机速度的方法

 6种加快Android手机速度的方法 图老师

  众所周知,Android系统对硬件拥有较高的要求,可能你刚刚购买几个月的设备已经存在速度变慢、多任务处理卡顿的现象,其实通过一些小技巧,便能提升设备的运行速度,大家不妨参考一下。

  1. 卸载或禁用未使用的应用程序

小技巧:6种加快Android手机速度的方法

  我们使用智能手机时往往会在一开始安装大量的应用程序,但很多基本上没使用过几次,而这些应用会占据RAM以及存储空间,所以适当地卸载是很有必要的。只要进入设置,打开应用程序菜单,选择或禁用一些内容即可。另外,如果你的手机或平板支持存储卡扩展,也可以将应用安装到存储卡上。

  2. 清除应用程序缓存

  与其他类PC设备一样,累积的缓存都会在一定程度上影响设备性能,定期清理也是十分必要的。你可以选择在应用程序菜单中进行,也可以通过安装类似手机助手类的免费软件来实现。

  3. 不使用动态壁纸和小部件

  一些具有实时刷新功能的小部件,实际上会一直在后台运行,不仅占据了宝贵的RAM,还会消耗流量、影响电池寿命,所以尽量减少此类数据密集型应用的小部件,主要以社交和新闻应用为主。

  Android系统另一个很酷的地方是可以使用动态壁纸功能,但与小部件一样,会增加功耗TuLaoShi.com并减少电池寿命,建议使用静态壁纸。

  4. 禁用动画效果

  一些Android设备都内置了动画效果,实际上这也在一定程度上影响了性能。一些采用自定义界面的机型可以在显示项目中直接关闭动画效果,原生机型也可以通过进行开发者选项,关闭窗口、过渡等动画模式。

小技巧:6种加快Android手机速度的方法

  5. 获得软件更新

  通常情况下,主流的设备制造商都会定期推出固件更新,修复Bug并提升性能,所以在确保新固件稳定的情况下,选择升级也是不错的方法。在设备的关于手机项目中,可以找到系统在线更新的项目。

  6. Root或使用第三方Rom

  Root或是刷第三方固件会存在一定的风险,并不建议新手尝试。设备Root之后,能够获得最大的权限,实现超频等操作;安装自定义固件则拥有更多选择性,一些剔除了内置软件版本的简化版固件往往拥有更快的速度。需要提醒大家的是,这些操作具有一定的风险,有可能会将设备刷成砖头,同时保修服务也会失效。

Android开发之OpenGL ES 3D空间与glDrawArrays

Tulaoshi.Com

  1.四棱锥: 由4个三角形构成。

  四方体: 由6个三角形构成。

  难点:在构建3D空间的顶点坐标时,要让对象绕自身的轴旋转,必须让对象的中心坐标总是(0.0f,0.0f,0.0f),

  并且三角形都是按逆时针次序绘制的。

  2.3D空间的绘制:

  GL_APICALL void GL_APIENTRY glDrawATuLaoShi.comrrays (GLenum mode, GLint first, GLsizei count);

  参数说明:

  mode,绘制方式,OpenGL2.0以后提供以下参数:GL_POINTS、GL_LINES、GL_LINE_LOOP、GL_LINE_STRIP、GL_TRIANGLES、GL_TRIANGLE_STRIP、GL_TRIANGLE_FAN。

  first,从数组缓存中的哪一位开始绘制,一般为0。

  count,数组中顶点的数量。

  3.绘制顶点数组:

  //绘制三角锥

  for(int i=0; i4; i++)

  {

  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, i*3, 3);

  }

  //绘制四方体

  for(int i=0; i6; i++)

  {

  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, i*4, 4);

  }

  [附]构建顶点数组:

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  int one = 0x10000;

  // 四棱锥顶点数组:

  private IntBuffer triggerBuffer = IntBuffer.wrap(new int[]{

  0,one,0,

  -one,-one,0,

  one,-one,one,

  0,one,0,

  one,-one,one,

  one,-one,-one,

  0,one,0,

  one,-one,-one,

  -one,-one,-one,

  0,one,0,

  -one,-one,-one,

  -one,-one,one

  });

  // 四方体顶点数组:

  private IntBuffer quaterBuffer = IntBuffer.wrap(new int[]{

  one,one,-one,

  -one,one,-one,

  one,one,one,

  -one,one,one,

  one,-one,one,

  -one,-one,one,

  one,-one,-one,

  -one,-one,-one,

  one,one,one,

  -one,one,one,

  one,-one,one,

  -one,-one,one,

  one,-one,-one,

  -one,-one,-one,

  one,one,-one,

  -one,one,-one,

  -one,one,one,

  -one,one,-one,

  -one,-one,one,

  -one,-one,-one,

  one, one, -one,

  one, one, one,

  one, -one, -one,

  one, -one, one,

  });

  int one = 0x10000;

  // 四棱锥顶点数组:

  private IntBuffer triggerBuffer = IntBuffer.wrap(new int[]{

  0,one,0,

  -one,-one,0,

  one,-one,one,

  0,one,0,

  one,-one,one,

  one,-one,-one,

  0,one,0,

  one,-one,-one,

  -one,-one,-one,

  0,one,0,

  -one,-one,-one,

  -one,-one,one

  });

  // 四方体顶点数组:

  private IntBuffer quaterBuffer = IntBuffer.wrap(new int[]{

  one,one,-one,

  -one,one,-one,

  one,one,one,

  -one,one,one,

  one,-one,one,

  -one,-one,one,

  one,-one,-one,

  -one,-one,-one,

  one,one,one,

  -one,one,one,

  one,-one,one,

  -one,-one,one,

  one,-one,-one,

  -one,-one,-one,

  one,one,-one,

  -one,one,-one,

  -one,one,one,

  -one,one,-one,

  -one,-one,one,

  -one,-one,-one,

  one, one, -one,

  one, one, one,

  one, -one, -one,

  one, -one, one,

  });

Android开发之OpenGL ES 颜色

  一、基础知识:

  1.平滑着色(Smooth coloring):

  将多个顶点的不同颜色混合在一起,创建出漂亮的色彩混合。

  2.单调着色:

  给图形涂上一种固定单一的颜色。

  3.三角形定义的颜色数组(平滑着色):

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  int one = 0x10000;

  //三角形的顶点颜色值(r,g,b,a)

  private IntBuffer colorBuffer = IntBuffer.wrap(new int[]{

  one,0,0,one,

  0,one,0,one,

  0,0,one,one,

  });

  int one = 0x10000;

  //三角形的顶点颜色值(r,g,b,a)

  private IntBuffer colorBuffer = IntBuffer.wrap(new int[]{

  one,0,0,one,

  0,one,0,one,

  0,0,one,one,

  });

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  // 开启颜色渲染功能.

  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

  // 设置三角形顶点的颜色

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  gl.glColorPointer(4, GL10.GL_FIXED, 0, colorBuffer);

  //关闭颜色渲染功能.

  gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

  // 开启颜色渲染功能.

  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

  // 设置三角形顶点的颜色

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  gl.glColorPointer(4, GL10.GL_FIXED, 0, colorBuffer);

  //关闭颜色渲染功能.

  gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

  4.正方形定义的颜色数组(单调着色):

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  /* 渲染正方形 */

  // 设置当前色为蓝色

  gl.glColor4f(1.0f, 0.5f, 1.0f, 1.0f);

  /* 渲染正方形 */

  // 设置当前色为蓝色

  gl.glColor4f(1.0f, 0.5f, 1.0f, 1.0f);

  二、代码编辑:

  

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  package com.yarin.android.Examples_12_02;

  import android.app.Activity;

  import android.opengl.GLSurfaceView;

  import android.opengl.GLSurfaceView.Renderer;

  import android.os.Bundle;

  public class Activity01 extends Activity

  {

  Renderer render = new GLRender();

  /** Called when the activity is first created. */

  @Override

  public void onCreate(Bundle savedInstanceState)

  {

  super.onCreate(savedInstanceState);

  GLSurfaceView glView = new GLSurfaceView(this);

  glView.setRenderer(render);

  setContentView(glView);

  }

  }

  package com.yarin.android.Examples_12_02;

  import android.app.Activity;

  import android.opengl.GLSurfaceView;

  import android.opengl.GLSurfaceView.Renderer;

  import android.os.Bundle;

  public class Activity01 extends Activity

  {

  Renderer render = new GLRender();

  /** Called when the activity is first created. */

  @Override

  public void onCreate(Bundle savedInstanceState)

  {

  super.onCreate(savedInstanceState);

  GLSurfaceView glView = new GLSurfaceView(this);

  glView.setRenderer(render);

  setContentView(glView);

  }

  }

  

  [java]

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  package com.yarin.android.Examples_12_02;

  import java.nio.IntBuffer;

  import javax.microedition.khronos.egl.EGLConfig;

  import javax.microedition.khronos.opengles.GL10;

  import android.opengl.GLSurfaceView.Renderer;

  public class GLRender implements Renderer

  {

  int one = 0x10000;

  //三角形三个顶点

  private IntBuffer triggerBuffer = IntBuffer.wrap(new int[]{

  0,one,0, //上顶点

  -one,-one,0, //坐下点

  one,-one,0,}); //右下点

  //正方形的4个顶点

  private IntBuffer quaterBuffer = IntBuffer.wrap(new int[]{

  one,one,0,

  -one,one,0,

  one,-one,0,

  -one,-one,0});

  //三角形的顶点颜色值(r,g,b,a)

  private IntBuffer colorBuffer = IntBuffer.wrap(new int[]{

  one,0,0,one,

  0,one,0,one,

  0,0,one,one,

  });

  @Override

  public void onDrawFrame(GL10 gl)

  {

  // 清除屏幕和深度缓存

  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

  // 重置当前的模型观察矩阵

  gl.glLoadIdentity();

  // 左移 1.5 单位,并移入屏幕 6.0

  gl.glTranslatef(-1.5f, 0.0f, -6.0f);

  //设置定点数组

  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

  //设置颜色数组 -- 开启颜色渲染功能.

  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

  // 设置三角形顶点的颜色

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  gl.glColorPointer(4, GL10.GL_FIXED, 0, colorBuffer);

  // 设置三角形顶点

  gl.glVertexPointer(3, GL10.GL_FIXED, 0, triggerBuffer);

  //绘制三角形

  gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);

  //关闭颜色数组 -- 关闭颜色渲染功能.

  gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

  /* 渲染正方形 */

  // 设置当前色为蓝色

  gl.glColor4f(1.0f, 0.5f, 1.0f, 1.0f);

  // 重置当前的模型观察矩阵

  gl.glLoadIdentity();

  // 左移 1.5 单位,并移入屏幕 6.0

  gl.glTranslatef(1.5f, 0.0f, -6.0f);

  //设置和绘制正方形

  gl.glVertexPointer(3, GL10.GL_FIXED, 0, quaterBuffer);

  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

  //取消顶点数组

  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);

  }

  @Override

  public void onSurfaceChanged(GL10 gl, int width, int height)

  {

  // TODO Auto-generated method stub

  float ratio = (float) width / height;

  //设置OpenGL场景的大小

  gl.glViewport(0, 0, width, height);

  //设置投影矩阵

  gl.glMatrixMode(GL10.GL_PROJECTION);

  //重置投影矩阵

  gl.glLoadIdentity();

  // 设置视口的大小

  gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);

  // 选择模型观察矩阵

  gl.glMatrixMode(GL10.GL_MODELVIEW);

  // 重置模型观察矩阵

  gl.glLoadIdentity();

  }

  @Override

  public void onSurfaceCreated(GL10 gl, EGLConfig config)

  {

  // 启用阴影平滑

  gl.glShadeModel(GL10.GL_SMOOTH);

  // 黑色背景

  gl.glClearColor(0, 0, 0, 0);

  // 设置深度缓存

  gl.glClearDepthf(1.0f);

  // 启用深度测试

  gl.glEnable(GL10.GL_DEPTH_TEST);

  // 所作深度测试的类型

  gl.glDepthFunc(GL10.GL_LEQUAL);

  // 告诉系统对透视进行修正

  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);

  }

  }

  package com.yarin.android.Examples_12_02;

  import java.nio.IntBuffer;

  import javax.microedition.khronos.egl.EGLConfig;

  import javax.microedition.khronos.opengles.GL10;

  import android.opengl.GLSurfaceView.Renderer;

  public class GLRender implements Renderer

  {

  int one = 0x10000;

  //三角形三个顶点

  private IntBuffer triggerBuffer = IntBuffer.wrap(new int[]{

  0,one,0, //上顶点

  -one,-one,0, //坐下点

  one,-one,0,}); //右下点

  //正方形的4个顶点

  private IntBuffer quaterBuffer = IntBuffer.wrap(new int[]{

  one,one,0,

  -one,one,0,

  one,-one,0,

  -one,-one,0});

  //三角形的顶点颜色值(r,g,b,a)

  private IntBuffer colorBuffer = IntBuffer.wrap(new int[]{

  one,0,0,one,

  0,one,0,one,

  0,0,one,one,

  });

  @Override

  public void onDrawFrame(GL10 gl)

  {

  // 清除屏幕和深度缓存

  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

  // 重置当前的模型观察矩阵

  gl.glLoadIdentity();

  // 左移 1.5 单位,并移入屏幕 6.0

  gl.glTranslatef(-1.5f, 0.0f, -6.0f);

  //设置定点数组

  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

  //设置颜色数组 -- 开启颜色渲染功能.

  gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

  // 设置三角形顶点的颜色

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/android/)

  gl.glColorPointer(4, GL10.GL_FIXED, 0, colorBuffer);

  // 设置三角形顶点

  gl.glVertexPointer(3, GL10.GL_FIXED, 0, triggerBuffer);

  //绘制三角形

  gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);

  //关闭颜色数组 -- 关闭颜色渲染功能.

  gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

  /* 渲染正方形 */

  // 设置当前色为蓝色

  gl.glColor4f(1.0f, 0.5f, 1.0f, 1.0f);

  // 重置当前的模型观察矩阵

  gl.glLoadIdentity();

  // 左移 1.5 单位,并移入屏幕 6.0

  gl.glTranslatef(1.5f, 0.0f, -6.0f);

  //设置和绘制正方形

  gl.glVertexPointer(3, GL10.GL_FIXED, 0, quaterBuffer);

  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

  //取消顶点数组

  gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);

  }

  @Override

  public void onSurfaceChanged(GL10 gl, int width, int height)

  {

  // TODO Auto-generated method stub

  float ratio = (float) width / height;

  //设置OpenGL场景的大小

  gl.glViewport(0, 0, width, height);

  //设置投影矩阵

  gl.glMatrixMode(GL10.GL_PROJECTION);

  //重置投影矩阵

  gl.glLoadIdentity();

  // 设置视口的大小

  gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);

  // 选择模型观察矩阵

  gl.glMatrixMode(GL10.GL_MODELVIEW);

  // 重置模型观察矩阵

  gl.glLoadIdentity();

  }

  @Override

  public void onSurfaceCreated(GL10 gl, EGLConfig config)

  {

  // 启用阴影平滑

  gl.glShadeModel(GL10.GL_SMOOTH);

  // 黑色背景

  gl.glClearColor(0, 0, 0, 0);

  // 设置深度缓存

  gl.glClearDepthf(1.0f);

  // 启用深度测试

  gl.glEnable(GL10.GL_DEPTH_TEST);

  // 所作深度测试的类型

  gl.glDepthFunc(GL10.GL_LEQUAL);

  // 告诉系统对透视进行修正

  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);

  }

  }

  三、运行效果:

Android开发之OpenGL ES 颜色 图老师
展开更多 50%)
分享

猜你喜欢

6种加快Android手机速度的方法

Android
6种加快Android手机速度的方法

如何加快开机速度?

电脑入门
如何加快开机速度?

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Windows 7系统中加快启动速度的方法

电脑入门
Windows 7系统中加快启动速度的方法

iPhone手机加快充电方法教程

iphone iPhone 5s iPhone 6 iphone刷机
iPhone手机加快充电方法教程

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

HTML优化加快网页速度

Web开发
HTML优化加快网页速度

Windows 7加快系统速度的9大方法

电脑入门
Windows 7加快系统速度的9大方法

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

iPhone越狱后访问限制密码忘了怎么办

iPhone越狱后访问限制密码忘了怎么办

安卓手机呼叫等待怎么设置?

安卓手机呼叫等待怎么设置?
下拉加载更多内容 ↓