普通WindowsMobile应用程序开发.ppt
《普通WindowsMobile应用程序开发.ppt》由会员分享,可在线阅读,更多相关《普通WindowsMobile应用程序开发.ppt(41页珍藏版)》请在三一文库上搜索。
1、普通Windows Mobile 应用程序开发,Windows Mobile应用开发培训 陈震邦 2009.4.18,Pocket PC,SmartPhone,Microsoft Windows mobile系统的特点: 类似于小电脑,目前主流配置: CPU:180600MHZ;程序内存64-128MB;ROM内存:128-256MB 与其他手机系统比较- 优点: 1、内置office系统 2、含Internet、多媒体等PDA功能 3、可安装卸载软件,有触摸屏等等 4、支持很多硬件设备SDRAM,USB,PCI等 缺点: 1、操作复杂 2、对硬件要求高 3、体积较大 Windows mobi
2、le 软件平台分类: 1、SmartPhone 2、Pocket PC,Windows Mobile操作系统的分类: 1、Standard、 2、Professional 3、Classic,Windows mobile系统总体架构图,Windows Mobile的体系结构与特征,采用Windows兼容的Win32 API方式 使用的API和WINCE基本相同,另外还加入了Windows Mobile特有的API. 对COM/ActiveX的支持上,Windows Mobile只支持“轻量级”的COM,而且对COM的执行是在进程内完成的。 支持MFC 支持Microsoft .NET Comp
3、act Framework,Windows Mobile应用开发环境和常用工具介绍,Visual studio 2005/2008 Windows mobile sdk Remote Spy Remote Heep Remote Register Editor Remote Zoom In Remote File Viewer Remote Process Viewer ActiveSync 4.5,Windows Mobile常用测试工具介绍,CETK(系统集成测试工具) Hopper(随机测试) Vsbenchmark (硬件性能测试) Visual unit(单元测试),Agenda,W
4、indows Mobile 编程考虑 Win32/MFC/WTL三种mobile上编程方式比较 设计Windows Mobile用户界面 窗口、基础控件 内核服务 文件系统 POOM MAPI Cellcore API UI自定义,Windows Mobile编程考虑,1、Win32 API 标准Win32 API的子集 部分简化的API函数 独特的Windows Mobile API函数 消息的考虑,消息通知机制 可能要修改的数据类型,Windows Mobile编程考虑,2、Windows Mobile平台和外壳考虑 屏幕大小规格 (QCIF176X220, QVGA240x320, VG
5、A480x640) 更小的显示器、更灵活的通讯方式 平台硬件环境考虑 鼠标 触摸屏 键盘 软键盘、硬键、光标笔,Windows Mobile编程考虑,3、基于Unicode 环境 在代码中包含Tchar.h,它包含所有的字符转换函数。 使用Win32字符串函数,而不是C run-time函数。 使用TCHAR和LPTSTR进行声明。声明一个变量为TCHAR类型,用户可以编译代码为Unicode和ASCII。 使用TEXT宏来转换一个字符串。 使用Cstring 和MultiByteToWideChar( ) 转换字符串,Unicode C-Runtime函数 ANSI string funct
6、ions strlen() - query length strcpy() - copy string strcat() - concatenate string Unicode string functions wcslen() - query length wcscpy() - copy string wcscat() - concatenate string Bi-Modal string functions _tcslen() - query length _tcscpy() - copy string _tcscat() - concatenate string,Windows Mo
7、bile编程考虑,Windows Mobile编程考虑,Unicode C-Runtime 转换函数 Converting to Unicode Converting from Unicode,mbstowcs( wchar_t *wcstr, / Output string. const char *mbstr, / Input string. size_t count ); / Character count,wcstombs( char *mbstr, / Output string. const wchar_t *wcstr, / Input string. size_t count
8、); / Character count,Windows Mobile编程考虑,为了防止这样的错误发生,可以按照下面的代码来改写。,int myfunc(TCHAR *p) TCHAR *pszFileName; pszFileName = (TCHAR*)malloc(MAXFILELEN); if (pszFileName) _tcsncpy(szFileName, p, MAXFILELEN); ,int myfunc(TCHAR *p) TCHAR *pszFileName; pszFileName = (TCHAR*)malloc(MAXFILELEN * sizeof(TCHAR)
9、; if (pszFileName) _tcsncpy(szFileName, p, MAXFILELEN); ,4、进程 只最多支持32个进程,默认至少开启5个进程: nk.exe :内核服务 FileSys.exe:文件系统服务 GWES.exe: GUI支持 device.exe:加载和维护驱动程序 services.exe管理和停止服务,Windows Mobile编程考虑,创建和终止进程 调用CreateProcess 函数来创建进程. 调用TerminateProcess 函数来终止进程。,BOOL CreateProcess(LPCTSTR lpApplicationName,
10、LPTSTR lpCommandLine, NULL, NULL, FALSE, DWORD dwCreationFlags, NULL, NULL, NULL, LPPROCESS_INFORMATION lpProcessInformation ); BOOL TerminateProcess( HANDLE hProcess, DWORD uExitCode );,VOID ExitThread( DWORD dwExitCode );,HANDLE CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStack
11、Size, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId );,Windows Mobile编程考虑,结束线程,主线程结束,该进程也就结束,创建线程,使用CreateThread函数,5、线程,线程数量不限,跟内存大小有关。,Windows Mobile编程考虑,6、内存管理,Wm 存储 结构,ROM RAM 扩展 内存,程序存储区 对象存储区,(T Card等Flash Card),(能够以现场执行: XIP),其中Flash Card的
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 普通 WindowsMobile 应用程序 开发
链接地址:https://www.31doc.com/p-2602934.html