Android设备属性在android shell级别获得两个级别,在应用程序级别获得另一个级别

时间:2016-09-22 09:43:59

标签: java android

在shell级别我使用:

String productname = System.getProperty("ro.product.name")

获取属性 如果我必须在应用程序级别获取属性信息,我应该使用哪个命令。 我试过了

const callApiMiddleware = store => next => action => {
  // skip everything which is not API call
  const callAPI = action[CALL_API]
  if (typeof callAPI === 'undefined') {
    return next(action);
  }

  // the session info from store
  const session = store.getState().session;

  // perform request
  const {endpoint, headers, method} = callAPI;
  return fetch(endpoint, {
    headers: Object.assign({
        Authorization: `Bearer ${session && session.token}`
        // you can add more default headers there if you would like so
    }, headers),
    method
  });
};

并且没有错误,但它没有返回正确的值可能是什么原因。

1 个答案:

答案 0 :(得分:0)

String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

请参阅this了解更多