Comprehensive Overview of a Self‑Developed Android Social App Architecture
This article provides a detailed walkthrough of a self‑developed Android social application, covering its functional modules, mobile architecture layers (framework, threading, caching, networking, implementation), server‑side design, database choices, third‑party libraries, and performance optimizations.
This document describes the design and implementation of a fully self‑developed Android social networking app, including both the mobile client and the server backend.
Functional Architecture
Common UI: circular user avatars, detail pages showing posts, images with pinch‑zoom and swipe.
User Management: phone‑number registration with SMS verification, avatar upload, password recovery, login with cache, phone login, and third‑party login (WeChat, Sina Weibo).
Post Module: creation (text with profanity filter, image selection, video recording, location sharing), browsing (avatars, timestamps, comment counts), editing (text, images, videos), interactions (comment, like/unlike, share, collect, report, delete).
Article Module: HTML‑based content displayed via X5 kernel, published by admin backend.
My Module: profile background, message notifications, personal data management (avatar, nickname, password, gender, signature, contact info), post management, settings (privacy, push, cache clear, update check, feedback, share, about).
Search Module: fuzzy search with history cache, supports searching posts, users, articles.
Mobile Architecture Overview
Framework Layer : minimal use of third‑party SDKs; image loading via ImageLoader (alternatives: Picasso, Fresco, Volley); network requests built on HttpUrlConnection; rich‑text editor based on RichEditor (later abandoned); video playback options include IjkPlayer (lightweight), VLC (heavyweight), and JavaScript‑based web player using X5 kernel.
Thread Layer : network operations use Thread+Handler or AsyncTask (AsyncTask more convenient but resource‑intensive); custom AsyncTask subclasses for list loading; Thread+Handler for low‑traffic requests; thread pool for concurrent image uploads.
Cache Layer : data stored via SharedPreferences (flags, user name) and File storage (post and comment lists) with serialization.
Network Layer : custom HttpUrlConnection utilities for GET/POST; broadcast receiver monitors network changes; pre‑request connectivity check; offline cache fallback.
Implementation Layer : sharing via OneKeyShare SDK (integrates multiple platforms); post detail UI composed of HeaderView + CommentView; abstract base classes for data request, composition, and display; logic for likes, comments, and UI updates.
Server‑Side Architecture
Cluster: Alibaba Cloud Linux CentOS 6.5 with Nginx; image storage on Tencent Cloud Wànxiàng Yùtú.
Database: MySQL using both MyISAM (fast reads) and InnoDB (transaction support) engines; tables for posts, articles, likes, comments, collections, notifications, user accounts, and basic profile data.
API: PHP‑based interfaces; JSON array or string payloads; Redis layer for high‑frequency data caching.
Custom utilities: Redis wrapper class, transaction‑based DB connection class, user information handler.
Performance Optimizations
APK size reduction by limiting native .so libraries to armeabi.
Memory optimization techniques referenced from the author’s previous blog.
Use of RecyclerView with SwipeRefreshLayout for efficient list rendering and pull‑to‑refresh.
Batch loading of post data, thumbnail generation, watermarking, and image compression (~450 KB).
Thread‑pool based uploads to control concurrency and recycle memory.
Third‑Party Libraries
PhotoView, DickLruCache, ImageLoader, MultiImageSelector (client side).
Custom components: lghLoopViewPager, SlowlyProgressBar, ListGirdView.
The article concludes with a note that the project’s source code (client and server) is available on GitHub for further exploration.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.