This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
| package nl.qbusict.cupboard; | |
| import android.content.ContentValues; | |
| import android.database.Cursor; | |
| import android.database.MatrixCursor; | |
| import android.test.AndroidTestCase; | |
| import nl.qbusict.cupboard.convert.EntityConverter.ColumnType; | |
| import nl.qbusict.cupboard.convert.FieldConverter; |
| /** | |
| * A Sitemap controller that automatically generates sitemap.xml for a grails website. | |
| * | |
| * Be sure to notice the controllerNamesToExclude and actionsToExclude lists | |
| * | |
| * References: | |
| * http://stackoverflow.com/questions/3748125/xml-sitemap-in-grails | |
| * http://stackoverflow.com/questions/2956294/reading-out-all-actions-in-a-grails-controller | |
| * | |
| */ |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
| Strg Alt Shift Key Function | |
| x Einf Generate/Insert dialog | |
| x x ENTER Statements completion like blocks and brackets | |
| x x T Surrond codeblock with… | |
| x W Select succesively increasing code blocks | |
| x F11 bookmarks and mark the line with selected key | |
| x F11 invokes a list of bookmarks. Pressing a key takes to associated bookmark. | |
| x x Backspace go to most recent code edit. Hit again to go even further back. | |
| x E recent opened files | |
| x x E recent edited files |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.graphics.drawable.*; | |
| import android.util.AttributeSet; | |
| import com.android.volley.toolbox.NetworkImageView; | |
| public class FadeInNetworkImageView extends NetworkImageView { | |
| private static final int FADE_IN_TIME_MS = 250; |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| /* | |
| * Copyright (c) 2017 Emil Davtyan | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |