|
|
@ -2,6 +2,7 @@ package com.common.commonlibtest;
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
|
|
|
|
|
|
@ -15,6 +16,7 @@ import com.common.commonlib.net.interceptor.RequestHeadInterceptor;
|
|
|
|
import com.common.commonlib.net.interceptor.ResponseHeadInterceptor;
|
|
|
|
import com.common.commonlib.net.interceptor.ResponseHeadInterceptor;
|
|
|
|
import com.common.commonlib.utils.BaseUtils;
|
|
|
|
import com.common.commonlib.utils.BaseUtils;
|
|
|
|
import com.common.commonlib.utils.FTPUtils;
|
|
|
|
import com.common.commonlib.utils.FTPUtils;
|
|
|
|
|
|
|
|
import com.common.commonlib.utils.MMKVUtils;
|
|
|
|
import com.common.commonlibtest.bean.ArticlesResponse;
|
|
|
|
import com.common.commonlibtest.bean.ArticlesResponse;
|
|
|
|
import com.common.commonlibtest.bean.CollectionResponse;
|
|
|
|
import com.common.commonlibtest.bean.CollectionResponse;
|
|
|
|
import com.common.commonlibtest.bean.LoginResponse;
|
|
|
|
import com.common.commonlibtest.bean.LoginResponse;
|
|
|
@ -78,7 +80,8 @@ public class DemoActivity extends AppCompatActivity {
|
|
|
|
binding.btn.setOnClickListener(l -> {
|
|
|
|
binding.btn.setOnClickListener(l -> {
|
|
|
|
List<RequestHeadInterceptor> interceptors = new ArrayList<>();
|
|
|
|
List<RequestHeadInterceptor> interceptors = new ArrayList<>();
|
|
|
|
RequestHeadInterceptor.Builder builder = new RequestHeadInterceptor.Builder();
|
|
|
|
RequestHeadInterceptor.Builder builder = new RequestHeadInterceptor.Builder();
|
|
|
|
builder.addHeadParams("Cookie", "loginUserName_wanandroid_com=wang11;token_pass_wanandroid_com=6fbec4fe15d69af8b4531171798f3926;loginUserName=wang11;token_pass=6fbec4fe15d69af8b4531171798f3926");
|
|
|
|
builder.addHeadParams("Cookie",
|
|
|
|
|
|
|
|
"loginUserName_wanandroid_com=wang11;token_pass_wanandroid_com=6fbec4fe15d69af8b4531171798f3926;loginUserName=wang11;token_pass=6fbec4fe15d69af8b4531171798f3926");
|
|
|
|
interceptors.add(builder.build());
|
|
|
|
interceptors.add(builder.build());
|
|
|
|
CollectionLoader loader = new CollectionLoader(interceptors);
|
|
|
|
CollectionLoader loader = new CollectionLoader(interceptors);
|
|
|
|
loader.getCollections(0, new RequestNoResultCallBack<CollectionResponse>() {
|
|
|
|
loader.getCollections(0, new RequestNoResultCallBack<CollectionResponse>() {
|
|
|
@ -119,11 +122,18 @@ public class DemoActivity extends AppCompatActivity {
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
FTPUtils.RESULT result = FTPUtils.INSTANCE.ftpUpload("192.168.101.215", "2221", "admin", "123456", filePath, fileName);
|
|
|
|
FTPUtils.RESULT result = FTPUtils.INSTANCE.ftpUpload("192.168.101.215", "2221", "admin", "123456",
|
|
|
|
|
|
|
|
filePath, fileName);
|
|
|
|
Logger.INSTANCE.d(result.name());
|
|
|
|
Logger.INSTANCE.d(result.name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
thread.start();
|
|
|
|
thread.start();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.mmkv.setOnClickListener(l -> {
|
|
|
|
|
|
|
|
MMKVUtils.INSTANCE.put("key", 100, "aa");
|
|
|
|
|
|
|
|
int value = MMKVUtils.INSTANCE.getInt("key", "bb");
|
|
|
|
|
|
|
|
Toast.makeText(DemoActivity.this, ""+value, Toast.LENGTH_SHORT).show();
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|