AR Location-Based Android 项目教程

AR Location-Based Android 项目教程

ar-location-based-androidThis AR app generally show where things are in the real-world by indicating where the app thinks they are over the camera view when the user holds the phone up and moves it about.项目地址:https://gitcode.com/gh_mirrors/ar/ar-location-based-android

1. 项目的目录结构及介绍

ar-location-based-android/
├── app/
│   ├── build/
│   ├── libs/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/
│   │   │   │   └── com/
│   │   │   │       └── datng/
│   │   │   │           └── arlocationbased/
│   │   │   │               ├── MainActivity.java
│   │   │   │               ├── ...
│   │   │   ├── res/
│   │   │   │   ├── drawable/
│   │   │   │   ├── layout/
│   │   │   │   ├── mipmap/
│   │   │   │   ├── values/
│   │   │   │   └── ...
│   │   │   ├── AndroidManifest.xml
│   │   │   └── ...
│   │   └── ...
│   ├── build.gradle
│   └── ...
├── gradle/
├── build.gradle
├── settings.gradle
└── ...
  • app/: 包含应用程序的主要代码和资源。
    • build/: 编译生成的文件。
    • libs/: 第三方库。
    • src/: 源代码。
      • main/: 主代码。
        • java/: Java 源代码。
          • com/datng/arlocationbased/: 项目的主要包。
            • MainActivity.java: 应用程序的主活动。
            • ...
        • res/: 资源文件。
          • drawable/: 图片资源。
          • layout/: 布局文件。
          • mipmap/: 图标资源。
          • values/: 字符串和其他值。
          • ...
        • AndroidManifest.xml: 应用程序的配置文件。
        • ...
    • build.gradle: 应用程序的构建脚本。
    • ...
  • gradle/: Gradle 相关文件。
  • build.gradle: 项目的构建脚本。
  • settings.gradle: 项目的设置文件。
  • ...

2. 项目的启动文件介绍

MainActivity.java 是项目的启动文件,它继承自 AppCompatActivity 并实现了应用程序的主要逻辑。以下是 MainActivity.java 的简要介绍:

package com.datng.arlocationbased;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // 初始化代码
    }
}
  • onCreate(Bundle savedInstanceState): 应用程序启动时调用的方法,用于初始化界面和逻辑。

3. 项目的配置文件介绍

AndroidManifest.xml 是项目的配置文件,它包含了应用程序的基本信息和组件声明。以下是 AndroidManifest.xml 的简要介绍:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.datng.arlocationbased">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
  • <manifest>: 根元素,包含应用程序的包名。
  • <application>: 应用程序的配置,包括图标、标签、主题等。
    • <activity>: 声明活动组件。
      • <intent-filter>: 声明活动为启动活动。
        • <action android:name="android.intent.action.MAIN" />: 声明为主入口。
        • <category android:name="android.intent.category.LAUNCHER" />: 声明为启动器。

ar-location-based-androidThis AR app generally show where things are in the real-world by indicating where the app thinks they are over the camera view when the user holds the phone up and moves it about.项目地址:https://gitcode.com/gh_mirrors/ar/ar-location-based-android

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

崔暖荔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值