2

I'm working on an android application which need to generate descriptive statistics ( mean, sd, min max, quartiles) and CDF / PDF histogram plots from local SQLite DB data.

R is very good with doing such statistical analysis and was wondering if it is possible to call R from Java in Android application ?

If it is not possible to call R from Java in Android , what would be a recommend approach ( package) for such statistical analysis in Android applications ?

Need to have this running w/o connectivity, so a server/cloud approach doesn't work.

user3206440
  • 4,749
  • 15
  • 75
  • 132
  • What have you tried? "R" in the Android world has an entirely different meaning to what you are describing... there are many great (and free) graphing tools. – Quintin Balsdon Jun 21 '15 at 17:03
  • use a service approach like www.opencpu.org – Jeroen Ooms Jun 21 '15 at 17:23
  • @QuintinBalsdon - what do you mean by entirely different meaning ? What I'm looking for is a [JRI](https://www.rforge.net/JRI) like approach to call R from android code. Plotting is a different issue - I'm aware of charting libraries - sorry , the question is not about plotting, but using R from android application java code. – user3206440 Jun 23 '15 at 04:21
  • In Android, UI files are created in an XML file and precompiled into a file called R.java (R is for Resources) - and this is how developers can refer to XML UI elements from Java code. So any internet search for 'R' and Android is going to be difficult - can you provide the link to your R so we can see what it is? – Quintin Balsdon Jun 23 '15 at 08:04
  • This SO question should give an idea - [R from within Java](http://stackoverflow.com/questions/2180235/r-from-within-java). Official R page is here - [R: The R Project for Statistical Computing](http://www.r-project.org) . In case R is not possible to be used in an android app or it doesn't make sense, what stat package is preferred to by used in android applications. – user3206440 Jun 24 '15 at 00:59

1 Answers1

1

I am not sure if it's possible to run R exactly in android. But there is special project (server) - https://rforge.net/Rserve/

You run this server on special port and connect to this port with TCP from java code (it can be local machine or remote machine).

I think you can try to run R locally (have no idea how at this moment) on android device and connect to localhost from your code.

First link which I found in google - http://www.r-bloggers.com/install-r-in-android-via-gnuroot-no-root-required/ Never tried.

pkozlov
  • 746
  • 5
  • 17