Embed a server within Android or iOS app that uses Python - android

I have a python library that I want to use for the core logic of an Android and iOS app. One solution would be to put the python logic into a server and interact with my app through HTTP. If the server is remote though, the user will have to remain online to use the app. Is there anyway I can embed a HTTP server within the apps so that the user doesn't have to be online?

Related

How to deploy DL model to the cloud and run it on Android app?

I am working on a deep learning android app. I have trained and tested the model and everything is complete in that area. Now I have to deploy it on the cloud.
If a user used the app their data is sent to the model which resides on the cloud and the result are sent back to the user's mobile app and displayed. The reason the model is deployed on the cloud is because it is to be an "online learning system".
What I don't understand now is how do I connect the android app user interface (developed in android studio) and the model.
Should I use Kafka or anything like that? If yes, what steps do I need to follow to deploy my jupyter notebook to the cloud and then connect the whole system to the android app user interface.
You wouldn't use Jupyter. You'd embed your model in a web server and interact with it like any other HTTP service from your mobile app
Kafka alone isn't an HTTP service and doesn't host ML models; it would need to be paired with other tooling. KSQL, for example, does have a REST endpoint. Example - https://github.com/kaiwaehner/ksql-machine-learning-udf

best way to connect android app with desktop app?

I want to develop a system in which data is being shared between DESKTOP app and Android app.
After searching I have found that I need a server in between them. But I can't figure out what the server is? How do I create it? And how will it help me connect my two platform devices?
Desktop App will receive data from android app. And manage data. It will also be used to send notifications/messages to android apps.
Android App will be used to input data and send it to desktop app. It will receive updates/notifications from desktop app.
Now how do I connect these two? I basically need a common database for real-time data sharing and notifications.
Edit: I am building the desktop app using C# and android app using Java.
Edit2: Maybe I can host the database on CPANEL or 000webhost using PHP. And then connect it with both android and C#. Is this the correct way to do it? Is it possible to connect it with C#? I know it can be connected with Android, not sure about C#.
You don't necessarily need a database. You need a common network protocol between two applications.
All network communication is done via sockets. You need a library that allows you send data over sockets. For example, here's an Android guide that is about sockets.
A socket binds to a specific port of a computer, essentially making it a "server". Much like how web servers all expose port 80, and communicate over a protocol called HTTP. Which is important because it is up to you to decide what protocol your applications communicate between each other, because the socket just sends bytes - it doesn't care what you send or how, as long as it travels to a port on a particular server. It also won't parse the data for you, that's up to your application to handle. For example, how would your desktop app know the Android device sent it a text message, or some image to be displayed, or an address to show a map?
All in all, your reason for wanting a desktop application rather than a web application is not entirely clear. Parsing only the body of HTTP payloads from different HTTP paths that are mapped to different methods (which is typically referred to as a REST API) is much simpler than building your own protocol. You might as well build a desktop GUI over top of a web server.
Making the desktop app send updates back to your mobile application is basically impossible using a bi-directional socket architecture. Your Android should not be running an open server socket continuously just for your application, mostly because battery drain, but because its network address is subject to change frequently, and you therefore additionally need a registration server from which your device would reconnect to. Such a service exists as Firebase Cloud Messaging, which is a rebranding of the GCM technology made by Google, and it can be used to send push notifications to devices, but only with small data payloads.
See here about what activities occur on an Android device for notifications. How does push notification technology work on Android?
Back to the question about databases. Suggesting one to use is too broad. And you only need one of those if you want to store and/or query or join datasets. The same computer running the desktop app can install and run whatever flavor of database you prefer, whether it's a relational database or noSQL database, entirely up to you. The only realtime databases I know of are RethinkDB and Firebase.
You could also just hold a SQLite file which is as good as a small scale database (even the SQLite documentation recommends it for low traffic web sites).
Firebase supports web interface, so you can develop html code and integrate in desktop app, something like web integration in windows form application

Cordova Local Storage Sync with Server

I have a hybrid app where I use a backend server on the cloud using mongodb and nodejs. I feed my frontend web app and android app using http post and get request.
I was wondering if there is a best way to save the data (from server to android or vise versa) and sync them together. Much like how Trello does their android app.
As far as i know local Storage is not a safe storage, as it can be cleaned as needed by the phone.
I recommend using sqlite for the mobile side.
for quick communication with server, i recommend using sockets (i used it for my chat app)

How to wrap a responsive web app that uses ADFS auth into a native iOS/Android app using only bluemix services?

The following idea is in our heads and we did not find out how to realize it.
We have a responsive web application that is based on a domino server using xpages. The service authenticates using SAML against our adfs 2.0 service.
We want to use native mobile apps to improve the mobile web app it two disciplines:
1. use notifications to alert users about tasks and events
2. Store the password in a secure way on the device so it won't be asked every time you use the app.
The web app stays on that domino server and is used as is.
I thought this should be possible using only bluemix services.
But how?
We do not want to develop native apps by ourselves so apache Cordova came in our minds. That or a similar solution should enable us to provide native mobile apps with in app stored passwords (or tokens or even touchID logon) and mobile notifications.
Which is the best bluemix practice?
Bernd,
you have a rather large set of technology moving parts here :-). Let me pick them into pieces:
Domino: you need something outside of Bluemix for storing the NSF, like a Softlayer Domino server. That will be key to the solution.
mobile app: Cordova is right, but look one step further and have a look at Ionic. It uses Cordova under the hood. You can add it to your app as is, or use IBM Mobile first foundation
Push notifications: there's a service for it in Bluemix
Authentication: there's a service for it
What I would do:
on the Domino server holding the NSFs deploy a OSGi plugin you write extending Domino Access Services that reads/writes the data you are interested in JSON. Use the OpenNTF Domino Api (ODA) to make your life easier
configure the server to only talk to Bluemix. I would use VPN technology for that - Bluemix has a service for that
Now the fun part: configure Domino to accept the WAS headers for user identity. Securing Domino in the step before is ESSENTIAL since hitting it direct would now allow to spoof identity. This is why ONLY your Bluemix VPN shall hit it
Now build your app layer in Bluemix using Liberty or Node.js (I would use Node.js since passport, a Node module, has the most authentication options) that handles auth using the Bluemix services and sets the header when talking to Domino
Make sure you use a web worker in your mobile app to take the network out of the user experience
That's roughly it. Hope it helps

Communication between website and android app

I want to build a website, where the data will be saved in a data base, logical in a sql database. Also, I want to build an android app, which will take the data from the above (sql) data base. How can I achieve it? I mean how can I manage the communication between the website and the android app. In past, I have create website with php and sql and also I have build android apps, but now I want to achieve the communication between them. Can I use parse platform?
FYI, without any server communication you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them.
yeah unfortunately chrome won't let webapps use local storage on android. what you can do is create a local server (using org.apache.http package for example), let it run as a background android service, then have the website make requests to that url. Its considered hacky, but it would work. You can post whatever data you wanted the website to know about , and then get it from the website.

Categories

Resources