# Generating and deploying an Android-App

Now an android studio project skeleton is needed for constructing a so-called apk file, which is the format of android app packages, like those on Google AppStore.

- Navigate to cgi\_studio\_apps/references/Android/ and copy the MlcSample project to a location you like
- From your build directory, copy the file libApplicationLib.so to following location of your project skeleton:  
    &lt;MlcProject&gt;/app/native-libs/&lt;architecture&gt;/
- Open Android-Studio and open your MlcSample project. This wil take a few seconds, wait till everything is ready.
- Click at “Syncronise Project” like shown below and wait again till everything is ready:  
    (This is only needed when the project is opened the first time)  
    <div drawio-diagram="3108"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169637.png" alt=""/></div>
- Next click at “Show Project-Structure” like shown below:  
    (This is only needed when the project is opened the first time)  
    <div drawio-diagram="3109"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169672.png" alt=""/></div>
- A dialog opens. Select the tab “SDK Location” and there ensure that the field “Android NDK location” (the bottom-most one) is set to the ndk-r17c, which you installed previously:  
    <div drawio-diagram="3110"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169700.png" alt=""/></div>
- Click OK and you’re ready to build and deploy.
- Ensure that you connected your android device to an USB port and enabled “USB debugging” on that device.
- Finally klick the “Run-Button”, like shown below and await what will happen:  
    <div drawio-diagram="3111"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169731.png" alt=""/></div>
- Sometimes Android Studio asks for device selection – do so and proceed…  
    <div drawio-diagram="3112"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169743.png" alt=""/></div>
- Sometimes Android Studio asks to install missing platforms. Simply do so and proceed…  
    <div drawio-diagram="3113"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169765.png" alt=""/></div>
- And if you’re using an absolutely new platform like shown in the dialog above, Android-Studio still cries around: Simply klick OK to proceed and forget about that:  
    <div drawio-diagram="3114"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169782.png" alt=""/></div>
- Finally if the application is deployed and running, Android Studio should look like this:  
    <div drawio-diagram="3115"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678169797.png" alt=""/></div>