Notes on Memas

by Gisle Hannemyr

Mumble

Table of contents

Introduction

Postman

The directory ~/Documents/Work/Hnm/Clients/Karde/ on Hannemyr PC is used for the project documentation. All documentation directories referred to below are in subdirectories of this.

The project consists of two components:

The project that produced the “Memas” native android app and Adminwb was originally named “Caneo”.

The source code of the original Memas client (as received from Tellu) is archived at ~/src/gitrepo/karde/caneo-anderoid-v2/. For use in Android Studio, a copy is imported to ~/AndroidStudioProjects/caneo-anderoid-v2 on Hannemyr PC. This should not be altered.

The development version of version 3 is located at ~/AndroidStudioProjects/Memas-v3 Hannemyr PC.

The platform used for Adminweb is Grails 1. It is seriously outdated and can no longer be compiled. It uses a expanded dialect of Java called “groovy”.

Q&A with Tellu (norwegian)

SM: Sverre Morka, 952 31 268
LB: Lars Thomas Boye, 905 72 929.

2019-April-02 [SM & LB]:

  1. Er kildekoden til Memas og til Adminweb tilgjengelig?
    Ja. Både Adminweb og Memas bruker veldig gamle og utdaterte biblioteker og SDK'er. Dette er litt problematisk for Adminweb, der noen av artefaktene ikke lenger er tilgjengelig i Maven Central. Kopier er nå i Assets med datostempel 2019 April 12:
    • caneo-android-v2.zip– Memas app, java
    • memas-web.zip – Adminweb, groovy.
    • memas-stringutil.zip – lite script, groovy
  2. Hva finnes av systemdokumentasjon?
    Lite, men det som finnes er nå i Documentation/:
    • mylife_technology_2013.ppt
    • memas_tellu_2013.docx
    • protocol.txt
  3. Finnes det ssh-tilgang til serveren for Adminweb (Rackspace)?
    Ja. Det er to rackspace servere. Da google bestemte seg for å blokkere email fra hovedserveren har email-serveren blitt flyttet til en annen server. Rackspace serveren kjører en Glassfish container med web'en samt en postgresdatabase.
  4. Er det mulig å få laget en SQL-dump av PostgreSQL-databasen?
    Du kan tunnellere pgadmin til postgres-databasen og eksportere databasen.
  5. Hvem styrer/kontrollerer DNS for https://adminweb.no/web/ (jeg ser at Domeneshop er registrar).
    Dette administreres på domeneshop-kontoen til mylifeproducts (Riita).
  6. Hva slags protokoll/bibliotek benyttes for kommunikasjonen mellom Memas og AdminWeb?
    Memas kaller periodisk web'en med et tidsstempel for sin konfigurasjon over https. Dersom det er nyere tidsstempel for konfigurasjonen på web'en vil Memas laste ned ny konfigurasjon.

2019-April-03 [LB]:

2019-April-08 [LB]:

Jeg har gått gjennom Memas-appen og laget en oversikt over kommunikasjon mellom app og server, vedlagt [protocol.txt].

Roadmap to the source code

There are three main subdirectories:

The following subdirectories may exist:

The file caneoAndroid/src/main/AndroidManifest.xml contains basic settings for the app:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="no.tellu.caneo.memash4d"
        android:versionCode="62"
        android:versionName="2.52 H4D">

In caneoAndroid/src/main/java/no/tellu/caneo/, there are 8 subdirectories:

English strings used by the client is in caneoAndroid/src/main/res/values/strings.xml. Translation to other languages are in parallell subdirectories.

Client configuration

To configure the client, activate demonstration mode and click “Menu” in the top right corner.

memas_menu.png
To access the administrator menu from demo mode, click “Menu” in top right corner.

Settings

Communication protocol

Communication between Memas (client) and Adminweb (server) is based upon based on HTTP GET request with retrieves a JSON body.

Authentication is with a token as HTTP header. The client is configured with the address of the server, indicated with <BASEURL> in the following.

The default value is set in line 80 in CaneoSettings.java (caneoAndroid):

cc.addItem(CON_URL, "https://adminweb.no/web/", 0, new UrlValidator());

In Java, it is called “baseUrl”.

The default value is used when the client is installed forst time, and when you navigate to Menu » Settings » Options » Restore defaults.

Connecting an account to the client:

The protocol is illustrated with example JSON.

A code displayed in the adminweb UI is entered on the client, which exchanges it for a token.

Request:

GET <BASEURL>/client/auth?token=<CODE>

The server returns JSON:

{
	"token":"someSecretToken",
	"primaryUser":{
		"secondaryUsers":[
			{"firstName":"Hans", "lastName":"Hansen"}
		]
	}
}

The token is required as a header field for all subsequent HTTP requests from the client. Header field name “token”.

Plan

  1. Change Memas to query an endpoint at adminweb.roztr.com that just produces static JSON.
  2. Produce dynamic JSON.
  3. Import legacy database to adminweb.

Log of source code changes

Line 5 in AndroidManifest.xml (caneoAndroid) [2020-08-11]:

android:versionName="3.0.0-alfa1"

Line 80 in CaneoSettings.java (caneoAndroid) [2020-08-11]:

cc.addItem(CON_URL, "http://adminweb.roztr.com/web/", 0, new UrlValidator());

Troubleshooting

Below is a record of problems encountered and how they were solved:

Error: Please select Android SDK

SO.com answer by Hasib Akter.

Final word


Last update: 2019-04-07 [gh].