NDK获取android下sd card id

int getAndroidDeviceID_SDID(char *deviceID,int size)//sd card id
{
  FILE *fp = fopen("/sys/block/mmcblk1/device/cid", "rb");//地址是可选项
  if ( fp ) 
  {
    fread(deviceID,1,size, fp);
    fclose( fp );
    if (strlen(deviceID) != 0)
    {
      return 1;
    }
  }
  return 0;
}

 

posted @ 2013-04-02 10:58  da  阅读(855)  评论(0编辑  收藏  举报