FHIR Validation in Android - android

I have a project in which I have to perform a a FHIR validation. I have implemented this functionality in a regular Java application using the hapi-fhir library with the Instance Validator and Schematron Validator. I am trying to do the same for android but I have concluded that hapi-fhir using a caching library (caffeine) which is not supported in android.
Is there any way I can implement this? Maybe bypass caffeine caching or something I can't think of?
Any suggestions can be very helpful!!

My advice would definitely be to offload any StructureDefinition (i.e profile) validation to a server, e.g. by calling the $validate operation.
FHIR's native validation capabilities are really powerful, but they are by their nature very compute-intensive which is always going to be problematic on a mobile device.
For what it's worth, the approach I've seen people take generally is to hand-roll any validation rules on the device that are required for a good UI experience (e.g. mandatory fields and that kind of thing) but then to defer the complex structuredefinition rules until the data hits a server.

Related

How to invoke a call to a URL from an Andorid app?

Disclaimer. I'm asking this on someone else's behalf and given that I know as much about Android development as penguins about flight, it may be clumsy. In such case, let me know and I'll remove it or try to reformulate.
I've created a web service that's reachable at the URL on the following form.
http://server/Blopp.svc/Store/value1/value2
The back-end part I've got covered but I'm worried about the front-end development. I've got a colleague that's making the app and he's got the rudimentary GUI done. However, in order not to do a lot of convoluted coding, he's heard that there's a certain library for making such URL calls.
What's the name of it? Is there certain other aspects to take into consideration or is there an (almost) standard one that everybody uses?
Please not that the app's functionality is at the moment limited to providing the web service with data. All the logic and presentation is done on the website and not inside the app.
I've never built up an Android app, so I'm asking for understanding if this is a dumb formulation. I just want to help my co-worker and he seemed to struggle with the details.
Is there perhaps a smoother way to make the call to a web service if I substitute the patter of the URL to use query strings? Any other approach that makes it easier for an Android developer? I'm not familiar with the area but I want to make things easy for my team-mate.
There are quite a few different HTTP libraries available and it would really depend on your specific requirements which one you used (if any - you can roll your own HTTP requests using HttpURLConnection) Two of the more popular ones are:
Volley
http://developer.android.com/training/volley/index.html
Written by one of the guys on the Google Play team and part of the AOSP. Very flexible and easy to use however I would hesitate to recommend it as it relies on the now deprecated Apache Http classes in its public API.
Retrofit
http://square.github.io/retrofit/
From Square. Version 2 is currently in late stages of beta. It allows you to define your API as an interface. It has dependancies on their OkHttp library as well. Very fast and also has RxJava support baked in.

Alternative to core data in android?

I am building a social media application which requires local storage of table data entities. This data must also be connected to a server to retrieve and update information to and from users. Our team has built an iOS client using core data, though we are looking for storage options in android. Is using SQLite the way to go? Any thoughts would be greatly appreciated.
You should take a look at Realm, it has clients for Objective-C, Swift and Android.
Description from their GitHub repository:
Features
Mobile-first: Realm is the first database built from the ground up to run directly inside phones, tablets and wearables.
Simple: Data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Plus, we've worked hard to keep our API down to very few classes: most of our users pick it up intuitively, getting simple apps up & running in minutes.
Modern: Realm supports easy thread-safety, relationships & encryption.
Fast: Realm is faster than even raw SQLite on common operations, while maintaining an extremely rich feature set.
If you're familiar with RxJava, you will probably want to check SQLBrite, wich is Square's solution for this.
Yes, Sqlite is a default storage solution for android. Howevere there is a wrap around it called ContentProvider. ContentProvider can be used with Loaders and provide async data loading. ContentProvider may be used to modify contats and merge accounts, see this guide. However ContentProvider may seem tricky and if you prefer ORMs you can use ORMLite or GreenDAO which are using sqlite as well.

cross platform syncing solution with offline and relationship support

I am relatively new to app development and core data, so take it easy on me. I have been working on an app (currently for iOS, android in the future too) which stores the user's data locally using core data.
The data has relationships across entities. User can create, update, delete data.
Now I need to integrate some kind of syncing solution. My requirements are:
Data should be accessible offline (right now I am testing queue operations for that)
Data should sync to cloud storage when network is available (on iOS I have tested out reachability for this)
Cloud storage needs to be integrateble to both my current iOS and future android version.
Relationships (or some other way of linking parent-child, i talk about it later) need to be maintained.
Core data on ios should be used, not third party replacement.
I have messed around with many solutions so far:
I setup my own rethinkdb database on a server and used PHP and REST to get things going. This was very messy.
I tested parse.com and afnetworking http requests (instead of parse's library) - this was better, but i couldn't seem to be able to manage the relationships from core data. And my syncing algorithm is complicated (it works but I am not sure if there are holes in it when it may fail)
I tested dropbox datastore api. I have only tested the iOS sample app they provide, seemed pretty good (still need to understand the workings).
My questions are:
If I were to use dropbox datastore api, how does it work with android? of course core data is not available there, so how does that work (sorry I don't have android dev experience yet)? ALso how does it handle relationships between entities?
If I go with Parse.com, do you think my this idea will work-
Instead of using relationships, I can use identifiers? my relationships are all 1-to-many, so on the parent (1) I can have an id A. On all the children I can point their parentid to A. Also since my children can have grandchildren too, on each of the children I can have another id which the grandchildren can point to. So on... does this make sense as a replacement of relationships? If yes, then what's the point of relationships in xcode?? other than having automatic cascade option maybe.
Are there any better solutions available for syncing cross platform?
I know my question may seem a bit asking for opinion, but I would like to see what everyone else has already tried. Past week of switching from one solution to another and designing the syncing algorithm has fried my brain.
(I work at Dropbox and will address just that part of the question.)
The Dropbox Datastore API doesn't use core data and thus works exactly the same way on Android. Why is core data a requirement?
As to relationships, what you describe for Parse is exactly what I would suggest for use with the Datastore API. I believe you're right that the reason for modeling relationships in databases and in code is to get automatic cascading operations and enforcement of relationship invariants.

When one should use "spring for android"?

I came across spring for android, which claims to provide Spring Framework that aims to simplify the development of native Android applications.
If anyone has already used or explored this framework, please share your thoughts about the scenarios or situations where this can be beneficial over standard android framework (which is somewhat like MVVM).
To sum up, I am looking for additional benefits provided by this framework.
I investigated spring for android and my analysis is :
It Does not provide Inversion of control. Provide popular spring tools like RestTemplate, Social Integration for Android .
Spring provides parsing framework as well, thought not as efficient as jackson.
more yet to be added, keep your finger crossed.
this means whenever you want a ready made solution for RESTor Social Integration(fb/twitter) along with a parser with normal capability, spring for android might be a right choice for you.
if someone will post more accurate answer, i will surely accept that.

Network traffic monitoring per android application

I was wondering if I can do network traffic monitoring per android application?
Basically see which app is receiving/sending how much data?
I know there are many apps which already do that but I want to know how to do it.
Well you surely can. A very simple way is to use the TrafficStats class. It can manage per app (more formally, per UID) But the problem is, it can return UNSUPPORTED. When this happens, I don't think you will have some easy (i.e. using the high level Java language) method to get the network traffic data you need.
Not sure if it can be implemented in Java as I imagine you need to access some low-level Operating system functions which are just not available in Java (but don't quote me on this!).
The obvious way I see of doing this is through C language and the Android Native Development Kit.

Categories

Resources