You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains sample apps that use the Android NDK.
For an explanation of the layout of this repository, see
ARCHITECTURE.md.
Build and run
Clone the repository
Open the whole project in Android Studio
Select the sample you want to run in the top bar (you may need to sync gradle
first)
Click the play button to run the sample
You can also build the samples from the command line if you prefer. Use
./gradlew build to build everything (if you're on Windows, use .\gradlew.bat
instead of ./gradlew). For individual tasks, see ./gradlew tasks. To see the
tasks for an individual sample, run the tasks task for that directory. For
example, ./gradlew :camera:basic:tasks will show the tasks for the
camera/basic app.
I just want something to copy from as a starting point
The samples in this repository are generally not a good starting point for a
production quality app. They aim to demonstrate individual NDK APIs, but often
make sacrifices to be succinct that make them unsuitable for a production app.
This is gradually changing, but for now you should not do this.
You're most likely best served by using the New Project wizard in Android Studio
to create a new app, then using those resources and the samples here as a
reference. Android Studio's "Native C++" template is a good starting point for
typical applications that need to use some C++ via JNI. The "Game Activity"
template is a good starting point for game-like apps (that is, apps that do not
use the Android UI, but instead render their own UI using OpenGL or Vulkan).
Copyright 2018 The Android Open Source Project, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.