Code Monkey home page Code Monkey logo

client's Introduction

client

This repository contains the Buendia app, which runs on tablets with Android 4.4.2 (KitKat) or higher. See the Buendia wiki for more details about the project and about the OpenMRS module that this app communicates with.

Copyright notice

Copyright 2015 The Project Buendia Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Developer setup

Follow the instructions below to get your system set up to do Buendia client development.

Prerequisites

JDK 7 or higher
  • If java -version reports a version lower than 1.7, install JDK 7:
    • Linux: sudo apt-get install openjdk-7-jdk
    • Mac OS: Download from Oracle
  • Note: JDK 8 works fine for client development, but to run the OpenMRS server you have to use JDK 7, not 8.
Android Studio
A tablet running Android 4.4.2 or higher (optional)
  • We have tested the application with Sony Xperia Z2 tablets in the field: they are waterproof, have a great screen, and come with KitKat. However, in 2019 these are no longer in production.
  • Any Android tablet should do fine. We recommend a tablet with at least an 8-inch display; the app is designed for 1200 x 1920 resolution.
  • The app will also run on an Android phone. The user interface can be scaled down to be usable on a phone (though a bit unwieldy).
  • You can also use an emulator instead of a real device (see below).
Set up your computer to communicate with your tablet or phone
  • You can skip this step if you're using an emulator (see below).
  • On the device, enable Developer options by opening the Settings app, selecting Software options, and tapping the Build number 7 times.
  • In the Settings app under Developer options, turn on USB debugging.
  • Connect a USB cable from your computer to your device. Click OK when asked if you want to allow USB debugging.
  • Now you need to set up your computer:
    • If you're developing on Mac OS X, it just works. You're done.
    • If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see this OEM USB Drivers document.
    • If you're developing on Ubuntu Linux, you need to add a udev rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. For a list of vendor IDs, see USB Vendor IDs. To set up device detection on Ubuntu Linux.
      • Log in as root and create this file: /etc/udev/rules.d/51-android.rules.

      • Use this format to add each vendor to the file: SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev". In this example, the vendor ID 054c is for Sony. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.

      • Now execute: chmod a+r /etc/udev/rules.d/51-android.rules.

      • NOTE: 2019-06-07 I did not set up these udev rules on my Ubuntu 16.04 machine, and it worked anyway

Android Studio project setup

  1. Get the Buendia client source code:

    git clone --recursive [email protected]:projectbuendia/client.git
    
    git submodule update --init
    
  2. Launch Android Studio and click Open an existing Android Studio project.

  3. Navigate to the root directory of your client repo, select the build.gradle file there and click Open.

  4. Wait a few minutes while Android Studio builds the project for the first time.

    • During the first build, it's normal to get errors about missing parts of the SDK (e.g. "Error: failed to find target android-21", "Error: failed to find Build Tools revision 19.1.0"). In each case, just click the suggested resolution to install the necessary SDK component (e.g. "Install missing platform(s) and sync project", "Install Build Tools 19.1.0 and sync project") until the build finishes without errors.

You are now ready to develop the Buendia client in Android Studio.

Building and running the client on a tablet

Connect a USB cable from your computer to your device.

On Android Studio, click the Run button (green triangle in the toolbar at the top). For Module select app and click OK.

You should see your device appear in the "Select Deployment Target" window. Select it and click OK.

Wait a few minutes for the app to build (you can see progress in the status bar at the bottom). When it's done, Android Studio will automatically install it on the tablet and start it.

By default, the app is configured to use a server address pointing at a server on the Internet that contains dummy data. Feel free to add and edit users and patients.

Client tests

The client-side tests include both unit tests and functional tests, all located under the project's androidTest folder. These tests run best on a real tablet attached to your computer. (When run on an Android emulator, some tests work and some don't.)

You can run just the tests in a single file, or run all the tests under a given folder (such as the androidTest/java folder for all the tests in the entire project). In the Project pane, right-click a file or folder, choose Create Run Configuration, and then choose Android Tests (the one with the icon containing the little green Android robot). It's necessary to set the Specific instrumentation runner to AndroidJUnitRunner. Then you can Run or Debug this run configuration to run the tests.

Changing the default OpenMRS server settings

You can always manually change the OpenMRS server, username, and password on the Settings page in the app. It's tedious to keep doing this every time the app is uninstalled and reinstalled, though. To change the default settings, which are built into the app, edit these lines in app/build.gradle:

