增加app项目
This commit is contained in:
parent
f65b6d8c03
commit
addd979586
16
xinli-App/.gitignore
vendored
Normal file
16
xinli-App/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
||||
43
xinli-App/README.md
Normal file
43
xinli-App/README.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# 心历App - 局域网网址浏览器
|
||||
|
||||
一个简单的Android应用,用于配置和打开局域网内的网址。
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 📱 配置局域网网址
|
||||
- 💾 自动保存配置的网址
|
||||
- 🌐 内置WebView浏览器
|
||||
- 🔄 支持网页前进后退
|
||||
- 📋 支持HTTP和HTTPS协议
|
||||
|
||||
## 使用方法
|
||||
|
||||
1. 在输入框中输入局域网网址(例如:`192.168.1.100:8080`)
|
||||
2. 点击"保存并打开"按钮保存网址并打开网页
|
||||
3. 或点击"打开"按钮直接打开网页(不保存)
|
||||
4. 按返回键可以返回上一页或显示配置界面
|
||||
|
||||
## 技术栈
|
||||
|
||||
- Android SDK
|
||||
- Java
|
||||
- WebView
|
||||
- SharedPreferences(用于保存配置)
|
||||
|
||||
## 构建说明
|
||||
|
||||
1. 使用Android Studio打开项目
|
||||
2. 同步Gradle依赖
|
||||
3. 连接Android设备或启动模拟器
|
||||
4. 点击运行按钮构建并安装应用
|
||||
|
||||
## 最低要求
|
||||
|
||||
- Android 5.0 (API 21) 或更高版本
|
||||
- 需要网络权限访问局域网
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 应用已配置允许HTTP明文传输(`usesCleartextTraffic="true"`),以便访问局域网HTTP服务
|
||||
- 确保设备与目标服务器在同一局域网内
|
||||
|
||||
75
xinli-App/SDK问题解决方案.md
Normal file
75
xinli-App/SDK问题解决方案.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# Android SDK 问题解决方案
|
||||
|
||||
## 问题说明
|
||||
|
||||
构建时出现以下错误:
|
||||
- 无法连接到 Google 服务器下载 SDK 组件
|
||||
- 找不到 Build Tools revision 30.0.2
|
||||
|
||||
## 解决方案
|
||||
|
||||
### 方法一:使用 Android Studio 安装 SDK(推荐)
|
||||
|
||||
1. **打开 Android Studio**
|
||||
2. **打开项目**
|
||||
3. **等待 SDK 同步**,Android Studio 会自动检测并提示安装缺失的组件
|
||||
4. **或者手动安装**:
|
||||
- `Tools` → `SDK Manager`
|
||||
- 在 `SDK Tools` 标签页中,确保以下已安装:
|
||||
- Android SDK Build-Tools 30.0.3(或更高版本)
|
||||
- Android SDK Platform 31
|
||||
- 点击 `Apply` 安装
|
||||
|
||||
### 方法二:手动配置 Build Tools 版本
|
||||
|
||||
如果已经安装了其他版本的 Build Tools,可以修改 `app/build.gradle`:
|
||||
|
||||
```gradle
|
||||
android {
|
||||
compileSdk 31
|
||||
buildToolsVersion "30.0.3" // 改为你已安装的版本
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### 方法三:配置网络代理(如果网络受限)
|
||||
|
||||
如果无法访问 Google 服务器,可以:
|
||||
|
||||
1. **配置代理**(如果有):
|
||||
- 在 `gradle.properties` 中添加:
|
||||
```properties
|
||||
systemProp.http.proxyHost=your.proxy.host
|
||||
systemProp.http.proxyPort=8080
|
||||
systemProp.https.proxyHost=your.proxy.host
|
||||
systemProp.https.proxyPort=8080
|
||||
```
|
||||
|
||||
2. **使用国内镜像**(如果可用)
|
||||
|
||||
### 方法四:离线模式(如果已下载 SDK)
|
||||
|
||||
如果已经通过其他方式下载了 SDK 组件,确保:
|
||||
- SDK 路径正确(在 `local.properties` 中)
|
||||
- Build Tools 已安装在 `SDK_PATH/build-tools/30.0.3/` 目录下
|
||||
|
||||
## 检查已安装的 Build Tools
|
||||
|
||||
在 Android Studio 中:
|
||||
- `Tools` → `SDK Manager` → `SDK Tools` 标签
|
||||
- 查看 `Android SDK Build-Tools` 的版本
|
||||
|
||||
或者直接检查文件系统:
|
||||
```
|
||||
C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\
|
||||
```
|
||||
|
||||
## 当前配置
|
||||
|
||||
项目已配置为使用:
|
||||
- **compileSdk**: 31
|
||||
- **buildToolsVersion**: 30.0.3
|
||||
- **targetSdk**: 31
|
||||
|
||||
如果这些版本未安装,请使用 Android Studio 的 SDK Manager 安装它们。
|
||||
|
||||
38
xinli-App/app/build.gradle
Normal file
38
xinli-App/app/build.gradle
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
// 尝试使用常见的 Build Tools 版本,如果都没有,请使用 Android Studio 安装
|
||||
// 可以尝试的版本:30.0.3, 30.0.2, 30.0.1, 30.0.0, 29.0.3, 29.0.2
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.xinli.app"
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// 允许未签名的release版本(用于测试)
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.xinli.app.test;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String APPLICATION_ID = "com.xinli.app.test";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.xinli.app;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String APPLICATION_ID = "com.xinli.app";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.0";
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{}
|
||||
BIN
xinli-App/app/build/intermediates/app_classes/debug/classes.jar
Normal file
BIN
xinli-App/app/build/intermediates/app_classes/debug/classes.jar
Normal file
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
appMetadataVersion=1.0
|
||||
androidGradlePluginVersion=4.2.2
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "COMPATIBLE_SCREEN_MANIFEST",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.xinli.app",
|
||||
"variantName": "debug",
|
||||
"elements": []
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
6
|
||||
|
|
@ -0,0 +1 @@
|
|||
6
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user