獲取手機引數

2021-09-10 07:15:51 字數 1915 閱讀 2850

1

//應用名稱

2 nsdictionary *infodictionary =[[nsbundle mainbundle] infodictionary];

cfbundledisplayname"];

4 nslog(@"

應用名稱:%@"5

6//版本號7 nsstring *shortversion = [infodictionary objectforkey:@"

cfbundleshortversionstring"];

8 nslog(@"

版本號:%@

",shortversion);910

//版本號(int型別)

11 nsstring *version = [infodictionary objectforkey:@"

cfbundleversion"];

12 nslog(@"

版本號(int型別):%@

",version);

1314

//手機識別符號

15 nsuuid* identifierforvendor =[[uidevice currentdevice] identifierforvendor];

16 nslog(@"

手機識別符號: %@

",identifierforvendor);

1718

//手機

19 cfuuidref uuidref =cfuuidcreate(kcfallocatordefault);

20 nsstring *uuid = (nsstring *)cfbridgingrelease(cfuuidcreatestring(kcfallocatordefault,uuidref));

21 nslog(@"

手機uuid: %@

",uuid);

2223

//系統

24 nsstring *systemname =[[uidevice currentdevice] systemname];

25 nslog(@"

系統: %@

",systemname );

2627

//手機系統版本

28 nsstring* systemversion =[[uidevice currentdevice] systemversion];

29 nslog(@"

手機系統版本: %@

", systemversion);

3031

//使用者手機名

32 nsstring* phonename =[[uidevice currentdevice] name];

33 nslog(@"

使用者手機名: %@

", phonename);

3435

//手機型號

36 nsstring *phonemodel =[[uidevice currentdevice] model];

37 nslog(@"

手機型號: %@

",phonemodel );

3839

//地方型號

40 nsstring *localizedmodel =[[uidevice currentdevice] localizedmodel];

41 nslog(@"

地方型號: %@

",localizedmodel);

【kingdev】

posted @

2016-03-21 09:48

kingdev 閱讀(

...)

編輯收藏

Android獲取手機螢幕引數的工具

package com.manny.utils created by manny on 2017 12 28.public class screenutils 獲得螢幕密度density public static float getdensity context context 獲得螢幕寬度 pu...

獲取手機資訊

獲取手機資訊 應用程式的名稱和版本號等資訊都儲存在mainbundle的乙個字典中,用下面 可以取出來 nsdictionary infodict nsbundle mainbundle infodictionary nsstring versionnum infodict objectforkey...

手機獲取座標

手機端獲取pagex和pagey touchstart事件下獲取 e.originalevent.targettouches 0 pagex。touchmove事件下獲取 e.originalevent.targettouches 0 pagex。touchend事件的下獲取 e.originale...