def serverDefault = serverDev
def openmrsUserDefault = 'buendia'
def openmrsPasswordDefault = 'buendia'

By default, the client is built with its Server set to dev.projectbuendia.org, which is an instance of the OpenMRS server with dummy data that we use for development. For release builds, we set this to simply server, which is the hostname of the Edison server in real deployments. (When you set the Server to, say, blarg, the OpenMRS base URL is automatically set to http://blarg:9000/openmrs. If you need to use a different port or path, you can edit the URL directly in the Advanced page in Settings.)

If you want to run the client with an OpenMRS server that you have built locally, you have three options:

  1. Deploy OpenMRS with your locally built server module on an Internet-accessible website; run the client on a real tablet with Internet access and set its OpenMRS base URL to point at that website
  2. Run OpenMRS on your own computer; assign your computer an IP address that's reachable from the tablet; run the client on a real tablet and set its OpenMRS base URL to point at your computer
  3. Run OpenMRS on your own computer; run the client in an Android emulator on your computer

An Android emulator runs significantly slower than a real tablet, but in terms of setup it's usually the quickest way to get a locally built client running with a locally built OpenMRS server. Using a local client and local server also enables you to do development while completely offline.

Using an emulator and a locally built OpenMRS server

To set up an emulator with some settings that are known to work:

  • In Android Studio, open Tools > Android > AVD Manager
  • Click Create Virtual Device
  • Click New Hardware Profile and select:
    • Device Type: Phone/Tablet
    • Screensize: 10.1 inches
    • Resolution: 1200 x 1920 px
    • Memory: RAM: 2 GB
    • Input: no hardware buttons, no keyboard
    • Navigation Style: None
    • Supported device states: Portrait only
    • Cameras: both front and back
    • Sensors: all sensors (Accelerometer, Gyroscope, GPS, Proximity)
    • Default Skin: No Skin
  • Click OK and with your new hardware profile selected, click Next
  • For System Image, choose the KitKat image with API level 19 and Target Android 4.4.2 and click OK
  • Click Show Advanced Settings and select:
    • Startup size and orientation:
      • Scale: Auto
      • Orientation: Portrait
    • Camera:
      • Front: None
      • Back: None
    • Network:
      • Speed: Full
      • Latency: None
    • Emulated Performance:
      • Host GPU: on
      • Store a snapshot for faster startup: off
    • Memory and Storage:
      • RAM: 2 GB
      • VM heap: 256 MB
      • Internal Storage: 1 GB
      • SD card: Studio-managed, 1 GB
    • Custom skin definition: No Skin
    • Keyboard:
      • Enable keyboard input: turn this off for a realistic simulation (on-screen soft keyboard); turn this on for the convenience of typing with your real keyboard instead of clicking the tablet keyboard
  • Click Finish

The emulated tablet will not have access to the Internet, but it will see your computer at IP address 10.0.2.2, so you'll need to run an OpenMRS server on your computer and then set the client's OpenMRS base URL to http://10.0.2.2:9000/openmrs. If you edit app/build.gradle and change

def openmrsRootUrlDefault = openmrsRootUrlDev;

to

def openmrsRootUrlDefault = openmrsRootUrlLocalhost;

the client will have its server URL set to http://10.0.2.2:9000/openmrs by default.

Faking Tablet Resolution on Non Tablet Devices

Resolution of field devices

In the field, the Buendia project uses Sony Xperia Z2 Tablets. The user interface, has thus been written assuming a tablet interface, and in particular, assuming the specific resolution and DPI of the Sony Xperia Z2.

You can determine the specific resolution / DPI of the Sony Xperia Z2 Tablet by plugging it into a computer and running the following commands (make sure you have adb set up and USB debugging turned on):

$ adb shell wm size
Physical size: 1920x1200
$ adb shell wm density
Physical density: 240

Faking the resolution on an Android phone

If you've got an Android phone, but not an Android tablet, it's still possible to develop the Buendia app, but it will be much easier if you fake the screen resolution of the tablet on your phone. You can do this by plugging your Android device into a computer, and running:

$ adb shell wm size 1920x1200
$ adb shell wm density 240
$ adb reboot

Note:

  • You may need to use a size of 1200x1920 instead of 1920x1200; it depends on the default orientation of your phone screen.
  • It's important to reboot because most apps assume that the density (in particular) doesn't change over the life of the application.
  • These settings persist through reboots.

Resetting your Android phone to normal

Once you're finished developing, you probably want to be able to use your phone as normal again 😄

I suggest the following commands:

$ adb shell wm size reset
$ adb shell wm density reset
$ adb reboot

Testing Notes

  • Works on a release-build Nexus 5 running Lollipop; your mileage may vary.

Android SDK packages

If you're using Android Studio, you don't need to worry about installing SDK packages; Android Studio will take care of it for you (see Android Studio project setup above). You only need to install the packages yourself if you want to build the client from the command line.

The set of Android SDK packages needed to build the client is:

  • Android SDK Platform 5.0.1 (API level 21)
  • Android SDK Build-tools, revision 19.1
  • Android Support Library, revision 23
  • Android Support Repository, revision 17

The graphical Android SDK Manager at $ANDROID_HOME/tools/android will let you select and install these packages interactively; or you can install them all with the command:

$ANDROID_HOME/tools/android update sdk --no-ui --all --filter android-21,build-tools-19.1.0,extra-android-support,extras-android-m2repository,platform-tools

ANDROID_HOME is usually /opt/android-sdk-linux on a Linux machine and ~/Library/Android/sdk on a Mac.

To build the client from the command line, go to the root of your client repo and run ./gradlew clean assembleDebug. The resulting apk will be at app/build/outputs/apk/app-debug.apk.

Setting up command-line tools on Debian stretch

sudo apt-get install openjdk-8-jdk unzip git

mkdir -p ~/.android && touch ~/.android/repositories.cfg

mkdir android && cd android
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip 

export PATH=$HOME/android/tools:$HOME/android/tools/bin:$PATH
export ANDROID_HOME=$HOME/android

yes | sdkmanager --licenses
sdkmanager "platforms;android-21" "build-tools;19.1.0" "extras;android;m2repository" "platform-tools"

cd ../client/
git submodule update --init client-libs

./gradlew assembleDebug 
ls app/build/outputs/apk/debug/

# ./gradlew -PversionNumber=0.10.0 clean assembleDebug 

client's People

Contributors

akalachman avatar capnfabs avatar dancunningham avatar danielsjulio avatar g1dr4 avatar giljulio avatar ivangayton avatar krtonga avatar llvasconcellos avatar mathewinwood avatar minh-t-nguyen avatar mjanes avatar nickfortescuegoogle avatar pimdewitte avatar schuyler avatar sdoerner avatar spacekitty avatar viniciusboson avatar zc-android avatar zestyping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

client's Issues

Bug with #35: All notes showing up as null

This relates to pull request #35, when I installed from the ~client-wip build (which I'd merged that pull request into) and applied the profile "nutrition-dan14-with-graph.csv".

With this set up, the notes icon correctly appears whenever notes have been recorded.

When you tap on it, the dialog just displays a blank space where the note should be:

image

Tests should not programmatically disable WiFi to deliberately cause sync errors

LocationSelectionFailingSyncTest programmatically disables WiFi to invoke Sync errors in these tests:

  • testSyncFailedDialog_backButtonReturnsToUserSelection()
  • testSyncFailedDialog_RetryButtonActuallyRetries()
  • testSyncFailedDialogAppearsWhenSyncFails()

This is problematic because:

  • If your WiFi connection is less than ideal (captive portal, for example), then tests become flaky because you might not be able to connect to the WiFi network again.
  • It won't work on an emulator.

Also,

  • It's an ugly, ugly hack.

Instead, we should refactor the code to broadcast a Sync failed event to the UI.

Client Crash when no Profile Applied.

This happens right after you setup a new development server.
As there is no profile applied to the new server some of the information is missing and the client crashes.

PatientChartActivity drops temporary observations prematurely.

See PatientChartActivityTest for reference.

Both of our tests that create multiple observations for a single patient in quick succession are flaky, and only pass about half of the time. The cause of the test failures appears to be that the chart fails to update after observations are made sometimes.

The failure mode for testCombinesNonOverlappingObservationsForSameEncounter is that sometimes, all of the observations from a single encounter are missing.

For testEncounter_latestEncounterIsAlwaysShown, sometimes the observations update to the new values, and sometimes they don't.

Test fields using profile `nutrition_chad4.csv` round all values to nearest integer

Note: this isn't a problem that affects production, just the tests.

Currently, test fields are all truncated when they're displayed on the client. I entered the number "12.1" for a bunch of fields; here's the result:

screenshot_2015-11-04-16-58-05

Note that:

  • It's only for test fields - real fields work ok
  • The values are stored with the decimal point on the server, it's just a formatting problem on the client side.

This causes 3/6 tests in PatientChartActivityTest to fail.

Emulator crashes when opening any patient file

The development repository seems to have an issue.

I can't see the stack trace from #2, but i believe it's a different issue.

I cloned the project and followed the instructions on its README.

The error is happening either changing the changing the default OpenMRS server settings to local (10.0.2.2) or maintaining its default (dev.projectbuendia.org).

The stack trace for this error is:

09-14 20:32:33.626    3173-3632/org.projectbuendia.client.dev E/AndroidRuntimeFATAL EXCEPTION: AsyncTask #2
    Process: org.projectbuendia.client.dev, PID: 3173
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:300)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.Void[]
            at org.projectbuendia.client.models.AppModel$FetchTypedCursorAsyncTask.doInBackground(AppModel.java:268)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)

