目录

XMSDEMO Module

[ English | 简体中文 ]

Table of Contents

Introduction

The XMSDEMO module provides several complete processing examples, showing how to use XMS in openvela for package management and activity management. This module is suitable for beginners and developers to get started quickly.

Sample Code

This section mainly demonstrates how to use openvela’s AMS module to implement a quick application, with specific implementations available in the XMS demo’s launcher module.

  1. define a LauncherApplication.cpp, with the core implementation as follows:

    class LauncherApplication : public Application {
        void onCreate() override {
            REGISTER_ACTIVITY(HomeActivity)
        }
    
        void onForeground() override {}
        void onBackground() override {}
        void onDestroy() override {}
    };
    
    #define APPLICATION LauncherApplication
    #include <app/AppMain.h>

    Note: You need to add the following two lines.

    #define APPLICATION LauncherApplication
    #include <app/AppMain.h>
  2. define a HomeActivity, with the core implementation as follows:

    class HomeActivity : public Activity {
    public:
        void onCreate() override;
        void onStart() override;
        void onResume() override;
        void onPause() override;
        void onStop() override;
        void onDestroy() override;
        void onRestart() override;
    
    private:
        std::vector<xmsdemo::ButtonHandler> mBtns;
        std::shared_ptr<Dialog> mDialog;
    };
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号