日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
android開發(fā)中使用okhttp上傳文件到服務器-創(chuàng)新互聯(lián)

開發(fā)android手機客戶端,常常會需要上傳文件到服務器,比如:你手機里的照片。

為嵩縣等地區(qū)用戶提供了全套網(wǎng)頁設計制作服務,及嵩縣網(wǎng)站建設行業(yè)解決方案。主營業(yè)務為成都做網(wǎng)站、成都網(wǎng)站制作、嵩縣網(wǎng)站設計,以傳統(tǒng)方式定制建設網(wǎng)站,并提供域名空間備案等一條龍服務,秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!

使用okhttp會是一個很好的選擇。它使用很簡單,而且運行效率也很高。

首先,在 app/build.gradle 的 dependencies 增加 implementation 'com.squareup.okhttp3:okhttp:3.8.1' 可以參照如下代碼

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
  compileSdkVersion 26
  defaultConfig {
    applicationId "com.cofox.mykt.myweather"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
  sourceSets {
    main {
      res.srcDirs =
          [
              'src/main/res/layout/menufunction',
              'src/main/res'
          ]
    }
  }
}
dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
  implementation 'com.android.support:appcompat-v7:26.1.0'  implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  testImplementation 'junit:junit:4.12'  androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  implementation 'org.jetbrains.anko:anko-sdk19:0.10.3'
  implementation 'org.jetbrains.anko:anko-support-v4:0.10.3'
  implementation 'org.jetbrains.anko:anko-appcompat-v7:0.10.3'
  implementation 'com.google.code.gson:gson:2.7'
implementation 'com.android.support:percent:26.1.0'
  implementation 'com.squareup.okhttp3:okhttp:3.8.1'
}

分享名稱:android開發(fā)中使用okhttp上傳文件到服務器-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://www.dlmjj.cn/article/pgjpd.html