This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| #!/usr/bin/env python3 | |
| # | |
| # Extract the ticket's id from the branch name and add it | |
| # to the commit message. Adapted from: | |
| # https://andy-carter.com/blog/automating-git-commit-messages-with-git-hooks | |
| # Parameters are explained here: | |
| # https://git-scm.com/docs/githooks#_prepare_commit_msg | |
| import re | |
| import sys |
| Android Emulator (ARM64) on EC2 - 2022 | |
| --------------------------------------- | |
| 1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64 | |
| 2. sudo apt update && sudo apt upgrade | |
| 3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb | |
| 4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip | |
| 5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk | |
| 6. sudo mv android-sdk /opt/ | |
| 7. mkdir /opt/android-sdk/cmdline-tools/latest | |
| 8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error) |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| Description | V3 | V4 |
|---|---|---|
| Entry point - optional unless you have a custom GlideModule | Glide | GlideApp |
| Bitmap transformations | bitmapTransform() |
transform() |
| Release bitmap | Glide.clear() | GlideApp.with(context).clear() |
| Custom animations | animate(android.R.anim.fade_in) | transition(GenericTransitionOptions.with(android.R.anim.fade_in)) |
| Request builder | DrawableRequestBuilder<CustomModel> |
RequestBuilder<Drawable> |
| Request builder | DrawableRequestBuilder<String> |
RequestBuilder<Drawable> |
| package com.pixite.fragment.widget; | |
| import android.content.res.Resources; | |
| import android.graphics.Canvas; | |
| import android.graphics.ColorFilter; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.graphics.drawable.Drawable.Callback; | |
| import android.view.Gravity; |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright (C) 2015 The Android Open Source Project | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| /** | |
| * Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
| * both of these conditions are already true. If you deployed from the IDE, however, this will | |
| * save you from hundreds of power button presses and pattern swiping per day! | |
| */ | |
| public static void riseAndShine(Activity activity) { | |
| activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
| PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
| PowerManager.WakeLock lock = |
| #!/bin/bash | |
| # License for any modification to the original (linked below): | |
| # ---------------------------------------------------------------------------- | |
| # "THE BEER-WARE LICENSE" (Revision 42): | |
| # Sebastiano Poggi wrote this file. As long as you retain this notice you | |
| # can do whatever you want with this stuff. If we meet some day, and you think | |
| # this stuff is worth it, you can buy me a beer in return. | |
| # ---------------------------------------------------------------------------- | |
| prefix=${1-"drawable"} | |
| buckets=( mdpi hdpi xhdpi xxhdpi xxxhdpi ) |
| // This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
| apply plugin: 'android' | |
| targetCompatibility = 1.6 | |
| sourceCompatibility = 1.6 | |
| android { | |
| target = 'android-14' |