System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
public class RefreshProgressBar extends View { | |
private static final float PROGRESS_BAR_HEIGHT = 5f; | |
private final Handler handler; | |
private boolean mIsRefreshing = false; | |
private SwipeProgressBar mProgressBar; | |
private final int mProgressBarHeight; | |
public RefreshProgressBar(Context context) { |
package android.support.v4.widget; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.os.Handler; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.ColorRes; | |
import android.support.annotation.NonNull; | |
import android.support.v4.content.ContextCompat; | |
import android.util.AttributeSet; |
package com.rain.example.data.provider; | |
import com.rain.example.data.database.RainEmployeeDatabase; | |
import com.rain.example.data.database.table.*; | |
import android.provider.BaseColumns; | |
import android.text.TextUtils; | |
import android.content.ContentUris; | |
import android.database.sqlite.SQLiteQueryBuilder; |
/* | |
* Copyright (C) 2009 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
public static int getCurrentCountryCode(Context context) { | |
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); | |
String countryIso = telephonyManager.getSimCountryIso().toUpperCase(); | |
return PhoneNumberUtil.getInstance().getCountryCodeForRegion(countryIso); | |
} | |
PhoneNumberUtil 引用自 | |
compile 'com.googlecode.libphonenumber:libphonenumber:8.3.1' | |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
import android.database.Cursor; | |
import android.support.annotation.NonNull; | |
import com.raizlabs.android.dbflow.runtime.DBTransactionInfo; | |
import com.raizlabs.android.dbflow.runtime.TransactionManager; | |
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction; | |
import com.raizlabs.android.dbflow.runtime.transaction.QueryTransaction; | |
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener; | |
import com.raizlabs.android.dbflow.sql.builder.ConditionQueryBuilder; | |
import com.raizlabs.android.dbflow.sql.language.Delete; |
package com.yelp.android.ui.widgets; | |
import com.yelp.android.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; |
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |