---
title: "获取android系统CPU信息"
author: "chenpeilei2003"
date: "2013-11-28T10:16:43Z"
tags: []
categories: ["移动开发"]
slug: "android-cpu"
draft: false
lastmod: "2013-11-28T10:16:43Z"
id: 1982209
url: "https://chenpeilei2003.iteye.com/blog/1982209"
---

```
要根据CPU情况，选择合适的视频编码。 用这个方法可以很容易读出来。

private String getInfo() {
		StringBuffer sb = new StringBuffer();
		sb.append("abi: ").append(Build.CPU_ABI).append("\n");
		if (new File("/proc/cpuinfo").exists()) {
			try {
				BufferedReader br = new BufferedReader(new FileReader(new File(
						"/proc/cpuinfo")));
				String aLine;
				while ((aLine = br.readLine()) != null) {
					sb.append(aLine + "\n");
				}
				if (br != null) {
					br.close();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return sb.toString();
	}
```