dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
// ButterKnife
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// Parse SDK
compile 'com.parse:parse-android:1.16.0'
}
Run Code Online (Sandbox Code Playgroud)
这是我的应用程序gradle依赖项.我不知道如何解决它.我尝试从SDK Manager Android SDK Build Tools 26.0.1安装,我也有最新版本的Android支持.
我想像app一样创建Dumpster,为此我想要在用户删除任何文件时通知我以便将其保存到我的应用程序内存中.
我使用了File Observer,但它在删除文件后发出通知,而在marshmallow中它也没有通知删除.我把这个链接称为文件观察者.在某处我读到它可能使用本机编程语言(C),但无法获得任何解决方案.我怎样才能做到这一点?提前致谢.
我试过这个:
@Override
public void onEvent(int event, String path) {
if (path == null) {
return;
}
//the monitored file or directory was deleted, monitoring effectively stops
if ((FileObserver.DELETE_SELF & event)!=0) {
FileAccessLogStatic.accessLogMsg += absolutePath + "/" + " is deleted\n";
}
}
Run Code Online (Sandbox Code Playgroud) 我在启动设备时正在开发自动PIN/PUK服务.服务在启动时启动.我正在使用ITelephony和反身方法.我的手机是棒棒糖5.1.1,它是一个有根据的连接5.我的清单让Android Studio说"权限只授予系统应用"
我正在使用此代码段:
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
int state = tm.getSimState();
if(state == TelephonyManager.SIM_STATE_PIN_REQUIRED || state == TelephonyManager.SIM_STATE_PUK_REQUIRED)
{
Log.d(TAG,"PIN PUK STATE = " + state );
if (state == TelephonyManager.SIM_STATE_PIN_REQUIRED ){
try {
message += ", PIN Code required" ;
Class clazz = Class.forName(tm.getClass().getName());
if (clazz != null) {
Method m = clazz.getDeclaredMethod("getITelephony");
m.setAccessible(true);
Object iTelephony = m.invoke(tm);
Class params[] = new Class[1];
params[0] = String.class;
Method m2 = iTelephony.getClass().getDeclaredMethod("supplyPin", params);
m2.setAccessible(true);
Object i = m2.invoke(iTelephony, "1111");
Log.d(TAG, …
Run Code Online (Sandbox Code Playgroud)