Retrieving form and Loading form dialog icons

Change color of the icons for both "Retrieving form" and "Loading form" dialog messages when adding observations on patient chart.

See error message on EditPatientDialogFragment.

css_class not being applied for select_one with abbr

For this row in my profile spreadsheet, within tiles (and similarly within grid):

type        select_one
required
concept     460
label       Oedema
format      {1,abbr}
css_class   {1,select,777000104:abnormal;777000105:abnormal;777000106:critical}

The CSS class does not look like it is being applied to the abbreviation or the second line in the tile, or to the abbreviation in the grid.

A similar grid row does seem to be getting the CSS class applied:

type        select_one
required    yes
concept     1643
label       Paracheck
format      {1,select,703:+ve;664:-ve;1138:?;}
css_class   {1,select,703:critical;664:good;1138:borderline}

There are some differences:

  • it is a required row
  • it has a more customised format
  • it is only in the grid, not in the tiles

Application crashes when 'Add Test Results' action menu is selected on Patient Chart

Steps to reproduce this bug:
On login chart, select an user.
On locations chart, select a location.
On patient list, select a patient.
Then select 'Add Test Results' on action Menu.
The application crashes and restarts on login chart.

10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity: Attempt to invoke virtual method 'int org.javarosa.form.api.FormEntryPrompt.getControlType()' on a null object reference
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity: java.lang.NullPointerException: Attempt to invoke virtual method 'int org.javarosa.form.api.FormEntryPrompt.getControlType()' on a null object reference
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.widgets2.Widget2Factory.create(Widget2Factory.java:52)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.views.ODKView.<init>(ODKView.java:235)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1445)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:34.986 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:    at org.
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity: length=0; index=-1
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity: org.odk.collect.android.exception.JavaRosaException: length=0; index=-1
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.logic.FormController.stepToNextScreenEvent(FormController.java:716)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1462)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)
10-08 17:43:35.013 26145-26145/org.projectbuendia.client.dev E/org.odk.collect.android.activities.FormEntryActivity:     at org.odk.collect.android.activities.FormEntryActivity.createView(FormEntryActivity.java:1468)

