【问题标题】:Which line can I start to put my code in, in template for Tizen Native Wearable App (Samsung G3)在 Tizen Native Wearable App (Samsung G3) 的模板中,我可以开始将代码放入哪一行
【发布时间】:2019-04-09 03:03:05
【问题描述】:

我刚开始尝试使用 Tizen Studio 制作三星 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__ */

【问题讨论】:

  • 那不是源代码模板;这是一个头文件。
  • C 与其说是初学者的语言,不如说是一种专家工具。我强烈建议先学习 C 基础知识,然后再处理像移动应用程序这样复杂的事情。
  • @MarkBenningfield 你是完全正确的。我完全错过了 src 文件。

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


【解决方案1】:

This is the guide 在 Native 平台上创建您的第一个 Tizen 可穿戴应用程序。在本指南中,所有内容都将逐步描述。我认为按照本指南,您将能够学习 Tizen Native 应用程序的基础知识。

熟悉 Tizen 后,查看心率示例应用程序。 Here是一个简单的心率教程,附源码。

此应用的屏幕截图如下

您还可以在 YouTube 上查看 video tutorial,了解 Tizen Native App Fundamentals。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    • 2015-10-13
    • 1970-01-01
    • 2015-09-23
    • 1970-01-01
    • 2015-02-23
    相关资源
    最近更新 更多