Can I use custom java class library with ionic framework? - java

I am working with a Mobile Application project on ionic framework 3.19.0 with VS Code for Android platform. Where I want to execute few activities like download a apk file from web, checksum validation etc using custom Java Library prepared by other team.
I have searched a bit but not yet getting any suitable guideline or tutorial regarding these issues.
Is it possible to integrate Java Library with ionic and use it's class /function etc or is there other way exist?
Can anybody help ?
Edit:
There are few built in plug-in available for application version check and update (App Update, App Version) activities . Check here

You'll need to develop a cordova plugin if you want to interact with a native android library, can't be done directly through ionic.
https://cordova.apache.org/docs/en/latest/guide/platforms/android/plugin.html

Related

Is it possible to add Xamarin.forms code to an existing Native Android Studio Application as a library?

I have an existing Native Android Application - written in Java on Android Studio.
A client wanted to add some new features that were being developed by another team and a different company that they wanted to include in this Android App as well. The other team is completing the work as a Xamarin.Forms format as they are more comfortable writing in C#.
I have seen sources online for including native iOS and Android code in a Xamarin project. But haven't found any examples of integrating a Xamarin.Form into an existing Android application.
Was it possible to integrate Xamarin.forms into an Android Studio application? (Possibly as a library?)
Were there any good resources about the different options doing this?
There is currently no supported mechanism to create a library in C# using Xamarin.droid that can be called from java.

Using existing Java code with React Native

I'm pretty new to React Native and mobile development in general. But I have a simple Java library with junit tests and I want to do one of two things:
1) I want to convert this Java code to be used naturally with React Native for development on iOS and Android.
2) I want to use this java code to be used only with Android in a native-hybrid application.
I probably have a few gaps in my understanding of how all this works. I understand that Java is native for Android, and therefore is only used for Android development. React native bridges the cross-platform gap to decompile react native code into platform specific code.
If I wanted to use my Java code for development on iOS, does that happen through Native Modules? Is it possible to do regardless?
If it is only to be used on Android (which is fine), is using the setup described in the Native Modules section on React Native's website the way to go?
Thanks!
As far as I know, You cannot directly deploy code written by java to both Android and IOS in react-native. You can do it only for Android specific parts in react-native. If you want to use it as IOS compatible, you need to write a native module from IOS natives.
If u want to deploy your native Android module you can follow this https://hackernoon.com/first-experiences-with-react-native-bridging-an-android-native-module-for-app-authentication-501fec247b2b detailed example
If u want to create both android and IOS native modules u can follow this https://medium.com/#FizzyInTheHall/writing-a-react-native-bridge-library-bce5b90ea6d0 example

Can I use a Java library in an iOS app using Cordova?

I would like to use the Ionic or other cross-platform framework to build a mobile app. In this app I would like to use a Java library. From what I understand, I can use this Java library in my hybrid app if I write a Cordova wrapper for the library. But I have not been able to find a way to use the Java library on iOS. Is this possible?
You can't, iOS apps don't understand Java, even if you write a Cordova plugin. Is there no iOS alternative of the library you want to use?
Using Cordova you could build a plugin that uses the library you want to use on Android and use a different library on iOS. In your Ionic app, if the plugin is well written, you will be able to call the same function and the plugin will handle the rest.
Regarding this:
I've found that in android once you wirte a Cordova wrapper for the
library it can be used within the app even though I don't really
understand what it really means.
Cordova allows you to call native functions using JavaScript, so without Cordova you won't be able to use the Java library, but by building a plugin using Cordova you can. Here is a tutorial on how to create a Cordova plugin and here is another. I also recommend looking at existing Cordova plugins to see how it is done. If you share the library, we may also be able to help you create the plugin.
You can use Java code if you use Codename One's Cordova compatibility for portability.
Notice you can't use a binary jar "as is" but you can use Java source code which will work natively on iOS.

Phonegap - Add Java Library

I have a Phonegap app already created and deployed. I want to add an "external" Java library for handling mag-stripe data (mag data received from a mobile credit card swipe). How can I go about including this library so I may handle this data in my native app?
You have to develop a Cordova/Phonegap plugin that exposes a javascript API that interacts with the native library.
The documentation for creating a plugin is here:
Plugin Development Guide

Dropbox Sync API or Core API for pure Java

I want to if we could use the android sdk, which dropbox provides for Sync API, in a pure java project? if yes, how? what are the changes I need to make to an existing Android project using sync API in order to convert it to java project which would be used in a web app. If this is not possible kindly let me know if it is possible with Core API. Thanks.
I'm not sure if you could make the Android Sync API work, but the Core API does have a Java SDK:
https://www.dropbox.com/developers/core/sdk
https://www.dropbox.com/static/developers/dropbox-java-sdk-1.5.3-docs/index.html

Categories