android ios原生开发框架,boden: boden 是用于 Android 和 IOS 开发的纯原生 C++ 跨平台框架,使用 Boden,可以通过一个代码库创建本地移动跨平台应用程序...

boden-github.svg

BODEN CROSS-PLATFORM FRAMEWORK

Build purely native cross-platform experiences with Boden

Website

Getting Started

API Reference

Guides

Twitter

Feedback

boden-demo.gif

Native widgets: Instead of drawing widgets that look nearly identical to the platform's design, Boden uses native OEM widgets ensuring that your app will always have a truly native look and feel.

Fast: Boden is written in modern C++17 to make development easy and apps fast and battery-friendly.

Open: Boden is an open framework and welcomes contributions and feedback from the community. We want you to shape its development so Boden can meet your requirements.

Note: This is a beta release. The Boden API is not yet fully complete and stable.

Table of Contents

Getting Started

Prerequisites

On Ubuntu 18.04: sudo apt update && sudo apt install git cmake ninja-build python python3-distutils openjdk-8-jdk qemu-kvm plus Android Studio (with Android NDK, see the installation instructions for further details).

Step 1: Clone the Boden Repo

git clone --recurse-submodules https://github.com/AshampooSystems/boden.git

Step 2: Generate and Open an IDE Project

cd boden

python boden.py open -t bodendemo

This will bring up Xcode on macOS or Android Studio on Linux/Windows.

If anything goes wrong, please make sure that all dependencies are installed and set up correctly. Check out our extended guides for help:

Step 3: Run a Boden Example Application

In Xcode, select the bodendemo target and hit Cmd+R.

In Android Studio, select the bodendemo target and hit Shift+F10.

Your First Boden Application

To create your first Boden app, open up a terminal (or command prompt), change to your local boden directory, and execute the following commands:

python boden.py new -n AwesomeApp

cd AwesomeApp

python ../boden.py open

This will create a new folder named AwesomeApp and generate source and project files for a simple Hello World cross-platform application. The last command will prepare and open an Xcode project on the Mac or an Android Studio project on Linux/Windows.

In Xcode, select the AwesomeApp target and then press Cmd+R to build and run the Hello World application.

In Android Studio, wait for Gradle to finish its sync and configuration processes and then select the bodendemo target and press Cmd+R to build and run the example application, then select the AwesomeApp target and then press Ctrl+R on Mac or Shift+F10 on Linux/Windows to build an run the Hello World application.

Note: On macOS and Linux you can also simply type ./boden instead of calling python boden.py explicitly. If you want to build the Android version of the app on macOS, run ../boden open -p android.

Hello World

Here's a quick look at the source code generated by the boden new command:

// MainViewController.cpp

#include

#include

#include "MainViewController.h"

using namespace bdn;

using namespace bdn::ui;

MainViewController::MainViewController()

{

_window = std::make_shared();

_window->title = "AwesomeApp";

_window->geometry = Rect{0, 0, 400, 300};

_window->setLayout(std::make_shared<:layout>());

auto button = std::make_shared();

button->label = "Hello World";

_window->contentView = button;

_window->visible = true;

}

MainViewController.cpp is the most interesting part of the source generated for the Hello World application. The main view controller will be instantiated at application launch. It's responsible for setting up the application's user interface.

Here's what the code does in detail:

First, create a new Window and set its title to AwesomeApp:

_window = std::make_shared();

_window->title = "AwesomeApp";

To get an automatic layout, use a yogalayout::Layout and set a default window size:

_window->geometry = Rect{0, 0, 400, 300};

_window->setLayout(std::make_shared<:layout>());

Then, instantiate a new Button and set its label to "Hello World":

auto button = std::make_shared();

button->label = "Hello World";

As the button is the only control which will be displayed in this example, set it as the window's content view:

_window->contentView = button;

Finally, make the window visible:

_window->visible = true;

Documentation

You can find the full Boden documentation on our website.

The Boden documentation is still work in progress. If you can't find the information you're looking for, please don't hesitate to ask by opening a GitHub issue or contacting us directly.

License

You may license Boden under one of the following open-source licenses:

For commercial/proprietary licensing, please contact us at boden-team@ashampoo-systems.com.

Contact & Feedback

We are happy about your feedback!

Get in touch with us and stay up to date about Boden:

If you find something that is missing or doesn't work, please consider opening a GitHub issue.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值