lyq.me@qq.com 1 year ago
parent
commit
527f693df9
5 changed files with 67 additions and 10 deletions
  1. 3 0
      .gitignore
  2. 1 0
      app/.gitignore
  3. 37 0
      app/build.gradle
  4. 21 0
      app/proguard-rules.pro
  5. 5 10
      app/src/main/AndroidManifest.xml

+ 3 - 0
.gitignore

@@ -1,3 +1,6 @@
 /gen
 /bin
 /.settings
+.gradle/
+.gradle/7.3.3/fileHashes/fileHashes.lock
+.gradle/buildOutputCleanup/buildOutputCleanup.lock

+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 37 - 0
app/build.gradle

@@ -0,0 +1,37 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 33
+
+    defaultConfig {
+        applicationId "me.yoqi.android.androidmvvm"
+        minSdkVersion 16
+        targetSdkVersion 33
+        versionCode 10001
+        versionName "1.0.1"
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    
+    implementation 'androidx.appcompat:appcompat:1.5.0'
+    implementation 'com.google.android.material:material:1.6.1'
+    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+    testImplementation 'junit:junit:4.13.2'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+
+    implementation "androidx.room:room-runtime:2.2.0-rc01"
+    implementation "androidx.room:room-rxjava2:2.2.0-rc01"
+
+}

+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 10
app/src/main/AndroidManifest.xml

@@ -1,14 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.baidu.baidulocationdemo"
-    android:versionCode="1"
-    android:versionName="1.0" >
+    package="com.baidu.baidulocationdemo" >
 
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="15" />
-
-  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" >
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" >
     </uses-permission>
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
     </uses-permission>
@@ -36,9 +30,9 @@
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
-        android:theme="@android:style/Theme.Black"
-         >
+        android:theme="@android:style/Theme.Black">
         <service
+            android:exported="true"
             android:name="com.baidu.location.f"
             android:enabled="true"
             android:process=":remote" >
@@ -53,6 +47,7 @@
             android:name="com.baidu.lbsapi.API_KEY"
             android:value="请输入AK" />
         <activity
+            android:exported="true"
             android:name="com.baidu.baidulocationdemo.MainActivity"
             android:label="@string/app_name" >
             <intent-filter>