Pressing back after new patient creation

Right after creating a new patient the patient chart is displayed but when you hit the back button the app goes to the user selection dialog instead of the Locations dialog.

Automatically collapse down the columns to a very narrow (like 2px) width when there are no observations for 3 or more days.

Proposed rules:

  • If there are no observations or recordings of treatments given for a day, that column is considered empty
  • If there are 3 or more adjacent empty columns, those should be collapsed down
  • Never collapse the current day
  • Never collapse future days

Simpler version: omit empty columns

  • The following code in ChartRenderer.getHtml ensures that columns exist for all days between the first and last:
            for (LocalDate d = mDays.first(); !d.isAfter(lastDay); d = d.plusDays(1)) {
                getColumnContainingTime(d.toDateTimeAtStartOfDay());
            }
  • Simply delete these lines to cause empty columns to be omitted.

Notes dialog pops up twice

When you tap on the Note icon in the grid, it first comes up as it should, then when you press OK another dialog comes up immediately after which is kind of empty just with a timestamp:

notes dialog

Can't run client tests against local server

Currently, it's not possible to test on a locally built server (using everything at head):

  • The profiles available in the Profiles repo don't have test forms.
  • the profiles applied to the http://dev.projectbuendia.org server require concepts that aren't available to servers setup with the openmrs_setup script.

