• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Copyright 2015 Google Inc. All rights reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# Note: This script requires the Android NDK and Android SDK to be installed.
18#       It also requires an Android device to be connected for installing and
19#       running the applicaton.
20
21sampledir=$(readlink -fn `dirname $0`)
22currentdir=$(readlink -fn `pwd`)
23
24if [[ "$sampledir" != "$currentdir" ]]; then
25  echo Error: This script must be run from inside the $sampledir directory.
26  echo You executed it from the $currentdir directory.
27  exit 1
28fi
29
30# Execute `build_apk.sh` to build and run the android app.
31cd android
32./build_apk.sh
33
34# Cleanup the temporary files.
35rm build.xml local.properties proguard-project.txt project.properties
36rm -rf bin libs obj
37