System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
public class MainActivity extends Activity { | |
private static final String TAG = MainActivity.class.getSimpleName(); | |
private final MainActivity self = this; | |
MainService mService; | |
MyServiceConnection mConn; | |
boolean mIsBound; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
// --------------------------------------------------- | |
// Get the color and more attributes from the theme. | |
// --------------------------------------------------- | |
TypedArray ta = context.getTheme().obtainStyledAttributes(R.styleable.ViewStyle); | |
int labelColor = ta.getColor(R.styleable.ViewStyle_labelColor, defValue); | |
int dividerColor = ta.getColor(R.styleable.ViewStyle_dividerColor, defValue); | |
float textSize = ta.getDimension(R.styleable.ViewStyle_textSize, defValue); |
<Button | |
android:id="@+id/button1" | |
style="@style/GlossyGradientButtonStyle" | |
android:layout_width="wrap_content" | |
android:layout_height="@dimen/button_height" | |
android:minWidth="100dp" | |
android:text="OK" /> | |
<Button | |
android:id="@+id/button2" |
class DateTimeSerializer { | |
static DateTime? deserialize(String? serialized) { | |
if (serialized == null) return null; | |
final serializedString = serialized; | |
final fixed = serializedString.replaceAllMapped( | |
RegExp(r'(.*:\d\d)(\.\d+)?(Z|[+-]\d{2}:\d{2})'), | |
(match) { | |
// #1 capturing group is date and time without a fraction of a second |
/** | |
* A generic class that holds a value with its loading status. | |
* @param <T> | |
*/ | |
// ImmutableClass | |
class Resource<T> private constructor( | |
val status: Status, | |
val data: T? = null, | |
val throwable: Throwable? = null, | |
val id: Long = 0 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
window.MediaSource = window.MediaSource || window.WebKitMediaSource; | |
function testTypes(types) { | |
for (var i = 0; i < types.length; ++i) | |
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i])); | |
} |
import 'dart:convert'; | |
import 'package:logger/logger.dart'; | |
class PrettyLogPrinter extends LogPrinter { | |
static final levelColors = { | |
Level.verbose: AnsiColor.fg(AnsiColor.grey(0.5)), | |
Level.debug: AnsiColor.none(), | |
Level.info: AnsiColor.fg(12), | |
Level.warning: AnsiColor.fg(208), |
public class SignalStrengthListener extends PhoneStateListener { | |
@Override | |
public void onSignalStrengthsChanged(SignalStrength signalStrength) { | |
super.onSignalStrengthsChanged(signalStrength); | |
boolean isGsm = signalStrength.isGsm(); | |
// Get the CDMA RSSI value in dBm | |
int iCdmaDbm = signalStrength.getCdmaDbm(); | |
// Get the CDMA Ec/Io value in dB*10 |
setup maven-android
####環境変数 export ANDROID_HOME=/opt/android_sdk_linux
####Maven Android SDK Deployer のインストール git clone https://github.com/mosabua/maven-android-sdk-deployer.git cd maven-android-sdk-deployer
####SDKをMavenリポジトリへインストール