ไธไธช้ๆ Google Gemini AI ็ๆบ่ฝๆ กๅญ็ฉๅๅ
ฑไบซๅนณๅฐ
An intelligent campus item-sharing platform powered by Google Gemini AI
ๅ่ฝ็นๆง โข ๆๆฏๆ โข ๅฟซ้ๅผๅง โข ่ดก็ฎ
ๆฌ้กน็ฎๆฏ Campus Item Sharing Platform ็ Android ๅ็ซฏๅบ็จ
This is the Android frontend for Campus Item Sharing Platform
| ็ปไปถ Component | ไปๅบ Repository | ๆๆฏๆ Tech Stack | ่ฏดๆ Description |
|---|---|---|---|
| ๐จ ๅ็ซฏ Frontend | CampusShare-AI (ๅฝๅไปๅบ Current) | Android (Kotlin) + Gemini AI | Mobile Application |
| โ๏ธ ๅ็ซฏ Backend | Campus_Spring_boot | Spring Boot + MySQL | RESTful API Server |
ๆ็ งไธๆน็ ๅฟซ้ๅผๅง ๆๅๅณๅฏใ
- โ ้จ็ฝฒๅ็ซฏๆๅก๏ผๆ็ ง ๅ็ซฏไปๅบ่ฏดๆ ๅฏๅจ Spring Boot API
- โ ้ ็ฝฎๅ็ซฏ API ๅฐๅ๏ผ่งไธๆน ๅ็ซฏ API ้ ็ฝฎ๏ผ
- โ ่ฟ่ก Android ๅบ็จ
๐ก ๅผๅ่ ๆ็คบ / Developer Tip:
ๆฅ็่ฏฆ็ป็ๅ็ซฏๅฏนๆฅๆๆกฃ๏ผBACKEND_API.md
Campus Item Sharing ๆฏไธไธชไธไธบๅคงๅญฆ็่ฎพ่ฎก็ๆบ่ฝ็ฉๅๅ ฑไบซๅนณๅฐใ้่ฟ้ๆ Google Gemini 1.5 Flash AI๏ผไธบ็จๆทๆไพๆบ่ฝๆจ่ใ็ฉๅๅ็ฑปๅไบคๆๅปบ่ฎฎ๏ผ่ฎฉๆ กๅญ้ฒ็ฝฎ็ฉๅไบคๆๆด้ซๆใๆดๆบ่ฝใ
- ๐ค AI ๆบ่ฝๅฉๆ: ้ๆ Gemini 1.5 Flash๏ผๆไพๆบ่ฝ็ฉๅๆจ่ๅๆ่ฟฐ็ๆ
- ๐ฌ ๅฎๆถ่ๅคฉ: ไนฐๅๅๆนๅฎๆถๆฒ้๏ผๅฟซ้่พพๆไบคๆ
- ๐ธ ๅพ็ๅฑ็คบ: ๆฏๆๅคๅพไธไผ ๏ผๆธ ๆฐๅฑ็คบ็ฉๅ็ป่
- ๐ท๏ธ ๆบ่ฝๅ็ฑป: AI ่ชๅจ่ฏๅซ็ฉๅ็ฑปๅๅๆ ็ญพ
- ๐ ไบคๆๅๅฒ: ๅฎๆด่ฎฐๅฝๅๅธๅไบคๆ่ฎฐๅฝ
- ๐ฅ ๅฅฝๅ็ณป็ป: ๆทปๅ ๅฅฝๅ๏ผ็ง่ไบคๆตๆดๆนไพฟ
- ๆฏๆๅพ็ไธไผ ๅ้ข่ง
- AI ่ชๅจ็ๆ็ฉๅๆ่ฟฐๅๆ ็ญพ
- ไปทๆ ผๅปบ่ฎฎๅๅธๅบๅๆ
- ๅค็ฑปๅ็ฉๅๆฏๆ๏ผไนฆ็ฑใ็ตๅญไบงๅใๆๅ ท็ญ๏ผ
- ๆบ่ฝๆจ่: ๆ นๆฎ็จๆท้ๆฑๆจ่ๅ้็็ฉๅ
- ่ชๅจๆ ็ญพ: AI ่ชๅจ่ฏๅซ็ฉๅ็ฑปๅๅนถๆทปๅ ๆ ็ญพ
- ๆ่ฟฐ็ๆ: ๆบ่ฝ็ๆๅธๅผไบบ็็ฉๅๆ่ฟฐ
- ไปทๆ ผๅปบ่ฎฎ: ๅบไบ็ฉๅ็ฑปๅๆไพๅ็ไปทๆ ผ่ๅด
- ็จๆทๆณจๅๅ็ปๅฝ
- ๅฅฝๅๆทปๅ ๅ็ฎก็
- ๅฎๆถๆถๆฏ้็ฅ
- ็ง่ๅ็พค่ๆฏๆ
- ๅๅธๅๅฒ่ฎฐๅฝ
- ็ฉๅๆต่งๅๆ็ดข
- ๆถ่ๅๅ ณๆณจ
- ไบคๆ็ถๆ่ท่ธช
- ่ฏญ่จ: Kotlin
- ๆไฝ SDK: Android 29 (Android 10)
- ็ฎๆ SDK: Android 35
- ๆๅปบๅทฅๅ ท: Gradle 8.x + Kotlin DSL
| ๆๆฏ | ็จ้ | ็ๆฌ |
|---|---|---|
| Google Gemini AI | AI ๆบ่ฝๆจ่ๅๅ ๅฎน็ๆ | 1.5 Flash |
| Retrofit | ็ฝ็ป่ฏทๆฑๆกๆถ | Latest |
| Gson | JSON ่งฃๆ | Latest |
| Jetpack Compose | ็ฐไปฃๅ UI ๆกๆถ | Latest |
| Material 3 | Material Design UI ็ปไปถ | Latest |
| Glide | ๅพ็ๅ ่ฝฝๅ็ผๅญ | Latest |
| CameraX | ็ธๆบๅ่ฝ | Latest |
| ML Kit | ไบ็ปด็ ๆซๆ | Latest |
ๆฌๅบ็จ้่ฆ่ฟๆฅๅ็ซฏ API ๆๅกๅจๆ่ฝๅฎๆด่ฟ่กใๅ็ซฏๆไพ็จๆท่ฎค่ฏใ็ฉๅ็ฎก็ใ่ๅคฉ็ญๆ ธๅฟๅ่ฝใ
This app requires connection to the backend API server for full functionality. The backend provides user authentication, item management, chat, and other core features.
Spring Boot API: Campus_Spring_boot
ๅผๅ็ฏๅข / Development:
- Android ๆจกๆๅจ / Emulator:
http://10.0.2.2:8080 - ็ๆบ่ฐ่ฏ / Physical Device:
http://YOUR_LOCAL_IP:8080(ๆฟๆขไธบไฝ ็ต่็IP)
็ไบง็ฏๅข / Production:
- ้จ็ฝฒๅ็ซฏๅฐไบๆๅกๅจๅ็ HTTPS ๅฐๅ
๐ ่ฏฆ็ป้ ็ฝฎๆๅ: ๆฅ็ docs/BACKEND_API.md ่ทๅๅฎๆด็ๅ็ซฏๅฏนๆฅๆๆกฃ
- Android Studio Hedgehog (2023.1.1) ๆๆด้ซ็ๆฌ
- JDK 11 ๆๆด้ซ็ๆฌ
- Android SDK 29-35
- Google Gemini API ๅฏ้ฅ๏ผ่ทๅๅฏ้ฅ๏ผ
-
ๅ ้ไปๅบ
git clone https://github.com/psmarter/CampusShare-AI.git cd Campus -
้ ็ฝฎ API ๅฏ้ฅ ๐
่ฟๆฏๆ้่ฆ็ๆญฅ้ชค๏ผ
# ๅคๅถ็คบไพ้ ็ฝฎๆไปถ cp local.properties.example local.propertiesๆๅผ
local.propertiesๆไปถ๏ผๅกซๅ ฅๆจ็ Gemini API ๅฏ้ฅ๏ผGEMINI_API_KEY=your_actual_api_key_hereโ ๏ธ ๅฎๅ จๆ็คบ:local.propertiesๆไปถๅทฒๅจ.gitignoreไธญ๏ผไธไผ่ขซๆไบคๅฐ Git๏ผ็กฎไฟ API ๅฏ้ฅๅฎๅ จใ -
ๆๅผ้กน็ฎ
- ไฝฟ็จ Android Studio ๆๅผ้กน็ฎๆไปถๅคน
- ็ญๅพ Gradle ๅๆญฅๅฎๆ
-
่ฟ่กๅบ็จ
- ่ฟๆฅ Android ่ฎพๅคๆๅฏๅจๆจกๆๅจ
- ็นๅป Run ๆ้ฎ๏ผๆๆ Shift+F10๏ผ
- ่ฎฟ้ฎ Google AI Studio
- ็ปๅฝๆจ็ Google ่ดฆๆท
- ็นๅป "Create API Key"
- ๅคๅถ็ๆ็ API ๅฏ้ฅ
- ็ฒ่ดดๅฐ
local.propertiesๆไปถไธญ
app/src/main/java/com/example/campus_item_sharing/
โโโ ๐ฑ Activities & Fragments
โ โโโ MainActivity.kt # ไธป็้ข
โ โโโ LoginActivity.kt # ็ปๅฝ็้ข
โ โโโ GeminiActivity.kt # AI ๅฉๆ็้ข
โ โโโ ChatActivity.kt # ่ๅคฉ็้ข
โ โโโ PostHistory.kt # ๅๅธๅๅฒ
โ โโโ HomeFragment.kt # ้ฆ้กต Fragment
โ โโโ PostFragment.kt # ๅๅธ Fragment
โ โโโ MessagesFragment.kt # ๆถๆฏ Fragment
โ โโโ SettingsFragment.kt # ่ฎพ็ฝฎ Fragment
โ
โโโ ๐ฆ Models
โ โโโ account/ # ่ดฆๆทๆฐๆฎๆจกๅ
โ โโโ chatmodel/ # ่ๅคฉๆฐๆฎๆจกๅ
โ โโโ friendmodel/ # ๅฅฝๅๆฐๆฎๆจกๅ
โ โโโ itemmodel/ # ็ฉๅๆฐๆฎๆจกๅ
โ
โโโ ๐ Network
โ โโโ retrofit/ # Retrofit API ๆฅๅฃ
โ
โโโ ๐ ๏ธ Utilities
โ โโโ tools/ # ๅทฅๅ
ท็ฑป
โ โโโ ui/ # UI ็ปไปถ
โ
โโโ ๐ Resources
โโโ res/layout/ # XML ๅธๅฑๆไปถ
โโโ res/drawable/ # ๅพ็่ตๆบ
โโโ res/values/ # ๅญ็ฌฆไธฒใ้ข่ฒ็ญ
// ๅจ GeminiActivity ไธญไฝฟ็จ Gemini AI
val prompt = "ๆๆณๅไธๆฌใ็ฎๆณๅฏผ่ฎบใ๏ผๅ
ซๆๆฐ๏ผๅธฎๆ็ๆๆ่ฟฐๅๅฎไปทๅปบ่ฎฎ"
generateText(prompt)AI ไผ่ฟๅ๏ผ
- ็ฉๅ็ฑปๅๆ ็ญพ๏ผไนฆ็ฑ
- ๅปบ่ฎฎๆ่ฟฐ๏ผ็ปๅ ธ็ฎๆณๆๆ๏ผ้ๅ่ฎก็ฎๆบไธไธๅญฆ็...
- ๅปบ่ฎฎไปทๆ ผ๏ผยฅ30-50
ๅจ HomeFragment ไธญๆต่ง็ฉๅๅ่กจ๏ผๆฏๆ๏ผ
- ๆ็ฑปๅ็ญ้
- ๆไปทๆ ผๆๅบ
- ๅ ณ้ฎ่ฏๆ็ดข
- AI ๆบ่ฝๆจ่
ๆฌ้กน็ฎ้็จๅฎๅ จ็ API ๅฏ้ฅ็ฎก็๏ผ
- โ
API ๅฏ้ฅๅญๅจๅจ
local.properties๏ผๆฌๅฐๆไปถ๏ผ - โ
local.propertiesๅทฒๆทปๅ ๅฐ.gitignore - โ ไฝฟ็จ BuildConfig ๅฎๅ จ่ฏปๅๅฏ้ฅ
- โ ็ปไธๅจไปฃ็ ไธญ็กฌ็ผ็ ๅฏ้ฅ
- โ ็ปไธๅฐๅฏ้ฅๆไบคๅฐ GitHub
- ๆทปๅ ็ฉๅ็ถๆ็ฎก็๏ผๅจๅฎใๅทฒๅฎใๅทฒ้ข่ฎข๏ผ
- ้ๆๆฏไปๅ่ฝ
- ๆทปๅ ่ฏๅๅ่ฏ่ฎบ็ณป็ป
- ๆฏๆ็ฉๅๅฎไฝๅๅฐๅพๅฑ็คบ
- ๆทปๅ ๆจ้้็ฅ
- ไผๅ AI ๆจ่็ฎๆณ
- ๆฏๆๅค่ฏญ่จ๏ผEnglish, ็ฎไฝไธญๆ๏ผ
ๆไปฌๆฌข่ฟๆๆๅฝขๅผ็่ดก็ฎ๏ผ่ฏทๆฅ็ ่ดก็ฎๆๅ ไบ่งฃ่ฏฆๆ ใ
- Fork ๆฌไปๅบ
- ๅๅปบๅ่ฝๅๆฏ (
git checkout -b feature/AmazingFeature) - ๆไบคๆดๆน (
git commit -m 'feat: ๆทปๅ ๆไธชๅ่ฝ') - ๆจ้ๅฐๅๆฏ (
git push origin feature/AmazingFeature) - ๅผๅฏ Pull Request
ๆฌ้กน็ฎ้็จ MIT ่ฎธๅฏ่ฏ - ๆฅ็ LICENSE ๆไปถไบ่งฃ่ฏฆๆ ใ
- GitHub: @psmarter
- Project Link: https://github.com/psmarter/CampusShare-AI
- Google Gemini AI - ๆไพๅผบๅคง็ AI ่ฝๅ
- Material Design - UI ่ฎพ่ฎก่ง่
- ๆๆ่ดก็ฎ่ ๅๆฏๆ่
Campus Item Sharing is an intelligent item-sharing platform designed for college students. By integrating Google Gemini 1.5 Flash AI, it provides smart recommendations, item categorization, and trading suggestions, making campus item trading more efficient and intelligent.
- ๐ค AI Assistant: Integrated with Gemini 1.5 Flash for smart item recommendations and description generation
- ๐ฌ Real-time Chat: Instant communication between buyers and sellers
- ๐ธ Image Display: Support multiple image uploads with clear item details
- ๐ท๏ธ Smart Classification: AI auto-identifies item types and tags
- ๐ Trading History: Complete record of posts and transactions
- ๐ฅ Friend System: Add friends for convenient private conversations
- Image upload and preview support
- AI-generated item descriptions and tags
- Price suggestions and market analysis
- Multi-type item support (books, electronics, stationery, etc.)
- Smart Recommendations: Recommend suitable items based on user needs
- Auto Tagging: AI automatically identifies item types and adds tags
- Description Generation: Intelligently generates attractive item descriptions
- Price Suggestions: Provides reasonable price ranges based on item types
- User registration and login
- Friend adding and management
- Real-time message notifications
- Private and group chat support
- Post history records
- Item browsing and search
- Favorites and follows
- Transaction status tracking
- Language: Kotlin
- Min SDK: Android 29 (Android 10)
- Target SDK: Android 35
- Build Tools: Gradle 8.x + Kotlin DSL
| Technology | Purpose | Version |
|---|---|---|
| Google Gemini AI | AI recommendations and content generation | 1.5 Flash |
| Retrofit | Network request framework | Latest |
| Gson | JSON parsing | Latest |
| Jetpack Compose | Modern UI framework | Latest |
| Material 3 | Material Design UI components | Latest |
| Glide | Image loading and caching | Latest |
| CameraX | Camera functionality | Latest |
| ML Kit | QR code scanning | Latest |
- Android Studio Hedgehog (2023.1.1) or higher
- JDK 11 or higher
- Android SDK 29-35
- Google Gemini API Key (Get Key)
-
Clone the Repository
git clone https://github.com/psmarter/CampusShare-AI.git cd Campus -
Configure API Key ๐
This is the most important step!
# Copy the example configuration file cp local.properties.example local.propertiesOpen the
local.propertiesfile and fill in your Gemini API key:GEMINI_API_KEY=your_actual_api_key_hereโ ๏ธ Security Note: Thelocal.propertiesfile is in.gitignoreand won't be committed to Git, ensuring API key security. -
Open Project
- Open the project folder with Android Studio
- Wait for Gradle sync to complete
-
Run the App
- Connect an Android device or start an emulator
- Click the Run button (or press Shift+F10)
- Visit Google AI Studio
- Log in to your Google account
- Click "Create API Key"
- Copy the generated API key
- Paste it into the
local.propertiesfile
app/src/main/java/com/example/campus_item_sharing/
โโโ ๐ฑ Activities & Fragments
โ โโโ MainActivity.kt # Main activity
โ โโโ LoginActivity.kt # Login activity
โ โโโ GeminiActivity.kt # AI assistant activity
โ โโโ ChatActivity.kt # Chat activity
โ โโโ PostHistory.kt # Post history
โ โโโ HomeFragment.kt # Home fragment
โ โโโ PostFragment.kt # Post fragment
โ โโโ MessagesFragment.kt # Messages fragment
โ โโโ SettingsFragment.kt # Settings fragment
โ
โโโ ๐ฆ Models
โ โโโ account/ # Account data models
โ โโโ chatmodel/ # Chat data models
โ โโโ friendmodel/ # Friend data models
โ โโโ itemmodel/ # Item data models
โ
โโโ ๐ Network
โ โโโ retrofit/ # Retrofit API interfaces
โ
โโโ ๐ ๏ธ Utilities
โ โโโ tools/ # Utility classes
โ โโโ ui/ # UI components
โ
โโโ ๐ Resources
โโโ res/layout/ # XML layout files
โโโ res/drawable/ # Image resources
โโโ res/values/ # Strings, colors, etc.
// Using Gemini AI in GeminiActivity
val prompt = "I want to sell 'Introduction to Algorithms', 80% new, help me generate description and pricing suggestion"
generateText(prompt)AI will return:
- Item type tag: Books
- Suggested description: Classic algorithm textbook, suitable for CS students...
- Suggested price: $30-50
Browse item lists in HomeFragment, supporting:
- Filter by type
- Sort by price
- Keyword search
- AI smart recommendations
This project uses secure API key management:
- โ
API keys stored in
local.properties(local file) - โ
local.propertiesadded to.gitignore - โ Uses BuildConfig to securely read keys
- โ Never hardcode keys in code
- โ Never commit keys to GitHub
- Add item status management (on sale, sold, reserved)
- Integrate payment functionality
- Add rating and review system
- Support item location and map display
- Add push notifications
- Optimize AI recommendation algorithm
- Multi-language support (English, ็ฎไฝไธญๆ)
We welcome all forms of contribution! Please check the Contributing Guidelines for details.
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: Add some feature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: @psmarter
- Project Link: https://github.com/psmarter/CampusShare-AI
- Google Gemini AI - Providing powerful AI capabilities
- Material Design - UI design specifications
- All contributors and supporters
ๅฆๆ่ฟไธช้กน็ฎๅฏนไฝ ๆๅธฎๅฉ๏ผ่ฏท็ปไธไธช โญ Star๏ผ
If this project helps you, please give it a โญ Star!
Made with โค๏ธ by psmarter