Skip to content

kaywalker91/Android_DW_Insta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DW_Insta - Instagram Clone Android Application

dw_github1

Overview

DW_Insta is a fully-functional Instagram-inspired Android application built with Java and Firebase. This project demonstrates modern Android development practices including user authentication, real-time messaging, image sharing, and social networking features.

Package: com.kaywalker.newone

Demo

DW_Insta_01.mp4

Key Features

User Management

  • Email/password authentication
  • Google Sign-In integration
  • User profile management with avatar upload
  • Profile viewing and editing

Social Features

  • Photo feed with real-time updates
  • Image upload with caption support
  • User discovery and search
  • Follow/unfollow functionality

Messaging

  • Direct messaging between users
  • Real-time chat synchronization
  • Message history persistence

Media Management

  • Gallery integration for photo selection
  • Full-screen image viewing
  • Image optimization and caching
  • Profile picture upload and management

Technical Stack

Core Technologies

  • Language: Java 1.8
  • SDK: Compile/Target SDK 32, Minimum SDK 23 (Android 6.0)
  • Build System: Gradle 7.x

Firebase Services

  • Authentication: Email/password and Google Sign-In
  • Realtime Database: User data and messaging storage
  • Cloud Storage: Profile images and content storage

Key Libraries

Library Version Purpose
Glide 4.13.0 Primary image loading and caching
Picasso 2.8 Image loading support
Firebase Auth latest User authentication
Firebase Database latest Real-time data synchronization
Firebase Storage latest Cloud file storage
Material Components latest Modern UI components

Architecture

Application Flow

IntroActivity (Splash)
    ↓
MainActivity (Login/Registration)
    ↓
CenterActivity (Main Hub)
    β”œβ”€β”€ Frag_Home (Feed)
    β”œβ”€β”€ Frag_Board (Gallery)
    β”œβ”€β”€ Frag_Profile (User Profile)
    └── Frag_List (User Discovery)

Core Components

Activities:

  • IntroActivity: Splash screen with app initialization
  • MainActivity: Authentication gateway (login/signup)
  • CenterActivity: Main navigation hub with bottom navigation
  • AddActivity: Content upload interface
  • ChatActivity: Direct messaging screen
  • UserActivity: Profile viewing screen
  • FullScreenActivity: Full-screen image viewer

Fragments:

  • Frag_Home: Main feed displaying user posts
  • Frag_Board: Gallery view of all images
  • Frag_Profile: User profile management
  • Frag_List: User discovery and search

Data Models:

  • UserAccount: User profile information
  • Image: Post content and metadata
  • ChatDTO: Chat message data
  • dataholder: Temporary data transfer

Firebase Database Structure

firebase-root/
β”œβ”€β”€ Users/
β”‚   └── [userId]/
β”‚       β”œβ”€β”€ name
β”‚       β”œβ”€β”€ email
β”‚       β”œβ”€β”€ profileImageUrl
β”‚       └── ...
β”œβ”€β”€ Posts/
β”‚   └── [postId]/
β”‚       β”œβ”€β”€ imageUrl
β”‚       β”œβ”€β”€ caption
β”‚       β”œβ”€β”€ userId
β”‚       └── timestamp
└── Chats/
    └── [chatId]/
        β”œβ”€β”€ messages
        └── participants

Getting Started

Prerequisites

  • Android Studio Arctic Fox or newer
  • JDK 1.8 or higher
  • Android SDK 32
  • Firebase account and project setup
  • Google Sign-In credentials (OAuth 2.0)

Installation

  1. Clone the repository
git clone https://github.com/kaywalker91/Android_DW_Insta.git
cd Android_DW_Insta
  1. Firebase Configuration
  • Create a new Firebase project at Firebase Console
  • Enable Authentication (Email/Password and Google Sign-In)
  • Enable Realtime Database
  • Enable Cloud Storage
  • Download google-services.json and place it in app/ directory
  1. Configure Google Sign-In
  • Enable Google Sign-In in Firebase Authentication
  • Add SHA-1 and SHA-256 fingerprints to Firebase project
  • Download updated google-services.json
  1. Build the project
# Install dependencies
./gradlew build

# Run debug build
./gradlew installDebug

Development Commands

# Build APK
./gradlew assembleDebug          # Debug APK
./gradlew assembleRelease        # Release APK

# Testing
./gradlew test                   # Unit tests
./gradlew connectedAndroidTest   # Instrumented tests

# Installation
./gradlew installDebug           # Install debug build on device

# Clean build
./gradlew clean

Configuration

Required Permissions

The app requires the following permissions (declared in AndroidManifest.xml):

  • INTERNET: Network communication
  • READ_PHONE_STATE: Device information
  • READ_EXTERNAL_STORAGE: Gallery access
  • WRITE_EXTERNAL_STORAGE: File storage (SDK < 29)

