Welcome to Wikisource Reader app documentation!
Wikisource Reader app is a free and open-source mobile application built for Android users to read public domain and copyright free pre-published contents in various languages of the world, which are hosted in the open and free digital library website of Wikisource. The digitized contents on Wikisoruce are transcribed and proofread by a vibrant community to make them freely and openly accessible and searchable for everyone to read. Wikisource Reader App is a step further to make these contents available for android mobile users.
The docs are organized into 2 sections:
Wikisource catalog API for proofread and validated books. Loosely based on https://github.com/garethbjohnson/gutendex
This is a simple API which gets data from Wikidata following the Books Data Model for Wikisource works.
Source Code : https://codeberg.org/ph4ni/wsindex
Hosted on toolforge at: https://wsindex.toolforge.org/books/
The following core technologies were used to build this application:
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
You will need to ensure your system meets the following requirements:
To run wsindex locally, create a fork of the following repository https://codeberg.org/ph4ni/wsindex to your codeberg account then follow these steps:
Clone the Repository
Replace YOUR_USERNAME with your actual Codeberg username.
git clone ssh://git@codeberg.org/YOUR_USERNAME/wsindex.git
cd wsindex
Initialize and Activate Virtual Environment
# Initialize virtual environment:
virtualenv venv
# For Linux/macOS:
source venv/bin/activate
# For Windows:
.\venv\Scripts\activate
pip install -r requirements.txt
Replace the database settings in wsindex/settings.py with the following for a lightweight SQLite database:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
Apply Database Migrations
python manage.py migrate
Import Books from Wikidata
python manage.py updatecatalog
Run Local Server
python manage.py runserver
Navigate to the following address to view imported books.
http://127.0.0.1:8000/books/
Incase of a 404 or Not found error, add 127.0.0.1:8000 to allowed hosts in wsindex/settings.py .
This is the mobile client for the Wikisource Reader, providing an optimized interface for reading validated public domain texts. It consumes data from the WSIndex API to display curated collections.
The app is built using modern Android standards with a focus on offline accessibility and ePUB rendering.
Source Code : https://github.com/cis-india/Wikisource-Reader
Available on: Google Play Store
The following core technologies and frameworks were used to build the mobile application:
Follow these instructions to set up the development environment and run the application on an emulator or physical device.
You will need to ensure your development environment meets the following requirements:
To build and run the app locally, follow these steps:
Clone the Repository
git clone https://github.com/cis-india/Wikisource-Reader.git
cd Wikisource-Reader
Open in Android Studio
Launch Android Studio, select File > Open, and navigate to the cloned project directory. Allow Gradle to sync and download necessary dependencies.
Run on Device or Emulator
Connect a physical device via USB (with Debugging enabled) or start a Virtual Device (AVD). Press Shift + F10 or click the green Run button in the toolbar.
You can also pair your devece via WIFI instead of using USB. Once you enable developer mode on your android phone, You will find both pair via usb or WIFI.
Pointing to Local API (Optional)
If you are running WSIndex locally and want the app to connect to it, update the baseApiUrl in the api/BookApi to your local IP:
// If you are running on Emulator
private val baseApiUrl = "http://10.0.2.2:8000/books"
// Use IP address of your host machine(PC), when you want to run in physical device.
private val baseApiUrl = "http://192.168.100.2:8000/books".
By default, Android prevents apps from connecting to servers via unencrypted HTTP. To connect the app to your local instance of WSIndex, follow these steps to configure Network Security:
Create the Network Security Directory
In your project explorer, navigate to app/src/main/res. If an xml folder does not exist, right-click res, select New > Directory, and name it xml.
Create the Config File
Right-click on the res/xml folder and select New > XML Resource File. Name it network_security_config.xml and replace its contents with the following:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">192.168.100.2</domain> // Host IP
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true" >127.0.0.1</domain>
</domain-config>
</network-security-config>
Link the Configuration in the Manifest
Android requires you to register this file in the application manifest to apply the security exceptions.
Open app/src/main/AndroidManifest.xml and add the android:networkSecurityConfig attribute inside the <application> tag:
<application android:name=".WikisourceApplication" android:networkSecurityConfig="@xml/network_security_config"
... > <!-- Activities and Services -->
</application>