MyOscar Integration with Cron like Syncronization Design

Since working on this project requires pulling data from a medical device and pushing that data to MyOscar. One barrier to overcome is the how many clients will be making concurrent request to MyOscar Personal Health Record System.
Could this pose a problem for the application developer that will maintain this system in the future?
As one of the research assistant in charge of designing this mobile integration software, I have to look far into the future. Some problems like size of data can cause a problem when storing heart beat data which comes in every second. I’ve implemented a solution to address that problem by persist the data in JSON format and storing it in sqlite. Here is an example:
{ 'Reading' : '[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]' ,
'theshold' : '[{'reading' : '0', 'over' : '20.0' },{'reading' : '1', 'over' : '20.0' },
{'reading' : '2', 'over' : '20.0' },{'reading' : '3', 'over' : '20.0' },
{'reading' : '4', 'over' : '20.0' },{'reading' : '5', 'over' : '20.0' },
{'reading' : '6', 'over' : '20.0' },{'reading' : '7', 'over' : '20.0' },
{'reading' : '8', 'over' : '20.0' },{'reading' : '9', 'over' : '20.0' }]'

Concurrent Request All Day on Client Phone

The next problem was concurrent request being sent from multiple phones multiple times a day will cause problems for the application and the user may incur expenses when heavy network usage is done all day. In light of that I’ve designed a system to synchronize MyOscar data at a 24 hour interval like a cron job in Linux. After doing some research on either implementing it from scratch or working on top of an already existing open source solution. I came across CWAC-Wakeful Service library. I’ve implemented an error message notification that will appear at the top when an error occurs on the clients phone when synchronization with MyOscar fails for the following reason:
  • No Network available
  • Web Service Error
  • Not Authenticated to MyOscar
  • Any Unknown error
Image
I am still in the process of implementing this solution but from what I gathered. When the phone is rebooted android will not remember unless I set a broadcast receiver to remember this service.Here is the XML required to make this happen.
<action android:name="android.intent.action.BOOT_COMPLETED" />

Here is a link if someone is trying to implement a similar solution:

In conclusion, data synchronized at a specific interval will be a solution for this project and the users using this software.
Till next time

Zak Hassan
/ Software Developer & Research Assistant – NexJExpress Team

/

Seneca Centre for Development of Open Technology, Research Department – Seneca College

Office: 416-4915050 ext. 3548


70 The Pond Road
Toronto, Ontario
M3J 3M6

http://cdot.senecacollege.ca/

“Time is the coin of life. Only you can determine how it will be spent.”

— Carl Sandburg

Working on HealthFirst MyOscar integration

After finishing with the graph plot of data generated

I am working on a new feature for Healthfirst. I am collecting and uploading medical metrics (heart beats) to myoscar web services. I worked on gathering medical data metrics such as:
– Heart beats per minute.
– Number of seconds that the heartbeat going over the threshold.
– Threshold set

I will be storing it in the “Other Health Trackers” category in myoscar. I have a prototype and I’m experiencing errors using the myoscar client.

Thanks,
Zak

Update On “HealthFirst”

Table Of Contents:

  1. Introduction
  2. Features
  3. Dependencies
  4. Conclusion

Introduction

Currently I’m working on HealthFirst which is a Heart Rate Monitoring and Weight Management Health care application in Android. I am using Robotium Unit Testing Framework which helps me build a solid application with the least amount of bugs. I am using GraphView to generate graphs for the UI. I am also using the Zypher Library to connect to the device.  I’m planning to use withings wireless weight scale but users will be required to register on withings website.

Features

  • Heart Rate Monitoring
  • Weight Management
  • Goal Management
  • Wireless bluetooth reading of Heart Rate Monitor and weight scale
  • Graphs for seeing progress of goal
  • Storing information in database on the mobile device
  • Syncing data with MyOscar personal health record system

Dependencies

  • graphview – Generating Graph UI library
  • HxMBT – Zypher library
  • Robutium – Testing

