# androidnettime **Repository Path**: qzcwxh/androidnettime ## Basic Information - **Project Name**: androidnettime - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-23 - **Last Updated**: 2025-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Jetsurvey sample Jetsurvey is a sample survey app, built with [Jetpack Compose](https://developer.android.com/jetpack/compose). The goal of the sample is to showcase text input, validation and state capabilities of Compose. To try out this sample app, use the latest stable version of [Android Studio](https://developer.android.com/studio). You can clone this repository or import the project from Android Studio following the steps [here](https://developer.android.com/jetpack/compose/setup#sample). ## Screenshots ## Features This sample contains several screens: a welcome screen, where the user can enter their email, sign in and sign up screens and a survey screen. The app has light and dark themes. ### App scaffolding Package [`com.example.compose.jetsurvey`][1] [`MainActivity`][2] is the application's entry point. Each screen is implemented inside a `Fragment` and [`MainActivity`][2] is the host `Activity` for all of the `Fragment`s. The navigation between them uses the [Navigation library][3]. The screens and the navigation are defined in [`Navigation.kt`][4] [1]: app/src/main/java/com/example/compose/jetsurvey [2]: app/src/main/java/com/example/compose/jetsurvey/MainActivity.kt [3]: https://developer.android.com/guide/navigation [4]: app/src/main/java/com/example/compose/jetsurvey/Navigation.kt ### Sign in/sign up Package [`com.example.compose.jetsurvey.signinsignup`][5] This package contains 3 screens: * Welcome * Sign in * Sign up To get to the sign up screen, enter an email that contains "signup". These screens show how to create different custom composable functions, reused them across multiple screens and handle UI state. See how to: * Use `TextField`s * Implement `TextField` validation across one `TextField` (e.g. email validation) and across multiple `TextFields` (e.g. password confirmation) * Use a `Snackbar` * Use different types of `Button`s: `TextButton`, `OutlinedButton` and `Button` [5]: app/src/main/java/com/example/compose/jetsurvey/signinsignup ### Complete a survey Package [`com.example.compose.jetsurvey.survey`][6] This screen allows the user to fill out a survey, showing how to handle complex state. UI state is kept and restored on recompositions triggered by different reasons like a configuration change or a new question being displayed on the screen. See how to: * Use `RadioButton`s - for single item selection * Use `Checkbox`es - for multi-item selection * Use `Slider` - for picking a value from a range * Use `Scaffold` - for screens with top bar, bottom bar and body * Display a `DialogFragment` when requested from compose [6]: app/src/main/java/com/example/compose/jetsurvey/survey ### Data The data in the sample is static, held in the `*Repository` classes. ## Setup The main [README](https://github.com/android/compose-samples/) has instructions on how to setup this sample, and many others. ## License ``` Copyright 2020 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` mirrors.cloud.tencent.com/gradle maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/google") } maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://jitpack.io") } 基本实例安装 https://blog.csdn.net/qq_62480054/article/details/131585039 首个应用 https://developer.android.google.cn/codelabs/basic-android-kotlin-compose-first-app?hl=zh-cn#0 64为linux安装32位库 sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 访问http被限制 Cleartext HTTP traffic to www.ntsc.ac.cn not permitted (1)APP改用https请求 (2)targetSdkVersion 降到27以下 (3)更改网络安全配置 在res文件夹下创建一个xml文件夹,然后创建一个network_security_config.xml文件,文件内容如下: 在AndroidManifest.xml配置文件的标签中直接插入 android:usesCleartextTraffic="true" java代码访问网络注意设置代理参数,否则有的网页不返回结果 文本框和按钮设置居中背景色挺费劲 OutlinedTextField 比textfield更好看一些,圆角 # 增加日志xlog https://blog.csdn.net/qq_36611526/article/details/111469941 默认写日志文件权限不够 6.0之前是不需要动态申请权限的,直接在manifest.xml中申请即可以正常使用 安卓10,SDK=29 安卓10开始,安卓继续加强了限制,如果需要读写SD卡,还需要额外的进行申请requestLegacyExternalStorage申明。 SDK=30 安卓11的时候继续强化对SD卡读写的管理,引入了MANAGE_EXTERNAL_STORAGE权限,而之前的WRITE_EXTERNAL_STORAGE已经失效了。 并且MANAGE_EXTERNAL_STORAGE权限只能跳转设置页面申请。 android 13上,取消了android.permission.WRITE_EXTERNAL_STORAGE权限,只需要申请android.permission.MANAGE_EXTERNAL_STORAGE权限。 如上之外文件名使用当前时间来命名的话冒号也会被拒绝 对于所有版本的 Android,推荐使用应用的专用存储目录来保存文件。这样,你不需要特殊权限就可以访问这些文件。 /storage/emulated/0/Android/data/com.ewoivt.etime/files 这个工程的路径是这个