This is problematic for (e.g.) server refactoring work, or sync algorithm changes.

Bug with #35: UUIDs showing up instead of names

This relates to pull request #35, when I installed from the ~client-wip build (which I'd merged that pull request into) and applied the profile "nutrition-dan14-with-graph.csv".

This might actually be a couple of separate bugs.

There’s something weird going on with some of the concepts on dev.projectbuendia.org. I’m seeing UUIDs showing up instead of names for some concepts.

This relates first to Oedema - http://dev.projectbuendia.org:9000/openmrs/dictionary/concept.htm?conceptId=460

777000103 "-. None" has been replaced with 777000103 with English name “Order executed” and English (UK) name “-. None”. The UUID is now "buendia-concept-order_executed”. In the patient chart grid rows, it is the UUID that shows up instead of the name or abbreviated form.
http://dev.projectbuendia.org:9000/openmrs/dictionary/concept.htm?conceptId=777000103

777000104 has similarly become merged with "Order described in free text instructions”

777000105 "++. Moderate (Feet and legs)” and 777000106 "+++. Severe (Face, feet and legs)” seem to be fine, though in the grid and tiles, the UUID is shown instead of the name.

Also, the Consciousness (AVPU) answer “A. Alert” is showing up as its UUID instead of name “160282AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”
http://dev.projectbuendia.org:9000/openmrs/dictionary/concept.htm?conceptId=160282

Several weird things to investigate and fix:

  1. Why have these concepts been merged with “Order executed” concepts?
  2. Why does that concept have the UUID "buendia-concept-order_executed” instead of a hexadecimal UUID - is that OK?
  3. Why are the UUIDs showing up instead of the names?

Newly added patients admission date

Newly added patients don't have admission date and the Chart last updated date is Dec 31, 1969.
This is causing the NewPatientActivityTest to fail.

Client App not working

After this commit: ea7ed1d the client application does not work correctly.

  1. The openmrsRootUrlDefault value is set to openmrsRootUrlFantastica and not the default openmrsRootUrlDev as described in the documentation.
def openmrsRootUrlDefault = openmrsRootUrlFantastica;

setting openmrsRootUrlDefault to openmrsRootUrlDev improves the app connection to the server.

def openmrsRootUrlDefault = openmrsRootUrlDev;
  1. The new def added requireWifi is causing some problems.
def requireWifi = "true"

Setting it to false seems to correct the problems:

def requireWifi = "false"

Here are some screenshots with requireWifi = "true"

*The list of users appear in the screen with the right server address in (openmrsRootUrlDefault):

screenshot from 2015-08-29 15 17 52

Selecting one user gives the following error:

screenshot from 2015-08-29 15 18 28

Selecting "settings" force quit the app:

screenshot from 2015-08-29 15 18 37

The logcat:

