Can i use the api java 'jena' in flutter mobile application - java

I want to create application mobile with flutter but i need api java which is jena, so can we use library java.. In flutter if yes, so how?

You could use platform channels to communicate with native interfaces of your app, but looking at the library, that's probably not a good idea.
More drawbacks:
You have to implement native code twice, for Android (Java/Kotlin) and iOS (ObjC/Swift). That means an app depending on Apache Jena will only work on Android if you don't find a counterpart that works natively on iOS.
All communication through platform channels is asynchronous, which increases complexity.
When the API of the java library is complex, you end up duplicating a lot of code.
If your app heavily depends on Apache Jena, you have a few options:
Create a Backend Service in Java that does the processing which requires Apache Jena. Send the result to your Flutter client.
Write a native Android app that directly uses the library. Drop iOS.
Port the parts of Apache Jena that your app needs to Dart (probably too complex)

You would need a Flutter plugin that exposes the Jena API to your Dart code base over platform channels.
The bad news is that at least as of November 2018, no such Flutter plugin exists as yet.
The bottom line is that, yes, it's technically doable, but you would need to create the plugin yourself or motivate somebody to create it.

Related

Running Java on Flutter Web/Desktop

I was looking for a way to possibly use a java library of my own inside of my Flutter App.
I did some research but was only able to find information about how to integrate flutter with native Java libraries on Android exclusively.
Is there a way to call on java code also from Flutter Web and/or Flutter Desktop?
I am sorry I can't provide further information to this question as I was not able to find any "lead" if not starflut (https://pub.dev/packages/starflut) - which to the 'beginner' programmer I am in Flutter might seem an overkill approach to this problem - and I'm not even sure it supports Flutter Web/Desktop as of yet.
Any help, comments or ideas would be highly appreciated
EDIT 1
As implementing Java on Flutter Web seems close to impossible (or not worth the hassle), would calling C++ libraries from Flutter Web be a possibility?
EDIT 2
To better describe my problem/situation, I'll add some context.
I need to write a library that can be accessed by multiple flutter apps (both Web and possibly Mobile, but PWA would also be ok), but also by multiple programs which don't use the flutter framework.
I considered a couple of options, but I am still quite inexperienced and I am not sure which way to go forward with:
C++ as the core of the library, and making language bindings to Dart
It seems C++ code can work on mobile, but I haven't found a way it can be run on Web as well as within Flutter
JavaScript as the core of the library, and
either accessing the library directly from Flutter Web (seems to be possible https://medium.com/flutter-community/using-javascript-code-in-flutter-web-903de54a2000 )
Though I am not sure if this solution would work also on Mobile Flutter
Using Dart itself as the core of the library
this would be the quickest option when rolling out the Flutter App(s), but it would also have the drawback that I'll need to rewrite the library in another language later on
Calling c++ from flutter web is not possible. You can, however implement whatever functionality you want in the server-side using whatever language you want and expose the functionality to flutter using whatever web API you desire. You can follow the same approach with Java, and it doesn't have to be just web. The requirement though is that whatever you're implementing has to reside on the "server" which the system can run freely. Your flutter app just "connects" to it and sends and receives messages

Using a Hazelcast Client in Unity 5

I'm currently trying to synchronize an application running in the Unity Engine 5 with a jMonkey Java Engine using Hazelcast. Therefore I wanted to use a C# Client, which Hazelcast provides and integrate it into Unity. But it is built in .NET 4.0, which Unity doesn't support. The jMonkey/Java side is not the great deal, but i somehow need to connect my Unity Application with the Hazelcast Cluster. Does anyone know a solution for that? Or is it possible to use the Hazelcast.DLL in Unity although the limitations of Unitys .NET Version?
Not sure if the Hazelcast C# client is buildable on Mono (which is required for Unity) but you can get the sourcecode and try. If you have to do smaller changes to make it compile, we're always happy to see pull requests dropping in on github :)
https://github.com/hazelcast/hazelcast-csharp-client

Android Client and Google App Engine APIs

Am I confused as to what is possible between an Android Client and Google App Engine? I would like to be able to create a Python API that would handle requests between GAE services such as Datastore, and an Android Client.
I have found some examples that detail how to make a call from within an Android Client, but it doesn't seem to outline whether or not you can pass data to any specific API language. The question I have is whether or not it is possible to use a Python API deployed on GAE and making calls through Google End Points, or would I have to use Java Servlets to handle requests?
Yes, you can use Python to do what you want.
Google designs their services (such as GAE and endpoints) to be language agnostic, e.g. using JSON to serialize objects.
There are a few advantages to using Java on both, such as being able to share code between client and service projects, but Google does not promote such dependencies at all - you will have no problem using Python instead.

Java vs native coding in Android Application development

I plan to create an SDK (involving huge data manipulations), which can used to create applications on Android.
I plan to develop the complete SDK, including the libraries in Java, for the reason that if I implement my libraries in the native language(C++) the data movement between the Java and the native layer will involve memory copies and will make my application look slow.
I plan to port the same SDK later to other platforms like Windows Mobile. I am a bit confused on the better approach to code in such cases, keeping in mind the portability and performance of the SDK.
Inputs will be greatly appreciated.
Windows Mobile supports native code (Visual C++, see Getting Started in Developing Applications for Windows Mobile) so using the Android NDK would be a good option. At least you wouldn't have to write the whole thing from scratch. You could have the common code base written in C/C++ and only write the Java wrappers for Android.
As you know, Windows Phone 7 (the successor to Windows Mobile) uses C# and whatever approach you take on Android, you'd need to rewrite the SDK from scratch anyway. Windows Phone 7.x might be supporting native code (C/C++) sometime in the future but not anytime soon.

java library vs android library

what are the differences between Java library and android library and what advantages/disadvantages has each?
You can include standard Java .jar file libraries in an Android app. They are translated into Dalvik format at .apk build time.
There is an Android Library system which allows the use of shared resources such as layouts and localized strings. As that has more restrictions that regular Java libraries I'd only recommend this method if you actually need to share resources.
http://developer.android.com/guide/developing/projects/projects-eclipse.html
I imagine you meant the android API (or SDK, I can't say) and java API (or SDK). Basically, android is based on java. It is a subset of it, but also adds specific classes and methods to interact with the hardware and the android OS, implement UI, etc.
You can find info about the android architecture here: http://developer.android.com/guide/basics/what-is-android.html
Concerning advantages/disadvantages, well, if you're developing for the android operating system, then is a great advantage to use the android API. If you're developing for PCs, then part of the android API won't be supported, which is what I would call a disadvantage...
In sum, you need to choose whether to use the andoid API or not depending on what will you be coding: will the API be supported by the OS? Is there a JVM for it?
It is very important to know that serialization of classes shared between the two is supported. But they must be located in a package with the same name in both projects.

Categories

Resources