By: Sagar Chamling
sudo apt install git
def getVersionName = { getVersionProps()['appVersionName'] } | |
def getVersionProps() { | |
def versionPropsFile = file('gradle.properties') | |
if (!versionPropsFile.exists()) { | |
versionPropsFile.createNewFile() | |
} | |
def versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
return versionProps |
E.g. for 50% white you'd use #80FFFFFF | |
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 |
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import kotlinx.coroutines.* | |
class CoroutinesSplashActivity : AppCompatActivity() { | |
val activityScope = CoroutineScope(Dispatchers.Main) | |
override fun onCreate(savedInstanceState: Bundle?) { |
name: Android Build | |
on: pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
https://developer.android.com/studio/publish/app-signing.html
Build and sign your app from terminal:
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
To get debug key certificate:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
To get release key certificate:
class BitmapUtils { | |
private static final String FILE_PROVIDER_AUTHORITY = "np.com.ravigarbuja.emojifyme.fileprovider"; | |
/** | |
* Resamples the captured photo to fit the screen for better memory usage. | |
* | |
* @param context The application context. | |
* @param imagePath The path of the photo to be resampled. |
public class Circle implements Shape { | |
@Override | |
public void draw() { | |
System.out.println("Circle::draw()"); | |
} | |
} |
class Laptop(builder: Builder) { | |
private val processor: String = builder.processor | |
private val ram: String = builder.ram | |
private val battery: String = builder.battery | |
private val screenSize: String = builder.screenSize | |
// Builder class | |
class Builder(processor: String) { | |
var processor: String = processor // this is necessary |
// Java code to demonstrate Builder Pattern | |
// Server Side Code | |
final class Student { | |
// final instance fields | |
private final int id; | |
private final String name; | |
private final String address; |