Posts

🚀 COMPLETE CI/CD FROM SCRATCH

Image
  🚀 COMPLETE CI/CD FROM SCRATCH Drone + Android + Firebase + ngrok (LOCAL SETUP) 🧠 BIG PICTURE (UNDERSTAND FIRST) Your setup looks like this: GitHub Repo ↓ webhook (via ngrok) Drone Server (localhost) ↓ Drone Docker Runner ↓ Android Build (Docker) ↓ Firebase App Distribution Why ngrok? GitHub cannot reach localhost ngrok gives temporary public HTTPS URL GitHub sends webhook → ngrok → Drone 🧱 STEP 0 — REQUIREMENTS (ONCE) Install these on Windows: 1️⃣ Docker Desktop Enable WSL2 backend Docker must show: Docker Desktop is running 2️⃣ Git git --version 3️⃣ ngrok Download from https://ngrok.com/download Login once: ngrok config add-authtoken <YOUR_TOKEN> 🧱 STEP 1 — CREATE FIREBASE PROJECT (ONCE) Firebase Console Create project Add Android app Note: Application ID (package name) Firebase App ID (looks like 1:xxxx:android:xxxx ) 🧱 STEP 2 — FIREBASE SERVICE ACCOUNT (CRITICAL) Why? CI cannot run firebase login ...

Generate Signing Release keystore

  ✅ 1. RELEASE KEYSTORE (WHAT YOU CREATED) You created this using: keytool -genkeypair -v \ -keystore fintrack-release.keystore \ -keyalg RSA -keysize 2048 -validity 10000 \ - alias fintrack 🔍 What each part means Parameter Meaning keytool Java tool to create/manage keys -genkeypair Generates a public + private key -keystore fintrack-release.keystore File that stores your signing key -keyalg RSA Secure encryption algorithm -keysize 2048 Industry-standard strength -validity 10000 Valid for ~27 years -alias fintrack Identifier for this key 📦 What’s Inside the Keystore? Your keystore file contains : 🔑 Private Key (MOST IMPORTANT – NEVER LOSE) 🪪 Public Certificate 🔐 Password protection 👉 Google Play uses this to verify that future updates belong to you 🚨 VERY IMPORTANT RULES (You did it right) ✅ Keystore backed up securely ✔ Good practice: Google Drive (encrypted) External HDD / USB Password manager notes ❌ NEVER: Push to GitHub Shar...

Integrate SonarQube to Android Studio Project

Image
  1️⃣ Go to SonarQube Dashboard Example: http: //localhost:9000 Login with: username: admin password : admin ------------------------------------------------------------------------ 2️⃣ Click Create Project You’ll see multiple options. Choose “Manually” . You choose Manual because: You want full control You’ll connect it later via Gradle + CI/CD Best for Android projects -------------------------------------------------------------------------------- 🔸 Fill Project Details ✅ Project Key → FinTrack What it is A unique ID for your project Used internally by SonarQube Used in Gradle command Example:-Dsonar.projectKey=FinTrack ⚠️ Rules Must be unique No spaces Cannot be changed easily later 📌 Think of it like applicationId in Android ✅ Display Name → FinTrack What it is Human-readable name Shown in SonarQube UI You can change this later safely. 🔐 PART 2: Generate Token (Very Important) 📌 What is a SonarQube Token? A token is: A secure authentication key Replac...

Camera Application

 MainActivity -    package com.example.cameraapplication; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.os.Build; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; import java.io.IOException; public class MainActivity extends AppCompatActivity implements View.OnClickListener {     ImageView imageView;     Button camera, setWall;     Bitmap bitmap;     private static final int PERMISSION_REQUEST_CODE = 100;     private static final int...

Login Example

 Mainactivity - package com.example.loginvalidation; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class MainActivity extends AppCompatActivity {     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         requestWindowFeature(Window.FEATURE_NO_TITLE);         getSupportActionBar().hide();         this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);         setContentView(R.layout.activity_main);         Thread thread=new Thread(){             @Override             public void run() {               ...