Create Your First App
In this tutorial, we will create a camera app. The app will launch the camera and display the captured photo within the app.
Last updated
In this tutorial, we will create a camera app. The app will launch the camera and display the captured photo within the app.
Last updated
To develop your first app in Monaca, start by creating a new project. The project will be based on an empty template and can be created following these steps:
Click the "Create New Project" button
Select "Blank Template"
Click the "Create" button
Next, we will create a screen to launch the camera.
In the body tag of index.html, add a button tag to start the camera and an img tag to display the captured image as follows:
We will now create the process to launch the camera.
This process will be written in JavaScript. In the script tag of index.html, write the following code for the camera execution process (shoot function).
To use the mobile device's camera functionality, you need to install the plugin.
Plugins are necessary when utilizing mobile device features from JavaScript code.
Navigate to the "Configure" menu > "Cordova Plugin Settings"
Enable the "Camera" plugin
At this point, the camera app is complete. Let's check the finished camera app on your device. There are two ways to do this:
Building the project for Android or iOS and checking it
Checking it using the "Monaca Debugger" provided on the iOS and Android stores
Here, we will explain both methods: building the project for Android and checking it with the "Monaca Debugger."
To build the project for Android, follow these steps:
Go to the "Build" menu > "Build App for Android"
Start the build process
Install the Monaca Debugger from the following app store link:
Once you log in to the app, you will see the project you created.
Click on the project to launch the camera app.