08-29 15:20:48.764    6861-6861/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
08-29 15:20:48.764    6861-6861/? I/art﹕ Late-enabling JIT
08-29 15:20:48.780    6861-6861/? I/art﹕ JIT created with code_cache_capacity=2MB compile_threshold=1000
08-29 15:20:48.867    6861-6861/org.projectbuendia.client.dev I/PropertyManager﹕ calling constructor
08-29 15:20:48.892    6861-6861/org.projectbuendia.client.dev W/linker﹕ /data/app/org.projectbuendia.client.dev-2/lib/x86/libsqlcipher_android.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
08-29 15:20:48.895    6861-6861/org.projectbuendia.client.dev I/Database﹕ JNI_OnLoad called
08-29 15:20:48.895    6861-6861/org.projectbuendia.client.dev I/Database﹕ JNI_OnLoad register methods
08-29 15:20:48.988    6861-6861/org.projectbuendia.client.dev D/Event﹕ No subscribers registered for event class org.projectbuendia.client.events.diagnostics.TroubleshootingActionsChangedEvent
08-29 15:20:48.988    6861-6861/org.projectbuendia.client.dev D/Event﹕ No subscribers registered for event class de.greenrobot.event.NoSubscriberEvent
08-29 15:20:49.238    6861-6861/org.projectbuendia.client.dev I/buendia/OpenMrsServer﹕ Logging to server: [time=1440872449238, event=resumed_activity, class=LoginActivity]
08-29 15:20:49.240    6861-6861/org.projectbuendia.client.dev I/buendia/VolleySingleton﹕ queueing request: 0 http://dev.projectbuendia.org:9000/openmrs/ws/rest/v1/projectbuendia/concept/5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;time=1440872449238;event=resumed_activity;class=LoginActivity
08-29 15:20:49.245    6861-6887/org.projectbuendia.client.dev D/OpenGLRenderer﹕ Use EGL_SWAP_BEHAVIOR_PRESERVED: true
08-29 15:20:49.249    6861-6861/org.projectbuendia.client.dev D/﹕ HostConnection::get() New Host Connection established 0xa17f1870, tid 6861
08-29 15:20:49.265    6861-6888/org.projectbuendia.client.dev I/buendia/UserStore﹕ Retrieving users from db
08-29 15:20:49.302    6861-6887/org.projectbuendia.client.dev D/﹕ HostConnection::get() New Host Connection established 0xa1063090, tid 6887
08-29 15:20:49.312    6861-6887/org.projectbuendia.client.dev I/OpenGLRenderer﹕ Initialized EGL, version 1.4
08-29 15:20:49.344    6861-6887/org.projectbuendia.client.dev W/EGL_emulation﹕ eglSurfaceAttrib not implemented
08-29 15:20:49.344    6861-6887/org.projectbuendia.client.dev W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa10bdce0, error=EGL_SUCCESS
08-29 15:20:49.500    6861-6888/org.projectbuendia.client.dev I/buendia/UserStore﹕ Found 9 users in db
08-29 15:20:49.512    6861-6884/org.projectbuendia.client.dev D/buendia/UpdateServerHealthCheck﹕ Update server check completed, OK.
08-29 15:20:49.513    6861-6861/org.projectbuendia.client.dev D/buendia/LoginController﹕ Loaded list of 9 users

Review PR #65

Fixing Chart Colors and Severity Bars. #65 -> review it according to Ping's observations.

Admission Date are not being recorded

With the new changed new patient dialog admission date picker is not displayed anymore so the admission date is not being recorded on the server.

Incorrect password causes lockout

OpenMRS locks out a user for 5 minutes after 7 incorrect login attempts in a row.

https://wiki.openmrs.org/display/docs/Administering+Users#AdministeringUsers-ManagingUserLockout

It looks like the client app keeps trying to log in even when it's getting back an "incorrect password" response.

This is on a per-user database so when all apps are sharing a user it's a lot more likely to happen.

Because the tablets keep trying periodically to log in they automatically hit the limit and get locked out.

Most appropriate fix is probably if the tablet sees it is getting an incorrect password response, it should stop trying until you edit the settings and hit "Apply" on either the server, username or password dialog.

To workaround this for now and unlock the user, in mysql I had to run:

delete from user_property where user_id=4 and property=‘lockoutTimestamp’;
delete from user_property where user_id=4 and property='loginAttempts’;

Observation dialog - rounding

It's rounding values; it shouldn't. It should show the full value for floats.

e.g. Temperature - 37.5 is being rounded to 38.

delete new patient activity

Since the new patient activity was replaced by new patient dialog and it's code deleted we don't need the activity layout xml anymore.

required=(blank) not working

The intended behaviour when required is left blank is that if a field has not been filled in ever for that patient, that row does not appear on the patient chart. It should only appear if it has ever been entered.

If required=yes, it will always appear even if it's never been entered.

For select_one fields, when required is left blank, the row is appearing even when nothing has ever been entered.

This is with build b7b1b5b.

UPDATE: This now seems to be not working for any type of field (select_one, select_multiple, number)

Can't add : char to Buendia server address

In settings I can't add : and / to the server address and this is required to change it. Log cat says this:

10-08 11:13:37.372 8765-8765/org.projectbuendia.client.dev E/SpannableStringBuilder﹕ SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

Translations appear to be inconsistent.

For System locales set to: en_UK, en_AU

The patient chart appears to be in a combination of French and English.

screenshot_2015-10-27-12-17-30

Note that the WebView and the Menu are in French, but the rest of the UI is in English.

select_one with no abbreviations - defaults don't work

The defaults for a select_one are:

format = {1,abbr}
caption_format = {1,name}

If there is no abbreviation i.e. the choices are not in the format "abbr. name", strange things happen.

In the observation pop up dialog (the caption), blank spaces appear.

If there is no abbreviation, both abbr and name should show the name.

Add new patient validations

There are currently no validations to new patient. See what has to be ported from old NewPatientActivity.

Invalid characters 'â' and 'Â' on Encounter form

