widgetCitations is a full-stack Android project made up of two modules:
citations-api— a Spring Boot REST API that serves random quotes stored in a PostgreSQL databasewidCitations— an Android home screen widget that fetches and displays a quote from the API
Backend (citations-api)
- Java — main language
- Spring Boot — REST API framework
- Spring Data JPA — database access
- PostgreSQL — quote storage
- Docker / Docker Compose — containerized database
Frontend (widCitations)
- Java — Android development
- Android SDK — widget system (
AppWidgetProvider) - HTTP client — API calls from the widget
widgetCitations/
├── citations-api/ # Spring Boot REST API
│ └── ... # Controllers, Services, Repositories, Entities
└── widCitations/ # Android application
└── ... # Widget provider, layout, manifest
The Android widget calls the REST API on a set interval to retrieve a random quote and display it on the home screen.
- REST API endpoint returning a random quote from the database
- PostgreSQL database managed via Docker
- Android home screen widget displaying the fetched quote
- Automatic widget refresh at a defined interval
- Clean layered architecture on the backend (Controller → Service → Repository)
Prerequisites: Java 17+, Maven, Docker
cd citations-api
# Start the PostgreSQL database
docker-compose up -d
# Run the Spring Boot API
./mvnw spring-boot:runThe API will be available at http://localhost:8080.
Prerequisites: Android Studio, Android SDK
- Open the
widCitationsfolder in Android Studio - Update the API base URL in the source if needed (e.g. use your machine's local IP if testing on a physical device)
- Run the app on an emulator or a physical device
- Add the widget to your home screen
- Introduction
- Technologies utilisées
- Architecture
- Liste des fonctionnalités
- Comment lancer le projet ?
widgetCitations est un projet full-stack Android composé de deux modules :
citations-api— une API REST Spring Boot qui sert des citations aléatoires stockées dans une base de données PostgreSQLwidCitations— un widget Android affiché sur l'écran d'accueil, qui récupère et affiche une citation depuis l'API
Backend (citations-api)
- Java — langage principal
- Spring Boot — framework REST API
- Spring Data JPA — accès à la base de données
- PostgreSQL — stockage des citations
- Docker / Docker Compose — base de données conteneurisée
Frontend (widCitations)
- Java — développement Android
- Android SDK — système de widget (
AppWidgetProvider) - Client HTTP — appels à l'API depuis le widget
widgetCitations/
├── citations-api/ # API REST Spring Boot
│ └── ... # Controllers, Services, Repositories, Entités
└── widCitations/ # Application Android
└── ... # Widget provider, layout, manifest
Le widget Android interroge l'API REST à intervalle régulier pour récupérer une citation aléatoire et l'afficher sur l'écran d'accueil.
- Endpoint REST renvoyant une citation aléatoire depuis la base de données
- Base de données PostgreSQL gérée via Docker
- Widget Android affichant la citation récupérée sur l'écran d'accueil
- Rafraîchissement automatique du widget à intervalle défini
- Architecture en couches propre côté backend (Controller → Service → Repository)
Prérequis : Java 17+, Maven, Docker
cd citations-api
# Démarrer la base de données PostgreSQL
docker-compose up -d
# Lancer l'API Spring Boot
./mvnw spring-boot:runL'API sera disponible à l'adresse http://localhost:8080.
Prérequis : Android Studio, Android SDK
- Ouvrir le dossier
widCitationsdans Android Studio - Mettre à jour l'URL de base de l'API si nécessaire (utiliser l'IP locale de la machine pour un test sur appareil physique)
- Lancer l'application sur un émulateur ou un appareil physique
- Ajouter le widget sur l'écran d'accueil