资源简介
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实现分类筛选
相关资源
- AndroidStudio版直连sqlserver
- android带百分比进度条的文件上传,使
- 美食天下项目Android版源码和Web版源码
- Android之自定义ToggleButton使用
- Android非常漂亮的登录界面
- pc与android通过usb socket实现手机通信
- android毕业设计
- 百度地图自定义Markerandroid
- Android分区工具包
- android-support-v4.jar已打包进去源代码
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- android 视频播放器 项目和原码
- Android【动画】【特效】 17种动画特效
- 基于Android智能家居详细设计(经典)
- android通过JDBC连接Mysql数据库
- Android通讯录的源代码
- android 瀑布流Demo
- 指纹传感器FPC1080在android下的驱动
- delphi xe5 android 调用照相机摄像头拍照
- Android手机连连看游戏源码
- android-sdk-windows v2.3离线完整版
- android 底部弹出菜单(带透明背景)
- Android工程模式简介.rar
- Android蓝牙和Cors网络开发源码
- Android powermanger wakelock
- Android v7的一些jar包
- 最新android supportV7包
- android图片压缩工具类分享
- 单机搭建Android(解决Network is unreach
评论
共有 条评论