FileProvider Configuration

Authority: com.kaywalker.newone

Configured for secure file sharing between app and external apps (camera, gallery).

Usage

First-Time Setup

  1. Launch the app
  2. Create an account or sign in with Google
  3. Set up your profile with name and profile picture
  4. Grant necessary permissions when prompted

Main Features Usage

Upload a Photo:

  1. Tap the "+" button in the bottom navigation
  2. Select an image from gallery
  3. Add a caption (optional)
  4. Tap "Upload"

Direct Messaging:

  1. Navigate to a user's profile
  2. Tap the message icon
  3. Send messages in real-time

View Feed:

  • Home tab shows posts from all users
  • Scroll to load more content
  • Tap images for full-screen view

Manage Profile:

  • Profile tab shows your posts and information
  • Edit profile to update name and avatar
  • View your post history

Project Structure

app/src/main/
β”œβ”€β”€ java/com/kaywalker/newone/
β”‚   β”œβ”€β”€ activities/
β”‚   β”‚   β”œβ”€β”€ IntroActivity.java
β”‚   β”‚   β”œβ”€β”€ MainActivity.java
β”‚   β”‚   β”œβ”€β”€ CenterActivity.java
β”‚   β”‚   β”œβ”€β”€ AddActivity.java
β”‚   β”‚   β”œβ”€β”€ ChatActivity.java
β”‚   β”‚   β”œβ”€β”€ UserActivity.java
β”‚   β”‚   └── FullScreenActivity.java
β”‚   β”œβ”€β”€ fragments/
β”‚   β”‚   β”œβ”€β”€ Frag_Home.java
β”‚   β”‚   β”œβ”€β”€ Frag_Board.java
β”‚   β”‚   β”œβ”€β”€ Frag_Profile.java
β”‚   β”‚   └── Frag_List.java
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ UserAccount.java
β”‚   β”‚   β”œβ”€β”€ Image.java
β”‚   β”‚   β”œβ”€β”€ ChatDTO.java
β”‚   β”‚   └── dataholder.java
β”‚   └── adapters/
β”‚       └── [RecyclerView adapters]
β”œβ”€β”€ res/
β”‚   β”œβ”€β”€ layout/
β”‚   β”œβ”€β”€ drawable/
β”‚   └── values/
└── AndroidManifest.xml

Firebase Security Rules

Database Rules (Recommended)

{
  "rules": {
    "Users": {
      "$uid": {
        ".read": "auth != null",
        ".write": "$uid === auth.uid"
      }
    },
    "Posts": {
      ".read": "auth != null",
      ".write": "auth != null"
    }
  }
}

Storage Rules (Recommended)

service firebase.storage {
  match /b/{bucket}/o {
    match /profile_images/{userId}/{allPaths=**} {
      allow read: if request.auth != null;
      allow write: if request.auth != null && request.auth.uid == userId;
    }
    match /post_images/{allPaths=**} {
      allow read: if request.auth != null;
      allow write: if request.auth != null;
    }
  }
}

Known Issues & Limitations

  • Minimum SDK 23 (Android 6.0+) required
  • Google Sign-In requires proper SHA fingerprint configuration
  • Storage permissions needed for Android 10 and below
  • Image upload size may be limited by Firebase Storage quotas

Troubleshooting

Build Failures

# Clean build artifacts
./gradlew clean
./gradlew build --refresh-dependencies

Firebase Connection Issues

  • Verify google-services.json is in app/ directory
  • Check Firebase project configuration
  • Ensure Firebase dependencies are up to date
  • Verify internet connectivity

Google Sign-In Issues

  • Confirm SHA-1 and SHA-256 fingerprints are added to Firebase
  • Download updated google-services.json after adding fingerprints
  • Check OAuth 2.0 client ID configuration

Permission Errors

  • Grant storage permissions in device settings
  • For Android 11+, check scoped storage compatibility

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow Java coding conventions
  • Add comments for complex logic
  • Test on multiple Android versions
  • Update documentation for new features

Testing

Unit Tests

./gradlew test

Instrumented Tests

./gradlew connectedAndroidTest

Requires a connected device or emulator.

License

This project is open-source and available for educational purposes.

Authors

  • kaywalker91 - Initial development
  • claude - Documentation and enhancements

Acknowledgments

  • Firebase for backend infrastructure
  • Glide and Picasso for image loading
  • Material Design components
  • Android Developer community

Contact

For questions or support, please open an issue on GitHub.


Note: This is an educational project demonstrating Android development practices. For production use, implement additional security measures, error handling, and optimization.

About

πŸ“Έ Android Instagram Clone | UI/UX Learning

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages