【備忘録】ChatGPTとAndroidアプリ開発 その0 (環境準備)

# 1.やること
組込みソフト開発者がキャリアチェンジのためにChatGPTを教師としてAndoroidアプリ開発に挑戦してみる。
備忘録として初心者がアプリ開発するまでの流れを投稿する。

# 2.開発環境準備
https://developer.android.com/studioから「Android Studio」をインストールする。

# 3.プロジェクトの生成
1.Andoroid Studioを起動し、「New Project」をクリック
![Main.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3687592/9e27cc4f-961b-7991-de0a-0a5d55e06efd.png)
2.「Phone and Tablet」の「Empty　Activity」を選択してNext
![Template.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3687592/ddc54f50-e53f-21e9-4cb0-a9109700bde9.png)
3.プロジェクト名、開発ロケーションを選択しFinish
  ChatGPTに言われたJava or Kotlinの選択はよくわからない。(Kotolinしかなさそうだった。)
![ProjName.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3687592/def40c9e-d118-e955-5deb-a5433dd2e5cc.png)
しばらく待つとIDEに以下のような画面に変わる。
![After.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3687592/63aa0f48-f5a0-01f0-60f8-6be80672415a.png)
開発ロケーションに選択したフォルダにはファイルが生成されている。
![Folder.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3687592/19fc2509-d263-c20a-7b69-15ae9533fb27.png)

# 3.ChatGPTとのやり取り
```markdown:qiita&nbsp;1.md
Q:
  Please tell someone who is new to Android app development how to develop an app.
  Don't answer everything in one answer, only answer the next steps.

  for example
  How to develop an app？
  →To get started with Android app development, you'll need a computer running either Windows, macOS, or Linux, and a stable internet connection. Additionally, you'll need to download and install Android Studio, which is the official Integrated Development Environment (IDE) for Android app development. You can download Android Studio for free from the official Android developer website.
A:
  Next step: After installing Android Studio, familiarize yourself with the IDE. Android Studio provides a user-friendly interface for developing Android apps. Spend some time exploring the different features, menus, and tools available in Android Studio. You can refer to online tutorials, guides, or documentation provided by Google to understand how to navigate and utilize Android Studio effectively for app development.
```
ChatGPTに開発方法を聞くと概念的な話で開発方法の一連の流れを説明されるため、次に実施するステップのみ返答するように指示してみる。
最初のステップから聞いてみる。

```markdown:qiita&nbsp;2.md
Q:
  You don't need to see "Next step:" in your reply.
  what is the 1st Step？
A:
  The first step is to get started with Android app development by setting up your development environment. This involves:

    1.Ensuring you have a computer running either Windows, macOS, or Linux.
    2.Having a stable internet connection.
    3.Downloading and installing Android Studio, the official Integrated Development Environment (IDE) for Android app development.
    4.You can download Android Studio for free from the official Android developer website.
Q:
  Please tell me the url of the official website
A:
  You can download Android Studio from the official Android developer website at https://developer.android.com/studio.
```
IDEのインストールが終わったら次にやることを聞いてみる。
```markdown:qiita&nbsp;3.md
Q:
  thanks
  i did
A:
  You're welcome! Once you have Android Studio installed, feel free to proceed with familiarizing yourself with the IDE and exploring the various resources available for learning Android app development. If you have any more questions or need further guidance, feel free to ask!
Q:
  what is the second step.
  I would like to get used to using the IDE through developing specific applications.
A:
  The second step is to start a new project in Android Studio and begin learning the basics of Android app development. Here's how you can do it:

    1.Open Android Studio on your computer.
    2.Click on "Start a new Android Studio project" from the welcome screen or go to File > New > New Project.
    3.You will be prompted to choose a "Template" for your project. Select "Empty Activity" to start with a basic app structure.
    4.Enter the name of your application, the package name (which uniquely identifies your app), and choose the language (Java or Kotlin) for development.
    5.Click "Finish" to create your new project.

  Once your project is created, Android Studio will generate the necessary files and folder structure for your app. You can then start exploring and modifying the code to build your first Android app. Try experimenting with adding user interface elements, handling user interactions, and running your app on an emulator or a physical device to see the changes in action.
```
ChatGPTが思うような働きをしてくれない。。
プロンプト力を磨く必要がありそう。

# 4.次回計画
次回は計算機アプリを試しに作ってみる。