Since launching 16chan I’ve had several users and imageboard administrators reach out to me on how to add mobile app support to their LynxChan based imageboard. For those unfamiliar, DashChan is a modular imageboard browsing app. Support for imageboards is enabled by downloading the appropriate extension, thus in order to get support for your imageboard, you will have to create a APK that can be added to the DashChan app. I created a generic extension, that only requires a few basic changes in order to add support for your LynxChan based site. This guide is specifically built around Ubuntu, specifically versions that have snapd installed. We will also be using Android Studio.

The repository containing the generic DashChan extension can be found here.

*Things that do not work with this extension:*

  • Captcha
  • Reports

Installing, configuring, and importing our project to Android Studio

In order to access and modify our project, we are going to have to first install Android studio.

Install Android studio with this simple command:

1
snap install android-studio --classic

Afterwards, we can clone the generic LynxChan DashChan extension with:

1
git clone https://github.com/maksrago/Dashchan-Extension-LynxChan-Generic

When opening Android Studio you will be given several prompts, and after successful installation and configuration you will be able to open projects.

We are going to Import project (Gradle, Eclipse ADT, etc). From there you can specify the directory to where you cloned the extension.

Afterwards, you will likely see this prompt:

To which you should answer OK. Once the gradle sync is successfully completed you should see the following:

Setting the project default behavior

This project makes it extremely easy to add support for your imageboard, we are just going to make a few changes, however, before we do anything we need to setup our projects default behavior. Navigate to the top bar and click: Edit Configurations.. from the dropdown.

From there, we can set the default behavior to Nothing:

Put simply, this APK acts as a set of instructions for the DashChan app, and how it should interpret and pull data from the specified source we direct it to.

Setting up Android Device (physical device or emulator)

Select one of these options, I would highly recommend using a physical Android device you have one available.

If you have a physical Android device

You will need to follow these steps:

1. Put your device into developer mode, and enable USB debugging

The process that you need to follow in order to put your Android device into developer mode will vary, thus I would recommend searching up how to do so in your search engine of choice.

After you successfully put your device into USB debugging mode, and connect it to your computer you may see the following prompt on your device:

I recommend checking off Always allow from this computer.

2. Install the DashChan application and supporting libraries

  • Download the DashChan APK, found here.
  • Download the DashChan WebM libraries here.

The link to the DashChan repository, can be found here.

*(If you don’t have a physical device)* Setting up an Android Emulator through Android Studio

To my knowledge, this option is only available to users running on Intel based systems.

*I do not recommend this option, due to the fact that it requires quite a powerful system to emulate Android smoothly.*

To setup an Android device emulator, go to the top bar, and under No Device, and under the dropdown you’ll the the option of Open AVD Manager.

From there you should Create Virtual Device...

From there you can select a device that you with to emulate, in my case I stuck with the default:

You can also customize the Android version on the emulated device, I used Q:

Afterwards, Android Studio will download and pull your version of Android that you specified and install it on your emulator:

Finally, you can specify any additional settings for your emulator, we should be fine with the default settings, so just hit Finish.

After your emulator is successfully configured, make sure that:

1. Put your device into developer mode if it isn’t already, and enable USB debugging

The process that you need to follow in order to put your Android device into developer mode will vary, thus I would recommend searching up how to do so in your search engine of choice.

2. Install the DashChan application and supporting libraries

  • Download the DashChan APK, found here.
  • Download the DashChan WebM libraries here.

The link to the DashChan repository, can be found here.

After successfully setting up your device

You should see one of the following options in your Android Studio now depending on whether you chose to use a physical device or a emulated device:

You should see the name of your physical device, or the emulated device name along with the API version your selected in the previous optional step.

Setting up our boards list

If order for the DashChan extension to work properly, we are going to need to create a new html file in the /static/ directory of our LynxChan frontend, the exact location would be ~/LynxChan/src/fe/static/. This file should be named boardsList.html, in this file you will add the respective boards for your site, an example boardsList.html might look like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<h2>NSFW</h2>
<ul class="boardlist">
  <li><a href="/b/">Random</a></li>
  <li><a href="/library/">Library</a></li>
  <li><a href="/pol/">Politically Incorrect</a></li>
  <li><a href="/r9k/">ROBOT9001</a></li>
</ul>

<h2>SFW</h2>
<ul class="boardlist">
  <li><a href="/culture/">Culture</a></li>
  <li><a href="/g/">Technology</a></li>
  <li><a href="/k/">Weapons</a></li>
  <li><a href="/meta/">16chan Discussion</a></li>
  <li><a href="/v/">Video Games</a></li>
</ul>

As you may have already noticed, you can use <h2> tags in order to specify a category or a heading for categorizing your boards.

Making modifications to the project (DashChan module)

Now, we can add personalized changes to the project and point it to our LynxChan site!

From there we are going to need to modify the following files: -AndroidManifest.xml -LynxchanChanLocator.java -LynxchanChanConfiguration.java

Modifying: AndroidManifest.xml

*Located in:* ~/Dashchan-Extension-LynxChan-Generic/

In the AndroidManifest.xml file we are going to modify lines 29 and 30 to correspond to our imageboard’s domain, in the case of 16chan it would look like:

line 29

1
<data android:host="16chan.xyz" />

and

line 30

1
<data android:host="www.16chan.xyz" />

Modifying: LynxchanChanLocator.java

*Located in:* ~/Dashchan-Extension-LynxChan-Generic/src/com/sixsixthree/dashchan/chan/lynxchan/

We just need to modify this file with our site domain information once again, on lines 18 and 19, so in the case of 16chan it would look like:

line 18

1
addChanHost("16chan.xyz");

and

line 19

1
addConvertableChanHost("www.16chan.xyz");

Modifying: LynxchanChanconfiguration.java

*Located in:* ~/Dashchan-Extension-LynxChan-Generic/src/com/sixsixthree/dashchan/chan/lynxchan/

Here you might want to make several modifications depending on the your site, and how you configured it.

On line 34 you can specify the amount of attatchments that you want to allow users to post, this should correspond to your site’s Maximum number of uploaded files on posting a setting that is found under your site’s Global Settings.

Furthermore, you can add and remove supported mime types just below that setting, the default settings should work just fine if you don’t have any additional customization with mime types.

Testing our APK

We can begin by opening the DashChan application on our device, you should see something similar to this:

To test the module we just customized we can click the little green arrow on the top bar:

Afterwards you can restart the DashChan application, if you succesfully configured everything you should see the boards that you specified in your boardsList.html file. In my case:

Creating a shareable APK

Upon successfully testing and making various changes to the project, you can generate a compiled APK file by selecting Build > Build Bundle(s) / APK(s) > Build APK(s), you should then see something like this:

This APK will be located in ~/Dashchan-Extension-LynxChan-Generic/build/outputs/apk/debug/, you can then upload it to either some version control site (Github/Gitgud) or host it on your site. Either way I recommend making a page similar to https://16chan.xyz/.static/pages/mobile.html, to make it easy for your users to understand how to setup up the application.