View Counter.kt
package io.bitsound.apitestapp.utils
import io.reactivex.subjects.BehaviorSubject
import java.util.concurrent.atomic.AtomicInteger
class Counter {
val value: AtomicInteger = AtomicInteger()
val emitter: BehaviorSubject<Int> = BehaviorSubject.createDefault(value.toInt())
View PreloadAppVerifier.kt
/* Package Inspection */
val manager = this.packageManager
manager.getInstalledPackages(0)
.map { manager.getApplicationInfo(it.packageName, 0) }
.forEach { Timber.d("${it.packageName} installed at ${it.publicSourceDir} is ${if (it.flags and ApplicationInfo.FLAG_SYSTEM != 0) "a system app" else "not a system app"}") }
View Storage.kt
package io.sample.utils
import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences
import io.sample.App
import java.util.*
object Storage {
View echo.kt
infix fun <T> T.echo(activity: MainActivity): T {
when (this) {
is Int -> activity.logging(Stringify.result(this), TextLogData.Type.MESSAGE)
is String -> activity.logging(this, TextLogData.Type.MESSAGE)
else -> activity.logging("Unexpected arguments for $this.echo($activity)", TextLogData.Type.MESSAGE)
}
return this
}
fun foo() = this.let { activity ->
View Android Wifi Debugging.md

Remote Debugging using wi-fi

We need remote debugger to get logs from the device through logcat. Both the device and PC should be under same wi-fi router : like mrl

  1. Connect the device to the PC using USB and establish an ADB connection
  2. adb tcpip 5555 # 5555 is the port number
  3. Disconnect your USB cable
  4. adb connect MOBILE_IP:port => adb connect 192.IP_REMAINING:5555
  5. Tern on AndroidStudio and check the logcat
View BitsoundSmartOnReceiver.log
07-09 02:23:02.901 29753-29753 D/BitsoundSmartOnReceiver: [onReceive] __INSTANCE__apitestapp.receivers.BitsoundSmartOnReceiver@ea1db58__LISTENER__apitestapp.MainActivity$$Lambda$18@9cf64b1__THIS__apitestapp.receivers.BitsoundSmartOnReceiver@e1a3056
07-09 02:23:14.855 29753-29753 D/BitsoundSmartOnReceiver: [onReceive] __INSTANCE__apitestapp.receivers.BitsoundSmartOnReceiver@ea1db58__LISTENER__apitestapp.MainActivity$$Lambda$18@9cf64b1__THIS__apitestapp.receivers.BitsoundSmartOnReceiver@a20fbe2
07-09 02:23:19.882 29753-29753 D/BitsoundSmartOnReceiver: [onReceive] __INSTANCE__apitestapp.receivers.BitsoundSmartOnReceiver@ea1db58__LISTENER__apitestapp.MainActivity$$Lambda$18@9cf64b1__THIS__apitestapp.receivers.BitsoundSmartOnReceiver@2d6f42e
07-09 02:23:26.895 29753-29753 D/BitsoundSmartOnReceiver: [onReceive] __INSTANCE__apitestapp.receivers.BitsoundSmartOnReceiver@ea1db58__LISTENER__apitestapp.MainActivity$$Lambda$18@9cf64b1__THIS__apitestapp.receivers.BitsoundSmartOnReceiver@6e2253a
07-09 02:23:38.8
View BitsoundSmartOnReceiver.java
package io.bitsound.apitestapp.receivers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import java.util.Locale;
import io.bitsound.receiver.BitsoundContents;
View _base.html
{% load static %}
{% load string_filters %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>EPG Automator</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
View gitget.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os, subprocess, shlex
# param 'short' for shortening hash (slice for commit hash, abbreviation for tag name)
# param 'tag and not commit' for returning tag name only
# param 'commit and not tag' for returning commit hash only
def gitget(short=False, tag=False, commit=False):
if tag and commit : tag, commit = False, False
# Cosntants
View MainActivity.java
package ly.soundl.test.batterytester;
import android.Manifest;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;