1. 程式人生 > >學習APP後臺(SSM架構) + android移動端

學習APP後臺(SSM架構) + android移動端

本文章出自:

https://juejin.im/post/59df8033518825693d7b4538

由於剛剛入門android開發,想學習一下APP後端開發,故在網上找了一個demo,除錯一下跑通了,本文章主要記錄,github上down下來的程式碼怎麼調通。

app後臺程式碼:https://github.com/luqinmao/HomeServer

(1)先執行自帶的home.sql檔案,生成對應的資料庫。

(2)修改db.properties檔案,密碼修改成自己的mysql密碼。

(3)修改Tomcat版本,修改java版本。

android程式碼:https://github.com/luqinmao/Home

(1)修改 AppConst.java檔案,將ip地址改成自己的。

(2)將gradle-wrapper.properties檔案改成4.4-all。

(3)將Home目錄下的build.gradle檔案改成3.1.2。

(4)主要修改app目錄下的build.gradle檔案,修改結果如下:

apply plugin: 'com.android.application'

android {
    signingConfigs {
        config {
        }
        config1 {
            keyAlias 'home'
keyPassword '123456' storeFile file('/home/gs/01_android/signed/home.jks') storePassword '123456' } } compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { applicationId "com.lqm.home" minSdkVersion 21 targetSdkVersion 27
versionCode 1 versionName "1.0.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true ndk { //設定支援的SO庫架構 abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64","armeabi" } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.config1 } debug { signingConfig signingConfigs.config1 } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } /*暫時解決打包時fragment過載構造方法問題*/ lintOptions { checkReleaseBuilds false abortOnError false } packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/notice.txt' exclude 'META-INF/license.txt' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LGPL2.1' } aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false } repositories{ flatDir{ dirs 'libs' //arr的目錄地址 } } dependencies { androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) testImplementation 'junit:junit:4.12' implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:cardview-v7:27.1.1' compileOnly 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:design:27.1.1' implementation 'de.hdodenhof:circleimageview:2.0.0' implementation 'me.drakeet.materialdialog:library:1.2.2' //okgo implementation 'com.lzy.net:okgo:2.1.4' //3.0版本為不相容升級 implementation 'com.android.support:recyclerview-v7:27.1.1' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v2.0.7' implementation 'com.github.bumptech.glide:glide:3.7.0' implementation 'com.jakewharton:butterknife:7.0.1' implementation 'com.lzy.widget:ninegridview:0.2.1' implementation 'com.lzy.widget:imagepicker:0.5.5' implementation files('libs/pinyin4j-2.5.0.jar') annotationProcessor 'com.jakewharton:butterknife:7.0.1' //資料庫 implementation 'org.litepal.android:core:1.4.1' /*==========加入SCDN_LQR雲信模組後新增的引用 ==========*/ // 網易雲信新增依賴。注意,版本號必須一致。 // 基礎功能 (必需) implementation 'com.netease.nimlib:basesdk:3.2.0' // 音視訊需要 implementation 'com.netease.nimlib:avchat:3.2.0' // 聊天室需要 implementation 'com.netease.nimlib:chatroom:3.2.0' //PhotoView 圖片瀏覽縮放控制元件 implementation 'com.bm.photoview:library:1.4.1' //表情庫 implementation 'com.lqr.emoji:library:1.0.2' //下拉重新整理上拉載入更多控制元件 implementation 'cn.bingoogolapple:bga-refreshlayout:[email protected]' // http請求/json解析 implementation 'com.google.code.gson:gson:2.8.0' implementation 'com.alibaba:fastjson:1.2.23' //萬能介面卡 implementation 'com.lqr.adapter:library:1.0.1' //簡單的RecyclerView implementation 'com.lqr.recyclerview:library:1.0.2' //安卓視訊錄製控制元件,可以用來仿微信小視訊 implementation 'com.lqr.videorecordview:library:1.0.0' //獲取許可權 implementation 'com.lovedise:permissiongen:0.0.6' //仿微信群頭像九宮格控制元件 implementation 'com.lqr.ninegridimageview:library:1.0.0' // 開關控制元件 implementation 'com.kyleduo.switchbutton:library:1.4.4' implementation 'de.greenrobot:eventbus:3.0.0-beta1' //條形碼二維碼生成掃描 implementation 'com.google.zxing:core:3.2.1' implementation 'cn.bingoogolapple:bga-qrcodecore:[email protected]' implementation 'cn.bingoogolapple:bga-zxing:[email protected]' /*=================== end ============================*/ //地區選擇 implementation 'liji.library.dev:citypickerview:1.0.0' //時間格式 implementation files('libs/joda-time-2.5.jar') implementation files('libs/joda-time-2.5-sources.jar') //mob簡訊驗證碼 implementation name: 'SMSSDK-2.1.3', ext: 'aar' implementation files('libs/MobCommons-2016.1201.1839.jar') implementation files('libs/MobTools-2016.1201.1839.jar') //信鴿推送 implementation files('libs/jg_filter_sdk_1.1.jar') implementation files('libs/wup-1.0.0.E-SNAPSHOT.jar') implementation files('libs/Xg_sdk_v3.1_20170417_0946.jar') implementation files('libs/mid-core-sdk-3.7.2.jar') //ViewPager implementation 'cn.bingoogolapple:bga-banner:[email protected]' //圖片壓縮 implementation 'com.github.nanchen2251:CompressHelper:1.0.5' //百度地圖 implementation files('libs/baidumapapi_base_v4_3_1.jar') implementation files('libs/baidumapapi_map_v4_3_1.jar') implementation files('libs/baidumapapi_util_v4_3_1.jar') implementation files('libs/locSDK_6.13.jar') }