1"use strict";(globalThis.webpackChunkconfigure_website||=[]).push([[23],{7706(e,n,t){t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"frameworks/native-android","title":"Native Android","description":"Trapeze makes it easy to automate the configuration of your native Android projects. When targeting a standalone Android project, no operations for other platforms (iOS, etc) will apply.","source":"@site/docs/frameworks/native-android.md","sourceDirName":"frameworks","slug":"/frameworks/native-android","permalink":"/docs/frameworks/native-android","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Native Android","sidebar_label":"Native Android"},"sidebar":"tutorialSidebar","previous":{"title":"Flutter","permalink":"/docs/frameworks/flutter"},"next":{"title":"Native iOS","permalink":"/docs/frameworks/native-ios"}}');var r=t(4848),i=t(8453);const a={title:"Native Android",sidebar_label:"Native Android"},s=void 0,d={},c=[{value:"Configuration Tool",id:"configuration-tool",level:2},{value:"API",id:"api",level:2}];function l(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Trapeze makes it easy to automate the configuration of your native Android projects. When targeting a standalone Android project, no operations for other platforms (iOS, etc) will apply."}),"\n",(0,r.jsx)(n.h2,{id:"configuration-tool",children:"Configuration Tool"}),"\n",(0,r.jsxs)(n.p,{children:["To use the ",(0,r.jsx)(n.a,{href:"../operations/getting-started",children:"Configuration-driven"})," experience, first create a yaml file using the ",(0,r.jsx)(n.a,{href:"../operations/getting-started",children:"options available"}),":"]}),"\n",(0,r.jsx)(n.p,{children:"Here's an example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",metastring:'title="config.yaml"',children:'platforms:\n android:\n manifest:\n - file: AndroidManifest.xml\n target: manifest/application\n inject:\n <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />\n\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm install @trapezedev/configure\nnpx trapeze run config.yaml\n"})}),"\n",(0,r.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,r.jsxs)(n.p,{children:["Pass the main Android project directory to the ",(0,r.jsx)(n.code,{children:"MobileProject"})," constructor, and then the relative path to the Android project (such as ",(0,r.jsx)(n.code,{children:"'.'"})," if the root and Android project paths are the same):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typescript",children:"import { MobileProject, MobileProjectConfig } from '@trapezedev/project';\n\nconst config: MobileProjectConfig = {\n android: {\n path: '.',\n },\n};\n\nconst project = new MobileProject('/path/to/project/dir', config);\nawait project.load();\n"})})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453(e,n,t){t.d(n,{R:()=>a,x:()=>s});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.