Cameras can be used to photograph, scan different types of barcodes or even barcodes on bills. It should be noted that the camera is a piece of hardware that is placed inside phones or other devices, and also to use it, you need a software that is installed and defined inside the phone system so that it can be hard. Used the software for the required things. In this part of the tutorial, we want to talk about how to set up and use the existingcamera software.

The methods used to use the camera in Android systems are as follows:

1-Using an interface program:

Using the interface program, you can usethe camera softwareand record your photo, then transfer it to another application to get the required output.

2-Using API:

In this method, they directly use the camera software and the API that exists inside the system directly and without any interface.Sometimes we use the default camera directly in the system to take photos or record video, which is the second method of setting up the camera, and in this method, in fact, the APIs are used directly and without any interface. we do. In this method, photography and video recording are done in the same camera environment and photos and videos are stored in the same environment and there is no need to transfer them to anotherapplication and program.In this part of the tutorial, we want to do the first method, and in fact, we have nothing to do with the second method, which takes photos and record videos in the same environment. In the continuation of this tutorial, I will do the second method as well.1- We create a new project inAndroid Studioand choose its name as desired. The name of the project we have chosen in this tutorial is Camera.2- The type of activity that we need in this project is Blank Activity. It is better to choose an activity of this type.3- We need to create the user interface and in this user interface we need a Button and ImageView.4- Add a uses-feature tag to the project as follows:

It is worth mentioning that by entering the above code in the project, I also mention to all virtual stores such asGoogle Playthat android. hardware. camera must exist, and the existence of this is essential for the performance of the application. If there are devices that do not support this feature, they will not be displayed in the application list.

The code that should be in the AndroidManifest.xml section is as follows:


package = "com.dotnek. camera">



android: allowBackup = "true"
android: icon = "@ mipmap / ic_launcher"
android: label = "@ string / app_name"
android: roundIcon = "@ mipmap / ic_launcher_round"
android: supportsRtl = "true"
android: theme = "@ style / AppTheme">










Note:

In this section we do not need to get permission to use the camera, because we use a side program to do so. It is necessary to get a license from the camera when we want to use the main and default system camera directly and using the API, in other words, in the continuation of this tutorial, which we will do in the second way, we must have a license.5- We edit the activity layout as follows:

Read more on:https://www.dotnek.com/Blog/Apps/how-to-work-with-cameras-on-android-devices-i

link:https://dotnek.mystrikingly.com/

Related link:DOTNEK BLOG

How to start learning Android development

Android article,How to work with cameras on Android devices in two ways

Android article,What are BroadcastReceiver in Android systems, why and how to use them?

Android article,What are floating buttons in Android systems and how can they be used?

Android article,How can we change the font in Android and how to solve different problems?

Android article,What are snackbars in Android systems and how can they be used?

Android article,What are the services in Android systems and when are they used?

the ,in ,to ,and ,we ,this ,in the ,in this ,the camera ,use the ,of the

مشخصات

آخرین ارسال ها

آخرین جستجو ها


هیات کوهنوردی و صعود های ورزشی آمل shamsolah21 postby ن والقلم و مایسطرون soncell پرتو دانلود بانک لینک های دانلود فیلم ، دانلود سریال و دانلود آهنگ میباشد. زندگی روزمره من technologic Maxine's info مهاجرت به کانادا
دزدگ