利用Recognizer实现Symbian开机自启动程序

需积分: 12 2 下载量 66 浏览量 更新于2024-11-09 收藏 49KB DOC 举报
在Symbian操作系统中,Recognizer是一种重要的组件,用于编译后的MDL(Medium Data Library)形式,类似于DLL(Dynamic Link Library)。它的主要作用是提供应用程序的扩展功能,并且在Symbian OS内核启动后会被自动加载,即使它并未实现预期的所有功能。最初,Recognizer并不是设计用于开机自启动的工具,但随着平台的发展,连Symbian官方也开始利用其自启动特性来支持特定的Boot软件。 要让自己的程序在Symbian设备的开机过程中自动运行,开发者可以利用Recognizer的API来实现。以下是一个简单的步骤: 1. **理解基本结构**: - Recognizer编译后的MDL文件包含在CMyRecognizerRecog类中,该类继承自CApaDataRecognizerType,这是一种数据识别器类型,带有唯一的DLL UID(即KMyRecognizerRecogDllUid)。 2. **数据类型管理**: - 定义了静态常量TInt KMyRecognizerRecogDataTypeCount,表示你的识别器支持的数据类型数量。 - 提供了数据类型 MIME 类型(_LIT8(KMyRecognizerRecogMimeType,"application/ogg")),这是识别器能够处理的文件类型标识。 3. **初始化与配置**: - CMyRecognizerRecog类的构造函数中设置了识别器的数据类型数量(iCountDataTypes)和默认缓冲大小(PreferredBufSize()),这里设置为0,意味着不做特定的缓冲要求。 4. **自定义实现**: - 实现必要的识别逻辑和功能,这部分代码未在给出的部分展示,但通常会涉及到数据解析、处理或操作。开发者需要根据实际需求编写相应的识别方法。 5. **启动条件**: - Recognizer的自启动与Symbian OS内核的启动机制紧密相连,当系统启动时,内核会检测并加载MDL文件中的Recognizer。尽管具体调用过程不详,但可以肯定的是,你的Recognizer会在系统启动时被加载。 6. **权限和限制**: - 开发者需要注意,可能只有Nokia的核心合作伙伴才能获取完整的官方API,以确保在更深层次的自启动操作。普通开发者需要遵循Symbian的规定和许可,以避免违反版权和系统安全。 利用Recognizer编写开机自启动程序的关键在于创建并注册一个适配于Symbian OS内核的识别器,正确设置数据类型、初始化参数,并确保符合平台的安全和兼容性要求。开发者可以根据自己的需求,定制相应的识别器代码,并在Symbian SDK文档中查找更多关于Recognizer的细节。
681 浏览量
About Wouldn't your prefer to let your users speak instead of making them type? This plugin uses OS components for speech recognition and send it to your Unity scripts as String objects. Plugin supports: - Android >= 3.0 (haven’t tested below, it might work though… ), - iOS >= 10.0. That doesn’t mean you can’t target iOS lower than 10 - you simply have to prepare fallback code to cover cases when user doesn’t have access to speech recognition (SpeechRecognizer.EngineExists() for the help!). Keep in mind that both iOS and Android might use Internet connection for speech detection, which means it might fail in case there’s no active connection. Plugin doesn’t work in Editor! You have to run your app on real iOS or Android device. MOBILE SPEECH RECOGNIZER - UNITY PLUGIN ?2 Quick Start Open example scene Go to KKSpeechRecognizer/Example folder inside Unity and open ExampleScene: It shows basic usage of a plugin, which is: 1. Detecting if speech recognition exists on user’s device (keep in mind that it won’t be available on e.g. iOS 9 or old Android phones), 2. If it exists, and user clicks on “Start Recording” button it listens for recognized text and displays it on a screen, 3. On Android, speech recognition automatically detects when user finishes speaking, but on iOS we have to wait for user clicking “Stop Recording” to finish whole process (i.e. get final results). Before running it on Android or iOS device you have to… Setup permissions iOS After generating Xcode project (keep in mind that you have to use Xcode 8 or higher) you have to add two permissions keys to your project: MOBILE SPEECH RECOGNIZER - UNITY PLUGIN ?3 NSMicrophoneUsageDescription explanation from Apple docs: This key lets you describe the reason your app accesses any of the the device’s microphones. When the system prompts the user to allow access, this string is displayed as part of the alert. NSSpeechRecognitionUsageDescription explanation from Apple docs: This key lets you describe the reason y