Demonstrate how to easily program Android apps on Gitpod

Overview

Developing Android apps on Gitpod

This project is intended to demonstrate how to easily program Android apps on Gitpod. It is based on this guide and this flutter template. This image already enables you to program for Flutter Web - in this guide however I want to focus on programming on a real device.

Open in Gitpod

Requirements

  • Gitpod (or other cloud IDE)
  • Android phone (Android 11+)
  • ngrok (or other tunneling software)
  • Wi-fi connection between the current device (laptop) and the phone

Step 1 - Enable web debugging

References: Gadgethacks - Picture source / Gitconnected

On your Android 11+ phone, enable developer settings by tapping the build number multiple times. After the developer settings are unlocked, open them up and enable "Wireless debugging". Once this is enabled, click on the text next to the toggle to get to the details of this setting.

Enable wireless debugging Allow wireless debugging

Write down the displayed IP and port - this is the connection for the main ADB connection.

Main ADB connection interface

Click on "Pair device with pairing code" below - you will see a pairing code, the same IP address and a different port. Write these down as well and keep this window open. This is the connection only for pairing.

Pairing ADB connection interface

Step 2 - Tunnel ADB via ngrok

Download ngrok. Open a terminal on your computer, that must be in the same wifi network like the phone. You can verify this by pinging the phone IP address like ping 192.168.178.33 - if the ping succeeds, your network settings are correct.

Run ngrok to tunnel the pairing connection first, for example ngrok tcp 192.168.178.33:42739. ngrok will provide you with an external domain and port, like 0.tcp.ngrok.io:13840.

ngrok sample screen

Open your Android code in your cloud IDE with adb installed - like this example. Use the command line terminal in the IDE to pair the IDE with the device like adb pair 0.tcp.ngrok.io:13840. Enter the pairing code and wait until the connection is confirmed.

Terminate the ngrok tunnel for the pairing connection (CTRL + C in the local terminal). Now create a new tunnel for the main ADB connection, like ngrok tcp 192.168.178.33:37829 which will provide you with a new domain and port like 6.tcp.ngrok.io:16514.

Now connect to the main ADB connection via adb connect 6.tcp.ngrok.io:16514 - this requires the previous pairing step to succeed. The connection should establish successfully.

Step 3 - Run the app

Once the connection is established, you can use your phone in combination with the IDE to work on apps as usual.

In the example mentioned above, you can list all connected devices via flutter devices. Build and push a development build to the device via flutter run. This will compile the code, pushes it to the phone via the internet and launches it on the phone.

Flutter Programming View

You might also like...

A flutter clean architecture series, the way we build clean apps.

Flutter Clean Archeticture Series 🌍 "Making the world a better place" ✅ Full Articles You can check out the full Medium articles on devmuaz ✅ Branche

Jan 4, 2023

Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.

Dec 24, 2022

A Flutter starter-kit for production-level apps.

A Flutter starter-kit for production-level apps.

Flutter Starter Introduction We wanted to take Flutter a step further and accelerate the process of building production-level apps. Presenting our sol

Dec 30, 2022

A collection of sample apps that use Stream

A collection of sample apps that use Stream

Flutter samples Quick Links Register to get an API key for Stream Chat Flutter Chat Tutorial Chat UI Kit Flutter SDK Repo What is Stream? Stream allow

Dec 21, 2022

Learn how to incorporate Firebase into our Flutter apps

Learn how to incorporate Firebase into our Flutter apps

Flash Chat ⚡️ Our Goal The objective of this tutorial is to learn how to incorporate Firebase into our Flutter apps. We'll be using Firebase Cloud Fir

Oct 27, 2021

A set of counter apps made for #FlutterCounterChallenge2020

flutter_counter_challenge_2020 A set of counter apps made for #FlutterCounterChallenge2020. Run flutter create . inside the repository after cloning i

Dec 30, 2022

Ensiklopedi Multiplatform Apps

ensiklopedi A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Dec 9, 2021

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps.

Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps. Preview Mobile Vertical Card Pager Web Web Link Insta

Dec 9, 2022

A flutter plugin for integrating Mobile Money Payments to your flutter apps

A flutter plugin for integrating Mobile Money Payments to your flutter apps

Add Mobile Money payments to your flutter apps using the FlutterWave api gateway. Features Recieve Payments through Mobile Money in Uganda Supports MT

Nov 9, 2022
Owner
James Cullum (Pseudonym)
James Cullum (Pseudonym)
A Flutter application to demonstrate how to implement Google maps and its advanced options in a flutter app.

google_maps_flutter_example A new Flutter application to demonstrate how to implement flutter google maps in a flutter application and perfoem advance

Hesham Erfan 11.7k Jan 8, 2023
In this Project I will demonstrate you the power of firebase remote config :)

power-of-firebase-remote-config In this Project I will demonstrate you the power of firebase remote config :) This project serves as a template. Purpo

null 4 Mar 7, 2022
Movies Mobile Application to demonstrate Network calls in Flutter using with Chopper library

Movies Mobile Application to demonstrate Network calls in Flutter using with Chopper library. For API TMDB API console is used.

Varun Verma 1 Nov 7, 2022
Minimal Unsplash Android App to easily search, explore and download images using Unsplash API.

Minimal Unsplash Android App to easily search, explore and download images using Unsplash API. Download Button to download the image. User can set the image as a wallpaper. There is a favorite icon, which user can tap to mark/un-mark that image as a favorite.

derpLLC 1 Mar 27, 2022
Flutter project file sturcture that can help me to create new project easily

flutter_project_arch A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Rafat Jamader Meraz 1 Oct 9, 2022
LogiFresh helps you build a login easily with a friendly design, and very flexible for its construction

Login Fresh LogiFresh helps you build a login easily with a friendly design, and very flexible for its construction. Installation Follow the install i

Cristhian Hernández 9 Nov 24, 2022
Flutter social button - A flutter package to create social media login buttons easily to any flutter app

Flutter Social Button is a flutter package to create social media login buttons easily to any flutter app.

Alok Dubey 10 Dec 5, 2022
Poi-Poi-ToDo - A Task Management App where you can create task & maintain your daily life easily

"Poi Poi Todo" is a Task Management App where you can create task & maintain your daily life easily. In this app we use Path Provider, SQLite Database, DateTime Picker etc flutter pakages.

CPAD-Gazipur 8 Oct 30, 2022
Flutter Advanced: Background Fetch | Run code in the background Android & iOS | Run code in the background Android & iOS

flutterbackground A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Pawan Kumar 40 Dec 16, 2022
Firebase + Flutter sample apps with code snippets, supported by comprehensive articles for each implementation.

FlutterFire Samples This repo is created to contain various sample apps demonstrating the integration of Firebase with Flutter. The final goal is to c

Souvik Biswas 186 Dec 24, 2022