Skip to content

Commit

Permalink
Merge pull request #17 from OpenHistoricalDataMap/BetaVersion
Browse files Browse the repository at this point in the history
Beta version
  • Loading branch information
WilliBoelke authored Jun 2, 2020
2 parents 5404d2c + aa66657 commit 93a5964
Show file tree
Hide file tree
Showing 85 changed files with 4,291 additions and 1,839 deletions.
58 changes: 2 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,75 +63,21 @@ Using it in productivity, will make your server extremely vulnerable.


### Prerequisites
We're using ```docker``` and ```docker-compose``` to run the FTP server.

Go through the [official documentation](https://docs.docker.com/install/) in order to get both components installed.

### Build
Open ```map-file-download-center/docker-compose.yml``` and change the ```environment``` variables to your needs:
In this example, every file in `/opt/ohdm/` will be shown in the android application. Make sure, that there are actually `map-files` in the directory you specified under `volumes` in the `docker-compose.yml`.

```
version: "3.3"
services:
vsftpd:
container_name: vsftpd
image: panubo/vsftpd
ports:
- "21:21"
- "4559-4564:4559-4564"
restart: always
environment:
FTP_USER: ohdm
FTP_PASSWORD: ohdm
FTP_USERS_ROOT:
network_mode: "host"
volumes:
- /opt/ohdm:/srv/ohdm
```

Now you can start the container with

```
docker-compose up
```

If successful, you should see

```
...
vsftpd | Received SIGINT or SIGTERM. Shutting down vsftpd
vsftpd | Running vsftpd
```
at the end of the output.
Great, now you can begin to adjust the source code to point the app to your ftp server

### Configure
Open the file ```app/src/main/java/de/htwBerlin/ois/Activities/MapDownloadActivity.java```:

and change the parameter with the values you just used in the ```docker-compose``` file:

```
...
private static final String FTP_SERVER_IP = "";
private static final Integer FTP_PORT = 21;
private static final String FTP_USER = "";
private static final String FTP_PASSWORD = "";
...
```

### Deploy
Just install the application again on your device with Android Studio.

In order to host ```map```-files on the FTP server, just copy the files to ```/opt/ohdm/```

You then should see the listed files in the ```Maps``` tab.

You can start the container with ```docker-compose up -d``` in background.

## Contact
Developed by: [FalcoSuessgott](https://github.com/FalcoSuessgott)
Developed by: [WilliBoelke](https://github.com/WilliBoelke)
Developed by: [NoteFox](https://github.com/NoteFox)

Project Link: [Open Historical Data Map](https://github.com/OpenHistoricalDataMap)

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
testImplementation 'junit:junit:4.12'

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

<application
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Fragments.RequestMapFragment"></activity>
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".Fragments.FragmentrequestNewMap"></activity>
<activity android:name=".MainActivity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import java.util.ArrayList;

import de.htwBerlin.ois.ServerCommunication.FtpTaskFileDownloading;
import de.htwBerlin.ois.R;
import de.htwBerlin.ois.ServerCommunication.FtpTaskFileDownloading;

/**
* ListView adapter that holds ohdmFiles
Expand All @@ -23,15 +23,15 @@
* @author morelly_t1
*/
@Deprecated
public class OhdmFileListViewAdapter extends ArrayAdapter<OhdmFile>
public class OhdmFileListViewAdapter extends ArrayAdapter<RemoteFile>
{

private static final String TAG = "OhdmFileAdapter";

private Context context;
private int resource;

public OhdmFileListViewAdapter(Context context, int resource, ArrayList<OhdmFile> ohdmFiles)
public OhdmFileListViewAdapter(Context context, int resource, ArrayList<RemoteFile> ohdmFiles)
{
super(context, resource, ohdmFiles);
this.context = context;
Expand All @@ -45,7 +45,7 @@ public View getView(int position, View convertView, ViewGroup parent)
String creationDate = getItem(position).getCreationDate();
Boolean isDownloaded = getItem(position).isDownloaded();

final OhdmFile ohdmFile = new OhdmFile(fileName, fileSize, creationDate, isDownloaded);
final RemoteFile ohdmFile = new RemoteFile(fileName, fileSize, creationDate, isDownloaded);

LayoutInflater inflater = LayoutInflater.from(context);
convertView = inflater.inflate(resource, parent, false);
Expand All @@ -63,7 +63,7 @@ public View getView(int position, View convertView, ViewGroup parent)
@Override
public void onClick(View v)
{
FtpTaskFileDownloading ftpTaskFileDownloading = new FtpTaskFileDownloading(context);
FtpTaskFileDownloading ftpTaskFileDownloading = new FtpTaskFileDownloading(context, "");
Toast.makeText(getContext(), "Downloading " + fileName, Toast.LENGTH_SHORT).show();
ftpTaskFileDownloading.execute(ohdmFile);
disableButton(buttonDownloadFile);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package de.htwBerlin.ois.FileStructure;

public interface OnRecyclerItemButtonClicklistenner
{
void onButtonClick(int position);
}
Loading

0 comments on commit 93a5964

Please sign in to comment.