Browse Source

1、Android的mob登录测试

tags/0.0.2+11
PH2 4 years ago
parent
commit
3bfffe4d09
6 changed files with 63 additions and 5 deletions
  1. +49
    -4
      example/android/app/build.gradle
  2. BIN
     
  3. +2
    -1
      example/android/app/src/main/AndroidManifest.xml
  4. BIN
     
  5. +1
    -0
      example/android/build.gradle
  6. +11
    -0
      example/lib/main.dart

+ 49
- 4
example/android/app/build.gradle View File

@@ -23,6 +23,16 @@ if (flutterVersionName == null) {

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// 导入MobSDK
apply plugin: 'com.mob.sdk'

MobSDK {
appKey "30dc33054b635"
appSecret "396e98c293130c9976fb7428b6b434d6"

SecVerify {}
SMSSDK {}
}

android {
compileSdkVersion 28
@@ -33,21 +43,56 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "cn.zhios.zhiying_comm_example"
applicationId "cn.zhios.zhiying"
minSdkVersion 19
targetSdkVersion 28
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs{
release {
storeFile file("zhiying.jks")
storePassword "zhioscom"
keyAlias "zysh"
keyPassword "zhioscom"
v1SigningEnabled true
v2SigningEnabled true
}
}

flavorDimensions "app"

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
}

dexOptions {
//最大堆内存
javaMaxHeapSize "4g"//4g
//使用增量模式构建
incremental true
//是否支持大工程模式
jumboMode = true
//预编译
preDexLibraries = false
//线程数
threadCount = 8
}

}

flutter {


BIN
View File


+ 2
- 1
example/android/app/src/main/AndroidManifest.xml View File

@@ -10,7 +10,8 @@
android:name="io.flutter.app.FlutterApplication"
android:label="zhiying_comm_example"
android:icon="@mipmap/ic_launcher"
tools:replace="android:label">
android:allowBackup="false"
tools:replace="android:label, android:allowBackup">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"


BIN
View File


+ 1
- 0
example/android/build.gradle View File

@@ -6,6 +6,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.mob.sdk:MobSDK:+'
}
}



+ 11
- 0
example/lib/main.dart View File

@@ -6,6 +6,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:zhiying_comm/register.dart';
import 'package:zhiying_comm/util/shared_prefe_util.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:zhiying_comm/pages/login_page/login_page.dart';

import 'taobao_image_viewer.dart';

@@ -206,6 +207,16 @@ class HomePage extends StatelessWidget {
},
child: Text('预览图片'),
),

RaisedButton(
onPressed: () async {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return LoginPage();
}));
},
child: Text('打开登录'),
),

],
),
),


Loading…
Cancel
Save