c - 我可以在 Tizen native 可穿戴应用程序(三星 G3)的模板中开始将代码放入哪一行

标签 c tizen tizen-wearable-sdk tizen-native-app

我刚刚开始尝试使用 Tizen Studio 制作 Samsung G3 应用程序。我对 C 语言编码非常陌生。在 Tizen Studio 提供的模板中,我不确定应该从哪里开始编码/编写自己的代码。 例如,如果我想从创建这个传感器开始:

sensor_type_e type = SENSOR_HRM;
sensor_h sensor;

bool supported;
int error = sensor_is_supported(type, &supported);
if (error != SENSOR_ERROR_NONE) {
   dlog_print(DLOG_ERROR, LOG_TAG, "sensor_is_supported error: %d", error);
   return;
}

if(supported){
   dlog_print(DLOG_DEBUG, LOG_TAG, "HRM is%s supported", supported ? "" : " 
   not");
   sprintf(out,"HRM is%s supported", supported ? "" : " not");
   elm_object_text_set(event_label, out);
}

我应该将其放在提供给我的这个简短模板中的什么位置:

#ifndef __basicui_H__
#define __basicui_H__

#include <app.h>
#include <Elementary.h>
#include <system_settings.h>
#include <efl_extension.h>
#include <dlog.h>
#include <sensor.h>

#ifdef  LOG_TAG
#undef  LOG_TAG
#endif
#define LOG_TAG "basicui"

#if !defined(PACKAGE)
#define PACKAGE "org.example.basicui"
#endif

#endif /* __basicui_H__ */

最佳答案

This is the guide在 native 平台中创建您的第一个 Tizen 可穿戴应用程序。在本指南中,一切都按步骤进行了描述。我认为通过遵循本指南,您将能够学习 Tizen Native 应用程序的基础知识。

熟悉 Tizen 后,请检查心率示例应用程序。 Here是一个带有源代码的简单心率教程。

该应用程序的屏幕截图如下 enter image description here

您也可以查看这个video tutorial在 YouTube 上了解 Tizen native 应用程序基础知识。

关于c - 我可以在 Tizen native 可穿戴应用程序(三星 G3)的模板中开始将代码放入哪一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55584503/

相关文章:

c - 如何在c中写入文件的特定行?

c++ - 由于为 C++ 程序调用 ulldiv.asm 而导致编译器引用错误

ios - SmartView SDK Samsung/Tizen - 内部服务器错误 500

javascript - 如何在 Tizen 中实现 oAuth 2.0

比较更新前(memcmp 先于 memcpy),还是只更新,哪个性能更好?

javascript - .html() 在 tizen 中不起作用

watchkit - 可以跨平台开发 watch /可穿戴应用程序吗?

javascript - Tizen 可穿戴 Web 应用程序 : Content getting smaller when not in the center of the screen

macos - 尝试在 Samsung Gear 2 上安装应用程序时出现 SIGNATURE_INVALID

c - char 指针的加法和减法