安卓手机在拨号栏输入什么能查看自己的手机硬件

安卓手机在拨号栏输入什么能查看自己的手机硬件,第1张

#12580369# 显示PDA,Phone,H/W,第一次打电话,内存,CSC信息。

##49862650468## PDA、 Phone、 H/W、 RFCallDate 。

##1234## 显示PDA 及 Phone等固件信息 。

##1111## FTA SW 版本 。

##2222## FTA HW 版本 。

##44336## PDA 、Phone、 CSC、 Build Time、 Changelist number 。

#06# 显示IMEI号。

拓展:

##0283## Audio Loopback Control。

##0## LCD 测试。

##0289## Melody 测试。

##0842## 装置测试,例如振动、亮度。

##2663## 触控屏幕版本。

##2664## 触控屏幕测试。

##0588## 接近感应器测试。

#0589# 背光灯感应器测试。

##3264## 内存版本。

#0782# 实时时钟测试。

#0673# 声音测试模式。

#0# 通用测试。

游戏的制作如播放**,拥有四大核心,包括: 导演、场景、图层、演员 。通过它们之间的不同配合,实现丰富多彩的效果。

public class CocosActivity extends AppCompatActivity {

private CCDirector mCcDirector;

@Override

protected void onCreate(Bundle savedInstanceState) {

superonCreate(savedInstanceState);

CCGLSurfaceView ccglSurfaceView =new CCGLSurfaceView(this);

setContentView(ccglSurfaceView);

导演,全局只有一个,单例模式创建

mCcDirector = CCDirectorsharedDirector();

开启绘制(开始拍**)

mCcDirectorattachInView(ccglSurfaceView);

帧率,每秒刷新的次数,与手机性能有关

//ccDirectorsetDisplayFPS(true);

设置帧率为60(记得把帧率文件放进项目中)

//ccDirectorsetAnimationInterval(1/60f);

设置横屏

//ccDirectorsetDeviceOrientation(CCDirectorkCCDeviceOrientationLandscapeLeft);

屏幕适配,会基于不同屏幕大小进行适配

mCcDirectorsetScreenSize(1920,1080);

场景

CCScene ccScene = CCScenenode();

图层

CCLayer ccLayer =CCLayernode();

给场景添加图层

ccSceneaddChild(ccLayer);

导演运行场景

mCcDirectorrunWithScene(ccScene);

}

@Override

protected void onResume() {

superonResume();

mCcDirectoronResume();

}

@Override

protected void onPause() {

superonPause();

mCcDirectoronPause();

}

@Override

protected void onDestroy() {

superonDestroy();

mCcDirectorend();

}

1、平移

参数1是移动时间,参数2是目标位置坐标,ccp方法是把坐标转换为cocos2d的坐标

CCMoveTo ccMoveTo = CCMoveToaction(3,ccp(200,0));

与上不同的是,第2个参数代表水平移动200,竖直不移动,即偏移量

CCMoveBy ccMoveBy =CCMoveByaction(3,ccp(200,0));

2、旋转

参数1时间,参数2角度,旋转中心是左下角的点,顺时针转

CCRotateBy ccRotateBy =CCRotateByaction(3,360);

与上不同的是,逆时针转(捷径,顺时针转270==逆时针转90)

CCRotateTo ccRotateTo =CCRotateToaction(3,270);

3、缩放

参数1时间,参数2X方向缩放,参数3Y方向缩放

CCScaleBy ccScaleBy =CCScaleByaction(3,2,2);

参数1时间,参数2缩放

CCScaleTo ccScaleTo =CCScaleToaction(3,2);

4、跳跃(参数1时间,参数2目标点,参数3跳跃高度,参数4跳跃次数)

CCJumpBy ccJumpBy =CCJumpByaction(3,ccp(0,0),100,3);

5、淡入淡出(参数是时间)

CCFadeIn ccFadeIn =CCFadeInaction(2);

CCFadeOut ccFadeOut =CCFadeOutaction(2);

6、贝塞尔曲线

点的含义,从point1出发,经过point2,到达endPosition

CCBezierConfig ccBezierConfig =new CCBezierConfig();

ccBezierConfig controlPoint_1 =ccp(100,50);

ccBezierConfig controlPoint_2 =ccp(200,200);

ccBezierConfig endPosition =ccp(300,100);

CCBezierBy ccBezierBy =CCBezierByaction(2,ccBezierConfig);

7、加速度

CCMoveBy ccMoveBy =CCMoveByaction(2,ccp(100,100));

渐快渐慢,参数2是加速度

CCEaseIn ccEaseIn =CCEaseInaction( ccMoveBy ,5);

CCEaseOut ccEaseOut =CCEaseOutaction( ccMoveBy ,5);

8、闪烁(时间,闪烁次数)

CCBlink ccBlink =CCBlinkaction(2,10);

9、文字(参1是显示的文字,参2是字体格式(可不填,如""),参数3是字体大小)

CCLabel ccLabel = CCLabellabelWithString("显示文字","STCAIYUNTTF",20);

设置文字颜色

ccColor3B ccColor3B =ccc3(100,50,0);

ccLabelsetColor(ccColor3B );

设置文字位置

ccLabelsetPosition(ccp(width,height));

重置文字

ccLabelsetString("显示文字");

颜色渐变(从本来的文字颜色渐变到设置的字体颜色)

CCTintBy tintBy =CCTintByaction(3,ccc3(50,-50,100));

10、循环(参数是动画效果)

CCRepeatForever ccRepeatForever =CCRepeatForeveraction(action);

11、延迟(参数是时间)

CCDelayTime ccDelayTime =CCDelayTimeaction(1);

12、反转(将一个动画倒序执行)

ccJumpByreverse();

13、同时(参数是不定长度数组)

CCSpawn ccSpawn =CCSpawnactions(action1,action2);

14、连续动画(参数是不定长度数组)

CCSequence ccSequence =CCSequenceactions(action1,action2, ccCallFunc ");

15、反射(执行一个动画方法)

CCCallFunc action(this," anim ");

被反射的执行方法

public void anim (){} 

16、逐帧动画

public void walk(){

存放帧动画的集合

ArrayList ccSpriteFrames =new ArrayList<>();

String format="z_1_%dpng";  // %d和%02d代表整数,用i来取代,%d只取代i,%02d会补0

for(int i=1;i<10;i++){

CCSprite ccSprite =CCSpritesprite(Stringformat(format,i));

CCSpriteFrame ccSpriteFrame =ccSpritedisplayedFrame();

ccSpriteFramesadd(ccSpriteFrame );

}

参数1是动画名称,参数2是每一帧停留的时间,参数3是帧动画集合

CCAnimation ccAnimation =CCAnimationanimation("walk",2f,ccSpriteFrames);

参数2是否持续执行动画,如果想执行无限循环,可以使用CCRepeatForever

CCAnimate ccAnimate =CCAnimateaction(ccAnimation,false);

mCcSpriterunAction(ccAnimate);

}

17、隐藏

CCHide ccHide =CCHideaction();

18、显示

CCShow ccShow =CCShowaction();

19、跟随(参数是跟随的对象)

CCFollow  ccFollow =CCFollowaction(mCCSprite);

20、执行动画(上述皆是)

mCcSpriterunAction(action);

21、工具类使用

CGPointUtil distance(point1,point2); //计算两点距离

获取声音引擎

SoundEngine engine =SoundEnginesharedEngine();

参数1是activity,SurfaceView创建时存入,参2是播放资源id(res\raw),参数3是否循环播放

engineplaySound(CCDirectortheApp,1,true);

手动停止音乐播放

enginerealesAllSounds();

生命周期跟随Activity

SoundEnginesharedEngine()resumeSound();

SoundEnginesharedEngine()pauseSound();

SoundEnginesharedEngine()realesAllSounds();

预加载播放音乐,避免播放音乐时没声音

SoundEnginesharedEngine()preloadEffect();

SoundEnginesharedEngine()preloadSound();

1、创建

CCSprite mCcSprite =new CCSprite(" picjpeg ");

2、锚点(上的一点,类似图钉,对应显示的位置)

CGPoint cgPoint =ccp(0,0);

mCcSpritesetAnchorPoint(cgPoint);

3、位置

mCcSpritesetPosition(cgPoint);

4、属性(缩放、翻转、透明度)

ccSpritesetFlipX(true); 水平翻转

ccSpritesetOpacity(255); 透明度

ccSpritesetScale(2); 缩放

5、移除(在Layer里面 *** 作)

mCcSpriteremoveSelf();  //精灵从图层中移除

( Layer )thisremoveSelf(); // 移除整个图层

6、尺寸

CGSize  cgSize =CCDirectorsharedDirector()winSize();

1、游戏暂停(图层静止,将不再响应任何事件)

MapLayerthisonExit(); 

注意:因为图层不再响应任何事件,所以暂停按钮应该加在暂停图层的父图层上

thisgetParent()addChild(new PauseLayer());

2、游戏继续(图层恢复动态,接收点击事件)

MapLayerthisonEnter(); 

通用的游戏继续方法

CCDirectorsharedDirector()getRunningScene()onEnter();

3、定时器

CCScheduler ccScheduler =CCSchedulersharedScheduler();

通过反射执行方法

ccSchedulerschedule(" onScheduler ",this,2,false);

方法声明为公开类型

public void  onScheduler (float f){ //实现具体逻辑

};

4、进度条

CCProgressTimer ccProgressTimer =CCProgressTimerprogressWithFile(" image/picjpeg "); //多层目录

ccProgressTimersetPosition(width,height);

thisgetParent()addChild(ccProgressTimer);  //具体加到什么图层,看情况

ccProgressTimersetScale(06f);

ccProgressTimersetPercentage(2);

设置显示样式(垂直,水平)->(最后2个字母,left,right,代表进度条从左往右)

ccProgressTimersetType(CCProgressTimerkCCProgressTimerTypeHorizontalBar LR );

进度条外框 等元素,都作为精灵与进度条同级加入图层

thisgetParent()addChild(sprite);

Android坐标系的(0,0)在左上角,而Cocos2d-x坐标系的(0,0)在左下角。所以在处理Android的点击事件MotionEvent时,需要进行坐标体系的转换。

CGPoint cgPoint = convertPrevTouchToNodeSpace (event);

监听的点击范围,自定义封装点击事件

CGRect containsPoint( mCcSpritegetBoundingBox() , cgPoint );

CCMenu ccMenu =CCMenumenu();

CCSprite normalSprite =CCSpritesprite("pic_1jpeg"); //正常情况下显示的

CCSprite selectSprite =CCSpritesprite("pic_2jpeg"); //按下时显示的

注意:反射的方法需要使用pulbic修饰,参数指target,直接传this,它不是上下文Context

CCMenuItemSprite itemSprite =CCMenuItemSpriteitem( normalSprite , selectSprite , this ," onCLick ");

ccMenuaddChild( itemSprite );

thisaddChild(ccMenu); //菜单添加到图层

public void onCLick (Object obj){}  //点击事件响应方法,必须用public修饰以及带参数

setIsTouchEnabled(true); //打开图层点击事件,默认关闭

模仿任何天气现象,只需要改这一句,剩下的不变

CCParticleSystem ccParticleSystem= CCParticleSnownode();

设置雪花大小

ccParticleSystemsetScale(2);

设置飘落的速度

ccParticleSystemsetSpeed(10);

设置雪花的

ccParticleSystemsetTexture(CCTextureCachesharedTextureCache()addImage("snowpng"));

thisaddChild(ccParticleSystem,1);

停止粒子系统(下雪)

ccParticleSystemstopSystem();

1、加载地图

 ArrayList mCGPoints = new ArrayList<>();

CCTMXTiledMap mCctmxTiledMap = CCTMXTiledMaptiledMap(" maptmx ");

mCctmxTiledMapsetAnchorPoint(ccp(05f,0f));

mCctmxTiledMapsetPosition(width,height);

CCTMXObjectGroup cctmxObjectGroup= mCctmxTiledMapobjectGroupNamed("road"); 

ArrayList<HashMap<String,String>> objects = cctmxObjectGroupobjects;

for(HashMap<String,String> hashMap:objects){  //加载地图的坐标(需要经过的坐标点)

Integer x =IntegerparseInt(hashMapget("x"));

Integer y =IntegerparseInt(hashMapget("y"));

CGPoint cgPoint =ccp(x,y);

mCGPoints add(cgPoint);  }

thisaddChild(mCctmxTiledMap);

在地图上添加精灵

mCCSpritesetPosition(mCGPointsget(0));

mCctmxTiledMapaddChild(mCCSprite);

地图跟随精灵的移动而移动

CCFollow ccFollow =CCFollowaction(mCCSprite);

mCctmxTiledMap runAction(ccFollow);

2、地图随手指触摸事件移动(重写触摸方法)

@Override

public boolean ccTouchesMoved(MotionEvent event) {

手指拖拽时,地图随手指移动

mCctmxTiledMaptouchMove(event,mCctmxTiledMap);

地图移动,地图上所有精灵都随之移动(地图是父亲,精灵是孩子)

mCctmxTiledMapaddChild(mCCSprite);

return superccTouchesMoved(event);

}

创建场景

CCScene ccScene =CCScenenode();

场景添加图层

ccSceneaddChild(ccLayer);

场景切换特效

CCJumpZoomTransition ccJumpZoomTransition =CCJumpZoomTransitiontransition(2,ccScene);

导演切换场景

CCDirectorsharedDirector() replaceScene (ccJumpZoomTransition);

CopyOnWrite容器即写时复制的容器。通俗的理解是当我们往一个容器添加元素的时候,不直接往当前容器添加,而是先将当前容器进行Copy,复制出一个新的容器,然后新的容器里添加元素,添加完元素之后,再将原容器的引用指向新的容器。这样做的好处是我们可以对CopyOnWrite容器进行并发的读,而不需要加锁,因为当前容器不会添加任何元素。所以CopyOnWrite容器也是一种读写分离的思想,读和写不同的容器。用法和ArrayList相近。

CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList();

setIsTouchEnabled(true); //打开点击事件

@Override

public boolean ccTouchesBegan (MotionEvent event) {

return superccTouchesBegan(event);

}

@Override

public boolean ccTouchesCancelled (MotionEvent event) {

return superccTouchesCancelled(event);

}

@Override

public boolean ccTouchesMoved (MotionEvent event) {

return superccTouchesMoved(event);

}

@Override

public boolean ccTouchesEnded (MotionEvent event) {

return superccTouchesEnded(event);

}

描述:UI频繁刷新,造成主线程的堵塞或挂起

private CCGLSurfaceView mCCGLSurfaceView;

mCCGLSurfaceView = (CCGLSurfaceView) CCDirectorsharedDirector()getOpenGLView();

mCCGLSurfaceViewqueueEvent(new Runnable() {

@Override

public void run() { //切换到主线程

}

});

描述:CCSprite运行动画时,没有表现出任何视觉效果。

原因:一个动画只能被一个CCSprite执行一次,执行完成后,原来的动画会失效。

解决:每次执行的动画,都需要重新生成,即使是相同的动画效果。

缓存:CCDirectorsharedDirector()purgeCachedData();

1、首先,打开手机桌面上的“设置”应用图标,打开手机设置界面。

2、打开手机设置页面之后,点击页面中的“双卡和移动网络”选项。

3、接下来,选择使用上网功能的那张手机卡,点击进入设置页面。

4、在接下来打开的页面中,点击“接入点名称”选项。

5、选择需要的接入点APN,然后即可完成设置。最好使用系统默认的接入点,不要自行更改接入点,以免导致无法访问网络。

扩展资料:

Android的系统架构和其 *** 作系统一样,采用了分层的架构。从架构图看,Android分为四个层,从高层到低层分别是应用程序层、应用程序框架层、系统运行库层和Linux内核层。

应用程序

Android会同一系列核心应用程序包一起发布,该应用程序包包括客户端,SMS短消息程序,日历,地图,浏览器,联系人管理程序等。所有的应用程序都是使用JAVA语言编写的。

应用程序框架

开发人员也可以完全访问核心应用程序所使用的API框架。该应用程序的架构设计简化了组件的重用;任何一个应用程序都可以发布它的功能块并且任何其它的应用程序都可以使用其所发布的功能块。同样,该应用程序重用机制也使用户可以方便的替换程序组件。

隐藏在每个应用后面的是一系列的服务和系统, 其中包括;

丰富而又可扩展的视图(Views),可以用来构建应用程序, 它包括列表(Lists),网格(Grids),文本框(Text boxes),按钮(Buttons), 甚至可嵌入的web浏览器。

内容提供器(Content Providers)使得应用程序可以访问另一个应用程序的数据(如联系人数据库), 或者共享它们自己的数据

资源管理器(Resource Manager)提供 非代码资源的访问,如本地字符串,图形,和布局文件(Layout files )。

通知管理器 (Notification Manager) 使得应用程序可以在状态栏中显示自定义的提示信息。

活动管理器( Activity Manager) 用来管理应用程序生命周期并提供常用的导航回退功能。

手机使用IMEI和IMSI登录到GSM网络的,由GSM网络侧负责将IMSI和映射成手机号(MSISDN),以及执行相反方向的映射。

(一)、SIM card 号的修改:

SIM card号就是印制在SIM上的一串数字。

读SIM card号的AT命令为:AT+CRSM=176,12258,0,0,10

因此在andorid模拟其源码中找到该AT命令——在sim_cardc中:

const char

asimcard_io( ASimCard sim, const char cmd )

{

int nn;

#if ENABLE_DYNAMIC_RECORDS

int command, id, p1, p2, p3;

#endif

static const struct { const char cmd; const char answer; } answers[] =

{

{ "+CRSM=192,28436,0,0,15", "+CRSM: 144,0,000000146f1404001aa0aa01020000" },

{ "+CRSM=176,28436,0,0,20", "+CRSM: 144,0,416e64726f6964ffffffffffffffffffffffffff" },

{ "+CRSM=192,28433,0,0,15", "+CRSM: 144,0,000000016f11040011a0aa01020000" },

{ "+CRSM=176,28433,0,0,1", "+CRSM: 144,0,55" },

{ "+CRSM=192,12258,0,0,15", "+CRSM: 144,0,0000000a2fe204000fa0aa01020000" },

{ "+CRSM=176,12258,0,0,10", "+CRSM: 144,0,98101430121181157002" },

因此用UE二进制方式打开emulator-armexe 或 emulator-x86exe,并搜索字符串“98101430121181157002”,然后将其修改成需要的SIM card号。

比如:

00209a00h: 31 30 00 00 2B 43 52 53 4D 3A 20 31 34 34 2C 30 ; 10+CRSM: 144,0

00209a10h: 2C 39 38 31 30 31 34 33 30 31 32 31 31 38 31 31 ; ,981014301211811

00209a20h: 35 37 30 30 32 00 2B 43 52 53 4D 3D 31 39 32 2C ; 57002+CRSM=192,

(二)、IMEI、IMSI号的修改:

Java代码中获取手机的IMEI号与ISMI号途径为:

TelephonyManager manager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);

String imei = managergetDeviceId();

String imsi = managergetSubscriberId();

在android的源码树中找到类TelephonyManager的实现:

成员函数getDeviceId:

/

Returns the unique device ID, for example, the IMEI for GSM and the MEID

or ESN for CDMA phones Return null if device ID is not available

<p>Requires Permission:

{@link androidManifestpermission#READ_PHONE_STATE READ_PHONE_STATE}

/

public String getDeviceId() {

try {

return getSubscriberInfo()getDeviceId();

} catch (RemoteException ex) {

return null;

} catch (NullPointerException ex) {

return null;

}

}

成员函数getSubscriberId:

/

Returns the unique subscriber ID, for example, the IMSI for a GSM phone

Return null if it is unavailable

<p>

Requires Permission:

{@link androidManifestpermission#READ_PHONE_STATE READ_PHONE_STATE}

/

public String getSubscriberId() {

try {

return getSubscriberInfo()getSubscriberId();

} catch (RemoteException ex) {

return null;

} catch (NullPointerException ex) {

// This could happen before phone restarts due to crashing

return null;

}

}

上面两个成员函数最终调用共同的一个私有成员函数getSubscriberInfo():

private IPhoneSubInfo getSubscriberInfo() {

// get it each time because that process crashes a lot

return IPhoneSubInfoStubasInterface(ServiceManagergetService("iphonesubinfo"));

}

而上面私有函数getSubscriberInfo获取的手机IMSI和IMEI号被硬编码在文件android_modemc中:

/ the Android GSM stack checks that the operator's name has changed

when roaming is on If not, it will not update the Roaming status icon

this means that we need to emulate two distinct operators:

- the first one for the 'home' registration state, must also correspond

to the emulated user's IMEI

- the second one for the 'roaming' registration state, must have a

different name and MCC/MNC

/

#define OPERATOR_HOME_INDEX 0

#define OPERATOR_HOME_MCC 310

#define OPERATOR_HOME_MNC 260

#define OPERATOR_HOME_NAME "Android"

#define OPERATOR_HOME_MCCMNC STRINGIFY(OPERATOR_HOME_MCC) \

STRINGIFY(OPERATOR_HOME_MNC)

#define OPERATOR_ROAMING_INDEX 1

#define OPERATOR_ROAMING_MCC 310

#define OPERATOR_ROAMING_MNC 295

#define OPERATOR_ROAMING_NAME "TelKila"

#define OPERATOR_ROAMING_MCCMNC STRINGIFY(OPERATOR_ROAMING_MCC) \

STRINGIFY(OPERATOR_ROAMING_MNC)

/ a function used to deal with a non-trivial request /

typedef const char (ResponseHandler)(const char cmd, AModem modem);

static const struct {

const char cmd; / command coming from libreference-rilso, if first

character is '!', then the rest is a prefix only /

const char answer; / default answer, NULL if needs specific handling or

if OK is good enough /

ResponseHandler handler; / specific handler, ignored if 'answer' is not NULL,

NULL if OK is good enough /

} sDefaultResponses[] =

{

/ see onRadioPowerOn() /

{ "%CPHS=1", NULL, NULL },

{ "%CTZV=1", NULL, NULL },

{ "!+VTS=", NULL, handleSetDialTone },

{ "+CIMI", OPERATOR_HOME_MCCMNC "000000000", NULL }, / request internation subscriber identification number /

{ "+CGSN", "000000000000000", NULL }, / request model version /

{ "+CUSD=2",NULL, NULL }, / Cancel USSD /

/ end of list /

{NULL, NULL, NULL}

};

因此用UE二进制方式打开emulator-armexe 或 emulator-x86exe,并搜索字符串"+CGSN"修改为需要的IMEI号;搜索"+CIMI"修改为需要的IMSI号。需要注意的是 IMSI 号的头六个数字"310260"不能修改,否则模拟器无法与网络连接。

例如:

001fc700h: 33 00 41 00 48 00 21 2B 56 54 53 3D 00 2B 43 49 ; 3AH!+VTS=+CI

001fc710h: 4D 49 00 33 31 30 32 36 30 30 30 30 30 30 30 30 ; MI3102600000000

001fc720h: 30 30 00 2B 43 47 53 4E 00 30 30 30 30 30 30 30 ; 00+CGSN0000000

001fc730h: 30 30 30 30 30 30 30 30 00 2B 43 55 53 44 3D 32 ; 00000000+CUSD=2

获取IMSI串号,Android SDK有相应的方法。

(1)如果为空就是没插卡;

(2)1~3三位是国家码,460表示是中国的运营商,否则就是境外卡;

(3)4~5两位是运营码:移动00、02、04、07,联通GSM系统使用01、06,电信03、05、11,铁通20;

(4)不足之处:双卡手机是中国特色,Android SDK只能取到第一张卡得IMSI。至于哪张卡是第一张,每种品牌的手机不尽相同。

以上就是关于安卓手机在拨号栏输入什么能查看自己的手机硬件全部的内容,包括:安卓手机在拨号栏输入什么能查看自己的手机硬件、Android游戏开发之Cocos2d-x、安卓系统接入点设置怎么弄等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/9337883.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-27
下一篇 2023-04-27

发表评论

登录后才能评论

评论列表(0条)

保存