Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using MapMint4ME for adding and editing tables #10

Open
omshinde opened this issue Jul 16, 2017 · 0 comments
Open

Using MapMint4ME for adding and editing tables #10

omshinde opened this issue Jul 16, 2017 · 0 comments

Comments

@omshinde
Copy link

omshinde commented Jul 16, 2017

Hello all,
After being able to Edit tables using MapMint web interface, I tried to access the tables and Edit them using MapMint4ME.
I am compiling the points here for future reference:
The MapMint4ME Android app can be downloaded by following the link.

I used Android Studio for emulating a device. Then compiled the MapMint4ME application on the emulated device. The Android Studio gives the advantage of directly calling the code from Version Control Systems such as Github, Mercurian et cetera.

The Github repo for MapMint4ME can be accessed by following the link: MapMint4ME.
Some settings need to be setup before compiling the code. A virtual device needs to be configured for seeing the app. I used the following specifications for the virtual device:

  • Device: Nexus 5X
  • Android Version: API 23, Marshmallow
    After compiling, you will be able to see the screen of emulated device as shown in the following image:

issue_15july

After clicking on Import, you will be directed to a screen which will be like:

issue_15july_1

A MapMint server is required to be registered. After clicking on Add server. You will get fields to fill as in the following figure:

issue_15july_2

The Server name can be anything as of your wish. The Server URL is defined in the mapmint-services/main.cfg. By default, it is, http://localhost/cgi-bin/mm/zoo_loader.cgi. But, we need to understand one thing that the localhost, in this case, is referring to the emulated device and not the localhost of development machine (usually 127.0.0.1). So, by using http://127.0.0.1/cgi-bin/mm/zoo_loader.cgi, I will be able to access MapMint instance on my development machine but not on my emulated Android device. the reason being that the emulated device is itself hosted on the localhost of the development machine. For this, we have a concept of alias IP which is 10.0.2.2. So, the Server can be accessed from the emulated device by the URL http://10.0.2.2/cgi-bin/mm/zoo_loader.cgi.

In another way, you can access the server by using the IP of the Network your development machine is connected to. I used this method to connect with the MapMint server. The IP of the server can be known by executing:

  1. ipconfig for Windows.
  2. ifconfig for Linux based systems.

Note: The information about localhost can be obtained by viewing the /etc/hosts in Linux based systems.
The login and password should be filled. After clicking on Add a server, you will be able to see the following screen:

issue_15july_3

Now, we are all set for importing the data. But, before importing we need to setup the GetStatus service. The GetStatus service provides status of the app.
For setting up Getstatus service, follow the following steps:

  • Traverse to path home/src/zoo/zoo-project/zoo-services/utils/status.
  • Run make or sudo make (in case you get: Permission Denied).
  • Then traverse to home/src/zoo/zoo-project/zoo-services/utils/status/cgi-env and copy all the zcfg and zo files and paste them to the /usr/lib/cgi-bin/mm/.
  • Then copy the xsl file to the directory corresponding to your [main] section dataPath variable setting of your main.cfg file.
  • The ZOO- kernel will automatically detect it's presence.

If the GetStatus service is not activated, then it will not be possible to PING the server and you will be getting the PING FAILED error message.

After clicking on import, you will see the navigation bar moving. The database is created as soon as the import button is done. In the MapMint4ME, the database is embedded into the application and hence, it is not possible to access the database. So, even after using the SQLite Manager from FireFox, nothing can be seen from the database. When the process is completed, you will be seeing something like following image:

issue_15july_4

Note: I was facing one issue which caused the import to fail. The error can be seen very concisely in: https://pastebin.com/raw/tw53gkMZ. This was because the tiles.db was not being created. In case you face such an issue, then you can manually create the tiles.db database by following below mentioned steps:

  • Go to the path /var/www/html/tmp/ . This is the path to the temporary directory which is storing database. This is defined in the tmpPath variable in the main.cfg file.
  • Open the terminal in this path and run touch tiles.db or sudo touch tiles.db.
    OR
    Open the terminal of the Android Studio at the specified path and type sqlite3 tiles.db. This will also create the tiles.db database.

Now, the import will be successful.

As soon as the import is successful, you can explore the View, Edit options and add and Edit tables from the Application itself.
I am appending an image of the View section below.

issue_15july_5

I hope this issue will help in accessing the Tables from the MapMint4ME Android application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant