Python Java Integration - java

I'm developing a program completely written in Python but I need to integrate a Java code inside the file console.py.
I want to integrate Sphinx4's program to give GNS3 the capability of voice recognition.
Is it possible? What do I need to do this?

Related

Using Python code in Java on App Engine

Can I use Python code in Java on App Engine? What I mean is I am using Java to develop my App Engine cloud, but I need to include some Python code in it. How might I do that?
Why?
I need to Generate Dynamic Content using Jinja2. There is no equivalent in Java. So I was hoping to be able to just do it in Python and include it in my Java code.
No you can't run Python code if you are using Java, or vise versa, since App Engine is running in a sandbox and you are not allowed to run anything else other than Java in your case.

how to write an Android app in Java which needs to use a Python library?

I want to develop an app to track people's Whatsapp last seen and other stuff, and found out that there are APIs out there to deal with it, but the thing is they are writen in python and are normally run in Linux I think
I have Java and Android knowledge but not python, and wonder if there's a way to develop the most of the app in Java and get the info I want via calls using these python APIs, but without having to install a python interpreter or similar on the device, so the final user just has to download and run the Android app as he would do with any other
I want to know if it would be very hard for someone inexperienced as me (this is the 2nd and final year of my developing grade), for it's what I have in mind for the final project, thx in advance
Instead of running it as one app, what about running the python script as separate from the original script? I believe it would bee possible, as android is in fact a UNIX based OS. Any readers could give their input on this idea an if it would work.

Android: Calling python code from java project

I need to call a relatively simple piece of python code (no dependencies) from my java-project for android. I have heard that it is possible to use python via Kivy. Would that be possible?
Kivy cannot be easily integrated in an existing Java app, Kivy (the android part) have already a integrated Java application. Python is the main part, and you can execute Java code from Python using Pyjnius. Or write direct Java code.
You want the inverse, which is not something we are targeting.
I suggest you to check android-python27 project instead.

Execute python script from my java android app

I have an app in mind that will run various python scrpits.
But I have a problem running python scripts from my java code. I tried to use QPython, but I will have to start new intent to run my python code. That's not a problem but I have to close QPython intent manually to receive console output back to my app. That's not go. Also I looked at sl4a and its fork android scripting but I didn't find any examples of how can I do such a thing from my JAVA code. Thanks.
Try https://chaquo.com/chaquopy/
It does exactly what you need but their licensing process is very unfriendly.
I have the same issue and I'm still unable to find another solution, although because of the licensing, I'm not going to use it.
As an idea I'm thinking of making a service completely in python using kivy and all the rest in java, but I can't yet find an example.
There is a sampleproject which shows how to execute python scripts on your android devices.
https://github.com/qpython-android/AndroidApp-with-qpython-API

How to run matlab script from java (for android) using matlabcontol.jar

I am trying to call up a user defined matlab function(.m file) from java android application which is developed in Eclipse using matlabcontrol.jar.
Actually, It works well when I use it in the java project.
But I wonder is it possible to use it when I develop android application.
The problem is When I use matlabcontrol.jar for java project, it pops up and runs matlab application(like R2009b matlab) automatically, even though I don't want to use it. then run and print result on the matlab console also.
Then, I think, if someone who didn't install matlab application in their computer or smartphone can't use application which is included matlab code.
So, I just want to run matlab code on java program(for android), not using matlab application. Give me option or alternative way to work out please?
Please help.
Thanks.
matlabcontrol just gives you a way to call a running copy of MATLAB from Java. If you have some MATLAB code that you want to run on an Android device, this is not going to work for you, as there is no version of MATLAB that will run on Android.
If you have MATLAB code that you'd like to run as part of an Android application, you have two real choices:
i) Use MATLAB Coder to convert the MATLAB algorithm to C code, that can be compiled, called from Java, and included in your app to run on the device. You'll need to ensure that your MATLAB algorithm falls within the subset of the MATLAB language that is supported by MATLAB Coder, but that usually isn't a big issue. MathWorks have a recorded webinar with a worked example of how to do this (it's Objective C on iPhone rather than Java on Android, but the principles are the same). It's called something like "MATLAB to iPhone made easy", if you want to look it up. Here's the link to it.
ii) Use either MATLAB Builder NE for .NET, or MATLAB Builder JA for Java to deploy your MATLAB algorithm as a web service, and have your Android application call that web service.
PS MATLAB Mobile is not a relevant option here - it is a tool for connecting to a MATLAB session on your machine or in the cloud, and interactively running MATLAB code. It does not give you a way of running MATLAB code on the device itself.

Categories

Resources