Problem

Users may want to login to this system with a username and password. If that is the case then I would need to design a way to create user account. I am trying to find a plan that would make automation possible but due to time constraints I will research to find out how long it will take before going into test implementation.

Conclusion

I am currently implementing my design and testing my code I will post another blog post with updates.

Thanks,

Zakeria Hassan

Software Developer | Research Assistant ,  CDOT – Seneca College

Twitter: @Prospect1010

“Empowerment of individuals is a key part of what makes open source work, since in the end, innovations tend to come from small groups, not from large, structured efforts.”
— Tim O’Reilly

HTML5 Support in Android and IOS?

 

 

 

  1. Introduction
  2. Why Do We Care?
  3. Android KitKat (4.4) – Latest version of android
  4. Fennec (Firefox for android)
  5. Android NDK
  6. Conclusion

 

 

 

 

 Introduction

 

Android is an open source mobile platform and has more then half of the market share for smart phones. Developing on android requires knowledge of Java but it is not a steep learning curve. Web developers may be interested in its new support for WebView based off of source code used in Chrome. There is a slight difference between android webviews and chrome browser and I will explain these details in the following blog post.

 

Android KitKat (4.4) – Latest version of android

 

Android KitKat is the latest version of the Android platform as of this writing (Dec. 5, 2013).  The main feature that will interest developers is the new chrome like WebView. Android Applications use webviews based on Chromium Code which includes common Javascript V8 and Blink rendering found in version 30 of Google Chrome on Android version 4.4.

 

Pro’s vs. Con’s

 

Cons:

Not the same as chrome because it doesn’t support:

        1) WebRTC

        2) WebGL 3D Canvas

        3) WebAudio

        4) Fullscreen API

        5) Form Validation

        6) Chrome Apps Platform

 

 

   

Pro:

Supports HTML5 better JavaScript run time, lets you do remote debugging using chrome developer tools.

Why do we care?

Support for HTML5 helps make using the web richer and will make developing apps easier. If WebRTC is fully supported then perhaps you could video chat with someone using our browser or android phone instead of downloading and installing third party files.

 

Fennec (Firefox on Android)

screenshot from https://play.google.com/store/apps/details?id=org.mozilla.firefox

 

 

I’m investigating if it is possible to ship a browser in an android application. In my search I came across Fennec which is the Firefox implementation of Android. Firefox is written in C++ and Fennec uses the same source code but also adds another layer of native Android code. Fennec is designed for smart phones, touch screen devices and UI utilizes a different XUL then what is found in Firefox for PC. Since it’s used on smart phones then they are limited in CPU, memory, etc. Fennec uses parallel processing to run on android.

 

 

Like most technology Fennec has dependencies and the dependencies are:

 

  1. Must download NDK for Android     
  2. Set the mozconfig environment variables for Fennec.
  3. Must download mozilla-central git repository (https://github.com/mozilla/mozilla-central)

   

How does NDK for android work?

 

Prerequisite: 

Must understand JNI to work with the NDK source code.

 

In a nutshell, NDK lets you create shared libraries that basically lets you embed a C/C++ application in your Android App. Works on Android 1.5 Platform or later however I think Fennec can only run on 1.6 and greater. Although its better practice to develop applications in native code, you can write an application in C++ and have a wrapper.

 

 

Can Firefox Run on IOS?

On Mozilla’s website it says that Fennec doesn’t run on IOS but after speaking with a developer at Mozilla I found out that someone has created a way to build Firefox on IOS.

 

Source code is located here:

http://hg.mozilla.org/users/tanya.meshkova_gmail.com/ios-patches/

 

Here is a screen shot of how it looks:

link to original page: https://imgur.com/r8Qti

 

 

 

Conclusion:

 

Perhaps by using Android NDK which is used by Firefox to embed C/C++ source files in your Android application, we could perhaps embed Firefox in an applications. Or even

better perhaps we could totally replace the need of using WebViews and use a XUL window to display the page you would like to view.