# Environment Setup

This tutorial guides you through the technical requirements and initial procedures for setting up your development environment and connecting the **Newland N750P** terminal.

## Technical requirements

Before beginning the installation, ensure you have the following hardware and software components available:

* **Terminal**: Newland N750P.
* **Cables**: Multi-port cable including POWER, USB-A, RJ-45, and HDMI.
* **Power Supply**: 100-240V AC 50/60Hz to 9.0V DC, 2.5A.
* **Operating System**: NDroid6 based on Android 12.
* **Development IDE**: Android Studio 2023.2.1 Iguana.
* **Serial Port Configuration**: **115200, 8, N, 1** (115200 baud rate, 8 data bits, no parity, 1 stop bit).

## Hardware connection and startup

Follow these specific steps to power on and connect your terminal correctly. Proper cable management is essential for system stability.

1. Connect the multi-port cable's HDMI connector to the back of the N750P terminal.
2. Connect the **POWER** port of the cable to the provided power supply.
3. The device will power on automatically once the power source is connected.
4. Establish communication based on your current environment:
   * **Production Environment**: Use the **USB Type-A port** to establish the data link between the terminal and the PC.
   * **Development/Debugging**: Connect a **USB Type-C cable** directly to the terminal for application installation and code debugging.

> **Safety Warning**: Do not connect both the USB Type-A and USB Type-C cables at the same time. The device must be powered on with only the single intended data cable connected.

## Developer mode and verification

Before attempting to synchronize with Android Studio, you must ensure the terminal is prepared for debugging:

* **Prerequisite**: The device must have **Developer Mode enabled** to be recognized by the IDE via USB Type-C.
* **Verification**: Check the device display for the **"DEVELOPMENT ONLY"** watermark. If this is visible, the terminal is ready for development use.

## Android Studio project setup

Once the hardware is connected and verified, prepare the project within the IDE:

1. Launch Android Studio and select **File > Open**.
2. Navigate to the project's root folder and click **OK**.
3. **Gradle Synchronization**: Wait for Android Studio to finish the synchronization process. If the IDE prompts to update plugins or dependencies, **accept the recommendations**. The environment is only "ready" once the sync finishes and the project structure is fully visible.
4. Connect the terminal to your workstation via USB Type-C.
5. Verify the device is recognized in the selection bar at the top of the IDE; it should appear as **"newland N750P"**.

## Compiling and running the project

With the environment ready and the terminal recognized:

1. Ensure the **"app"** module is selected in the run configurations dropdown.
2. Click the **Run 'app'** icon or press **Shift + F10**.
3. Android Studio will compile, install, and launch the application on the terminal automatically.

## Generating the installable APK

To produce a standalone APK for distribution or testing:

1. Select **Build > Clean Project**. This specifically deletes all files in the `outputs` directory to ensure a fresh build.
2. Select **Build > Rebuild Project** to compile the application from scratch.
3. Select **Build > Build Bundle(s) / APK(s) > Build APK(s)**.
4. When the build finishes, click **locate** in the pop-up notification to open the destination folder.

## Next steps

With your environment successfully configured and the terminal connected, you can proceed to the following sections:

1. [**Configuration & Connectivity**](https://docs.globalgetnet.com/en/products/in-store-payments/host-to-host?doc=h2h-configuration-and-connectivity\&section=qhv6nzspm4fa7zajc43yr3ka): Execute your first communication test using the **Echo Request (Y0I)** command.
2. [**Architecture & Core Concepts**](https://docs.globalgetnet.com/en/products/in-store-payments/host-to-host?doc=h2h-system-architecture\&section=qkgon7kvze04x46w47u75f1n): Understand the internal software modules and secure data handling procedures before starting full integration.