Skip to content

Commit

Permalink
httptools发布1.1.0版本
Browse files Browse the repository at this point in the history
  • Loading branch information
hewind committed Sep 22, 2022
1 parent 95870e3 commit 52da127
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 18 deletions.
17 changes: 14 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,32 @@ plugins {
}

android {
compileSdkVersion 31
buildToolsVersion '31.0.0'
signingConfigs {
release {
storeFile file('cymg_cy_key')
storePassword 'cymgsdk'
keyAlias 'cymgsdk'
keyPassword 'cymgsdk'
}
}
compileSdkVersion 30
buildToolsVersion '30.0.3'

defaultConfig {
applicationId "com.example.myhttputils"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
signingConfig signingConfigs.release

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
Expand All @@ -29,5 +39,6 @@ android {

dependencies {
implementation project(path: ':httptools')
implementation 'androidx.appcompat:appcompat:1.4.0'
// implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
}
Binary file added app/cymg_cy_key
Binary file not shown.
12 changes: 7 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.myhttputils">

<uses-permission android:name="android.permission.INTERNET"/>
Expand All @@ -11,17 +12,18 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/Theme.MyHttpUtils">
<activity android:name=".MainActivity">
android:theme="@style/Theme.MyHttpUtils"
tools:targetApi="m">

<uses-library android:name="org.apache.http.legacy" android:required="false" />

<activity android:name="com.example.myhttputils.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

</application>

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/example/myhttputils/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

Expand All @@ -12,11 +11,13 @@
import com.common.tools.http.itl.OnHttpRequestListener;
import com.common.tools.http.utils.HttpLog;


public class MainActivity extends Activity {

private Button btn_http;
private TextView content;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -29,7 +30,7 @@ private void initView() {
content = findViewById(R.id.content);

btn_http.setOnClickListener(view -> {
postTest();
postTest2();
});
}

Expand All @@ -38,7 +39,6 @@ private void initView() {
*/
private void postTest() {
ParamsBuild params = ParamsBuild.build();
params.put("group_id","710");
params.put("game_id","1394628137031");
params.put("role_id","123");
params.put("role_name","roleName");
Expand All @@ -58,8 +58,9 @@ private void postTest() {
//添加header
params.setHeader("Secret-Key","MUCVC-gdPpvhCtB.qKv8gaFi");
HttpRequest httpRequest = new HttpRequest(this);
httpRequest.setConnectType(HttpRequest.GET);
httpRequest.setIsRetry(true);
httpRequest.sendRequest(params, "", new OnHttpRequestListener() {
httpRequest.sendRequest(null, "url", new OnHttpRequestListener() {
@Override
public void onStart() {
HttpLog.log().i("onStart");
Expand All @@ -85,7 +86,7 @@ private void postTest2() {
params.setHeader("Authorization", "APPCODE " + appCode);
//创建一个request
HttpRequest httpRequest = new HttpRequest(this);
httpRequest.setConnectType(HttpRequest.CONNECT_TYPE_GET);
httpRequest.setConnectType(HttpRequest.GET);
httpRequest.sendRequest(params, "http://api01.aliyun.venuscn.com/ip", new OnHttpRequestListener() {
@Override
public void onStart() {
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

#android.useAndroidX=true
#android.enableJetifier=true
17 changes: 14 additions & 3 deletions httptools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ plugins {

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 2
versionName "1.1"
versionCode 110
versionName "v1.1.0"
}

buildTypes {
Expand All @@ -28,4 +27,16 @@ android {
}

dependencies {
}

task makeJar(type: Jar, dependsOn: ['compileReleaseJavaWithJavac']) {
destinationDir = file('jar/')
baseName = "httptools-" + android.defaultConfig.versionName // SDK名称
from('build/intermediates/javac/release/classes/')
exclude('**/BuildConfig.class')
exclude('**/BuildConfig\$*.class')
exclude('**/R.class')
exclude('**/R\$*.class')
include('**/*.class')
group(build)
}
Binary file added httptools/jar/httptools-v1.1.0.jar
Binary file not shown.

0 comments on commit 52da127

Please sign in to comment.