资源简介
mst Android按常规方法添加的native service在mst 方案上编译不到,这是在mst平台上调试触摸屏时实践有效的参考代码,多点触摸屏的native service参考代码。
代码片段和文件信息
#define LOG_TAG “SerialTouchScreenJNI“
#include
#include “jni.h“
#include “JNIHelp.h“
#include “core_jni_helpers.h“
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include
#include “utils/Log.h“
#include
using namespace android;
TouchManager *tm;
static jfieldID field_context;
void com_mstar_android_tvapi_common_TouchPortManager_Setup(JNIEnv *env jobject thiz) {
ALOGD(“native_setup“);
tm = new TouchManager();
if(tm != NULL)
{
ALOGD(“native_setup success“);
//tm->TouchSetupCmd();
}
}
static jint com_mstar_android_tvapi_common_TouchPortManager_Read(JNIEnv *env jobject thiz jbyteArray data)
{
unsigned char *buf;
int num = 0;
buf =(unsigned char *)calloc(15sizeof(char));
if(buf == NULL)
{
return 0;
}
//num = tm->TouchReadData(buf);
ALOGD(“android_cmds_SerialTouch_write“);
env->SetByteArrayRegion(data0num (jbyte*)buf);
free(buf);
return num;
}
static jint com_mstar_android_tvapi_common_TouchPortManager_EnableUsb(JNIEnv *env jobject thiz jboolean cmd)
{
int ret;
ALOGD(“android_cmds_SerialTouch_write“);
ret = tm->TouchEnableUsbTouch(cmd);
return ret;
}
static const char *classPathName = “com/mstar/android/tvapi/common/TouchPortManager“;
static JNINativeMethod methodtable[] = {
{ “native_setup“ “()V“(void*)com_mstar_android_tvapi_common_TouchPortManager_Setup}
{ “native_enableUsb“ “(Z)I“(void*)com_mstar_android_tvapi_common_TouchPortManager_EnableUsb}
{ “native_read“ “([B)I“(void*)com_mstar_android_tvapi_common_TouchPortManager_Read}
};
/*
int register_com_mstar_android_tvapi_common_TouchPortManager(JNIEnv *env)
{
jclass clazz = FindClassOrDie(env classPathName);
field_context = GetFieldIDOrDie(env clazz “mNativeContext“ “I“);
return RegisterMethodsOrDie(env classPathName
method_table NELEM(method_table));
}
*/
/*
* Register several native methods for one class.
*/
static int registerNativeMethods(JNIEnv *env const char *className
JNINativeMethod *gMethods int numMethods) {
jclass clazz;
clazz = env->FindClass(className);
if (clazz == NULL) {
ALOGE(“Native registration unable to find class ‘%s‘“ className);
return JNI_FALSE;
}
if (env->RegisterNatives(clazz gMethods numMethods) < 0) {
ALOGE(“RegisterNatives failed for ‘%s‘“ className);
return JNI_FALSE;
}
return JNI_TRUE;
}
/*
* Register native methods for all classes we know about.
*
* returns JNI_TRUE on success.
*/
static int registerNatives(JNIEnv *env) {
if (!registerNativeMethods(env
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3160 2018-12-14 09:59 SerialTouch\vendor\mstar\supernova\projects\tvos\tvos_makefile.diff
文件 374 2018-12-13 15:06 SerialTouch\vendor\mstar\supernova\projects\tvos\include\SerialTouch\TouchManager.h
文件 1234 2018-12-07 15:43 SerialTouch\vendor\mstar\supernova\projects\tvos\include\SerialTouch\ITouchManager.h
文件 4503 2018-11-28 11:54 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\Android.mk
文件 780 2018-12-08 15:05 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\test\Android.mk
文件 1182 2018-12-08 15:57 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\test\TouchClient_main.cpp
文件 686 2018-12-08 11:46 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\test\TouchService_main.cpp
文件 5766 2018-12-07 16:27 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager\Android.mk
文件 1703 2018-12-07 17:19 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager\ITouchManager.cpp
文件 1142 2018-12-07 14:58 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager\Makefile
文件 1696 2018-12-13 15:04 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager\TouchManager.cpp
文件 686 2018-12-08 16:04 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager\TouchService_main.cpp
文件 1120 2018-11-30 20:10 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\Makefile
文件 351 2018-12-08 15:03 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanagerservice\Android.mk
文件 957 2018-12-07 14:50 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanagerservice\Makefile
文件 9374 2018-12-08 16:29 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanagerservice\TouchService.cpp
文件 1336 2018-12-07 20:54 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanagerservice\TouchService.h
文件 3847 2018-12-07 16:26 SerialTouch\deviece\mstar\common\libraries\tvapi\jni\com_mstar_android_tvapi_common_TouchPortManager.cpp
目录 0 2018-12-14 11:01 SerialTouch\vendor\mstar\supernova\projects\tvos\include\SerialTouch
目录 0 2018-12-14 11:02 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\test
目录 0 2018-12-14 11:02 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanager
目录 0 2018-12-14 11:02 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch\libtouchmanagerservice
目录 0 2018-12-14 11:01 SerialTouch\vendor\mstar\supernova\projects\tvos\include
目录 0 2018-12-14 11:02 SerialTouch\vendor\mstar\supernova\projects\tvos\SerialTouch
目录 0 2018-12-14 10:57 SerialTouch\deviece\mstar\common\libraries\tvapi\jni
目录 0 2018-12-14 11:03 SerialTouch\vendor\mstar\supernova\projects\tvos
目录 0 2018-12-14 10:55 SerialTouch\deviece\mstar\common\libraries\tvapi
目录 0 2018-12-14 11:00 SerialTouch\vendor\mstar\supernova\projects
目录 0 2018-12-14 10:55 SerialTouch\deviece\mstar\common\libraries
目录 0 2018-12-14 11:00 SerialTouch\vendor\mstar\supernova
............此处省略9个文件信息
- 上一篇:手势缩放核心代码
- 下一篇:Android__利用RadioButton实现分类筛选
相关资源
- Android__利用RadioButton实现分类筛选
- Android数据存储和数据访问
- Android强大的日期时间选择控件
- Android自定义摇杆实现蓝牙控制小车
- android 播放器按钮图标
- android 用SO_BINDTODEVICE绑定发出包的测试
- Android应用签名读取工具
- Android个人日程管理()
- SurfaceControl.jar
- android录音播放
- android微信分享demo
- 51单片机使用HC-05蓝牙模块与Android手机
- 集成Android-ADT的eclipse
- BAT大牛带你深度剖析Android10大开源框
- Android 轮子时间选择器
- android马达应用
- Android版本手机防盗软件,直接仿照开
- Android桌面悬浮窗进阶,QQ手机管家小
- Android 8.0系统通知栏适配Demo
- 身高测算Android软件
- Android_实战_备忘录
- Android实战项目电子词典
- Android实战项目复杂的科学计算器源码
- 安卓android 蓝牙串口助手 源代码
-
Axm
lPrinter2错误修正版本189913 - android 简单的读取SD卡的所有图片
- android 银行管理
- httpmime-4.1.1.jar
- Android 基于google Zxing实现二维码的生成
- Android记事本程序代码
评论
共有 条评论