This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.* | |
import java.time.LocalDateTime | |
import java.util.UUID | |
import java.math.*; | |
/** | |
* UUIDを16ビット分割 | |
*/ | |
fun main(args : Array<String>) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CoroutineScopeActivity : AppCompatActivity(), CoroutineScope { | |
lateinit var job: Job | |
override val coroutineContext: CoroutineContext | |
get() = Dispatchers.Main + job | |
private var goBackToSleepJob: Job? = null | |
private var count: Int = 0 | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DateUtils { | |
static DateTime dayOfWeekInMonth(int year, int month, int times, int weekday) { | |
// 指定年月の1日の日付 | |
var dt = new DateTime(year, month, 1); | |
// 指定週の日 (1週目->1,2週目->8,3週目->15,4週目->22,4週目->29) | |
var day = (times - 1) * 7 + 1; | |
// 指定年月の1日の曜日と指定曜日の差 | |
var offset = weekday - dt.weekday; | |
// 日を補正 | |
if (offset < 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main () { | |
// get today's date | |
var now = new DateTime.now(); | |
// set it to feb 10th for testing | |
//now = now.add(new Duration(days:7)); | |
int today = now.weekday; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ adb shell dumpsys activity service GcmService | |
SERVICE com.google.android.gms/.gcm.GcmService 8ad9305 pid=2768 | |
Client: | |
DeviceID: 4549450728827696292 | |
connected=mtalk.google.com/108.177.125.188,port=5228 | |
streamId=2/1,connects=1,connectAttempts=0,failedLogins=0,lastConnectionDurationS=0,lastConnectionErrorCode=0,packets=2/1,bytes=181/341 | |
connectTime=00:00/00:00 | |
Heartbeat: alarm(28:49 initial: 1740s) | |
=== Adaptive Heartbeat === | |
Enabled FallFast? true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layout_gravity="center" | |
android:clipToPadding="false" | |
android:gravity="center" | |
android:padding="32dp"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb shell monkey -p package -v --pct-trackball 0 --pct-syskeys 0 --throttle 300 10000 | |
[Monkey - UI / アプリケーション エクササイザ - ソフトウェア技術ドキュメントを勝手に翻訳](http://www.techdoctranslator.com/android/developing/tools/monkey) | |
android - Change screen orientations during monkey run - Stack Overflow http://stackoverflow.com/questions/12872917/change-screen-orientations-during-monkey-run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------- | |
# Verifies the 9patch using aapt command | |
# ---------------------------------------------------------------- | |
$ aapt | |
... | |
aapt c[runch] [-v] -S resource-sources ... -C output-folder ... | |
Do PNG preprocessing on one or several resource folders | |
and store the results in the output folder. | |
aapt s[ingleCrunch] [-v] -i input-file -o outputfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 実機に接続 | |
$ adb shell | |
# コピー先の空ファイルを作成 | |
$ touch /data/local/tmp/mydatabase.db | |
# アプリにrun-as | |
$ run-as [package] | |
$ cd databases | |
# ファイルコピー | |
$ dd if=mydatabase.db of=/data/local/tmp/mydatabase.db | |
# run-as からexit |