This is an Android application that allows users to have a voice chat with an AI assistant powered by OpenAI.
- Login: A simple login screen to get started.
- Voice Chat: Record your voice and send it to the OpenAI API for a response.
- Text-to-Speech: The AI's response is converted to speech and spoken aloud.
- Android Studio
- An OpenAI API Key.
-
Clone the repository:
git clone https://github.com/your-username/android_chatgpt.git
-
Set up your OpenAI API Key:
- Create a file named
local.propertiesin the root directory of the project. - Add the following line to the
local.propertiesfile, replacingYOUR_API_KEYwith your actual OpenAI API key:openai.apiKey="YOUR_API_KEY"
- Create a file named
-
Open the project in Android Studio:
- Launch Android Studio and select "Open" from the welcome screen.
- Navigate to the cloned repository and select the
android_chatgptdirectory.
-
Set up an Android Emulator:
- In Android Studio, go to Tools > Device Manager.
- Click on Create device.
- Choose a device definition (e.g., Pixel 6) and click Next.
- Select a system image (e.g., API Level 34) and click Next.
- Click Finish to create the emulator.
-
Run the app:
- Select the emulator you just created from the device dropdown menu in the toolbar.
- Click the Run button (the green play icon).
- The login screen is a simple placeholder.
- Enter any non-empty username and password and click the Login button to proceed to the main screen.
- On the main screen, you will see a microphone button.
- Press the microphone button to start recording your voice. A "Recording started" message will appear.
- Press the microphone button again to stop recording. A "Recording stopped" message will appear.
- The app will then send your recorded audio to the OpenAI API for transcription and get a response.
- The AI's response will be displayed on the screen and spoken aloud.