Skip to content

Instantly share code, notes, and snippets.

View CreatorB's full-sized avatar
🏠
Working from home

Hasan Basri CreatorB

🏠
Working from home
View GitHub Profile
@CreatorB
CreatorB / SimpleAudioPlayer.kt
Created October 28, 2021 16:01
Android Simple Audio Player
package com.blogspot.situbondoprogrammer.voicepress
import android.content.Context
import android.media.MediaPlayer
class SimpleAudioPlayer {
private var mMediaPlayer: MediaPlayer = MediaPlayer()
private fun stopAudio() {
try {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
val view = binding.root
setContentView(view)
b.apply {
btn1.setOnClickListener(listenerVoice)
tv1.setOnClickListener { requestAPI() }
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Android.gitlab-ci.yml
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image: openjdk:11-jdk
@CreatorB
CreatorB / AuthenticationInterceptor.java
Created September 7, 2021 00:46 — forked from libindev/AuthenticationInterceptor.java
Retrofit service with oAuth 2.
public class AuthenticationInterceptor implements Interceptor {
private String authToken;
public AuthenticationInterceptor(String token) {
this.authToken = token;
}
@Override
public Response intercept(Chain chain) throws IOException {
@CreatorB
CreatorB / MyDialog.java
Created September 22, 2018 00:40
custom dialog android
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
showMyDialog(this);
}
public void showMyDialog(final Activity activity) {
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="fa-adjust">&#xf042;</string>
<string name="fa-adn">&#xf170;</string>
<string name="fa-align-center">&#xf037;</string>
<string name="fa-align-justify">&#xf039;</string>
<string name="fa-align-left">&#xf036;</string>
<string name="fa-align-right">&#xf038;</string>
<string name="fa-ambulance">&#xf0f9;</string>
<string name="fa-anchor">&#xf13d;</string>
@CreatorB
CreatorB / adb-screenshot.sh
Last active April 13, 2017 16:26 — forked from hkurokawa/adb-screenshot.sh
A shell script to take a screen shot of the android device, resize it and copy to clipboard
#! /bin/bash
## This script is for taking a screen shot of an Android device.
## If possible, it tries to resize the image file and then copy to the clipboard.
##
## Note the script generates screenshot_yyyyMMddHHmmss.png and screenshot_yyyyMMddHHmmss_s.png
## under /sdcard on the device (you can specify another location with '-t' option)
## and copies it to the current working directory.
##
## The script passes unrecognized arguments to adb command, which means you can specify "-e" or "-d"
# Di beberapa versi gradle secara default, gradle dalam keadaan mati
# Tentu dengan menghidupkannya tidak perlu melakukan proses startup berulang kali
# ada baiknya anda membaca https://docs.gradle.org/current/userguide/gradle_daemon.html
org.gradle.daemon=true
# Opsi spesifik dalam menentukan JVM arguments pada proses daemon dimana hal ini mempengaruhi kinerja memori.
# https://docs.gradle.org/current/userguide/userguide_single.html#sec:gradle_configuration_properties
# Default value: -Xmx10248m -XX:MaxPermSize=256m
@CreatorB
CreatorB / local.properties
Created June 30, 2016 22:27
my current local.properties path to handle The SDK directory does not exist - Android Studio
sdk.dir=/Users/creatorbe/Library/Android/sdk
@CreatorB
CreatorB / AST_CREATORBE
Created June 25, 2016 09:25
AST CREATORBE - Awesome Command for Android Source Test
---
#LEVEL : Medium (for beginner please read another source of android cli development with clear installations).
#It's not a normal development-lifecycle, just simple case when you see so many android source code in a bad condition,
#the real hell yeah what the situation is less documentations and you just wanna launch it too see what is it but the sources missed compiled apk too. WTF :v
#and so really time consumed for open match IDE like eclipse or AS just for tell you what the source it.
---
/*
AST CREATORBE - Android Development in Command Line Interfaces (terminal) mode.
#but it isn't clear way "cli development" JUST A PART "Compile source code android from terminal" (... you can edit this gist when you wanna write full tutorial)