It is happening an intermittent bug on Encounter form.

Its label '[test]] Temperature (°C)' sometimes appears as '[test]] Temperature (°C)'.

The same occurs with '[test]] SpO2 oxygen sat (%)', which appears '[test]] SpOâ oxygen sat (%)'.

screenshot_2015-09-18-20-24-51

To reach this form:

  1. On initial form, select an user.
  2. On location form, select a location.
  3. On Patient list, select a patient.
  4. Select '[test] Form' on top menu.

P0 - Application is not allowing to record treatment given the day after it was prescribed

Steps to reproduce this bug:
. Go to Patient chart (Select a user, then a location and then a patient)
. Add a new treatment not entering any duration (i.e. continue indefinitely).
. Add any observation (to not collapse the empty 'today column')
. Change the system date, adding one day from today.
. Reload the patient chart and try to tap in the treatment cell. No dialog comes up.
. This is client 822.

screenshot_2015-10-11-10-41-36

Go to Patient by ID / Tap on result

When you have a result, you should be able to tap on the name of the patient to go to that patient's chart, as well as the "Go to chart" button.

Exception When clearing local data.

image

10-29 13:58:48.069  11829-11846/org.projectbuendia.client.dev E/Databaseclose() was never explicitly called on database '/data/data/org.projectbuendia.client.dev/databases/buendia.db'
    net.sqlcipher.database.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
            at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1945)
            at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:881)
            at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:913)
            at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:132)
            at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:99)
            at org.projectbuendia.client.sync.Database.deleteDatabaseIfPasswordIncorrect(Database.java:190)
            at org.projectbuendia.client.sync.Database.getWritableDatabase(Database.java:200)
            at org.projectbuendia.client.sync.Database.clear(Database.java:185)
            at org.projectbuendia.client.widgets.EditAndClearDataPreference.onDialogClosed(EditAndClearDataPreference.java:32)
            at android.preference.DialogPreference.onDismiss(DialogPreference.java:391)
            at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1271)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:211)
            at android.app.ActivityThread.main(ActivityThread.java:5373)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

Running Buendia app

Hi!

I am trying to run the client app on a emulator. In my tests I have tried to use the dev.projectbuendia.org:9000 (default value) as server. But when I run the app the following error is shown:

09-28 01:11:41.495    3091-3115/org.projectbuendia.client.dev E/Volley﹕ [106] BasicNetwork.performRequest: Unexpected response code 500 for http://dev.projectbuendia.org:9000/openmrs/ws/rest/v1/projectbuendia/user?q=
09-28 01:11:41.635    3091-3091/org.projectbuendia.client.dev D/dalvikvm﹕ GC_FOR_ALLOC freed 524K, 9% free 5968K/6556K, paused 46ms, total 47ms
09-28 01:11:42.095    3091-3133/org.projectbuendia.client.dev E/buendia/UserManager﹕ Load users task failed
    java.util.concurrent.ExecutionException: com.android.volley.VolleyError: Unknown resource: v1/projectbuendia/user
            at com.android.volley.toolbox.RequestFuture.doGet(RequestFuture.java:117)
            at com.android.volley.toolbox.RequestFuture.get(RequestFuture.java:88)
            at org.projectbuendia.client.user.UserStore.syncKnownUsers(UserStore.java:105)
            at org.projectbuendia.client.user.UserStore.loadKnownUsers(UserStore.java:70)
            at org.projectbuendia.client.user.UserManager$LoadKnownUsersTask.doInBackground(UserManager.java:275)
            at org.projectbuendia.client.user.UserManager$LoadKnownUsersTask.doInBackground(UserManager.java:266)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: com.android.volley.VolleyError: Unknown resource: v1/projectbuendia/user
            at org.projectbuendia.client.net.OpenMrsServer$1.onErrorResponse(OpenMrsServer.java:110)
            at com.android.volley.Request.deliverError(Request.java:587)
            at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:101)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: com.android.volley.ServerError
            at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:161)
            at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:110)

As we can see, it seems the server rest api is not compatible with the current dev branch of the client. The app is requesting a resource there is not in the server side. Do I missing some setup step to run the app in the dev environment?

Change admission date concept.

Quoting @zestyping:

ping [8:29 AM]
Oh, also one of these days we should really switch from using "Date of Admission to Ebola Treatment Unit" (concept 162622) to just "Date of Admission" (concept 1640). Our patients are not all ebola patients! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.