Im trying to make ktor server running inside an An...
# ktor
a
Im trying to make ktor server running inside an Android App. The Problem is i also need to provide ssl. I generated a self signed certificate with .jks I could not generate it from android and i cant load it from android assets. It seems like Android is not supporting jks. Is there another self signed certificate Type supported by ktor ?
j
is it mandatory communication through android? dont you have a different way to work to place a different architecture?
in a regular arch Im setting an Nginx to handle SSL certs
a
Our requiremt is to serve a rest enpoint someone can call to Trigger calls to an Android App and get a response
So another solution we thought of to run the Server not on Android but as a Middleware which communicates with the App via websockets
@Jorge R u think nginx would Help in my case?
j
trigger calls to android app
that looks like going completely the other way around how the regular arch works for Android as a frontend
what I have: (Android) Users -> Nginx -> Ktor backend
Android has many peculiarities and restrictions coming from the platform itself
so this could be a deal breaker for you, as it is not intended to be use mainly as a server
a
Ah no my case Android should be the Server ^^
It can all run in the same wifi
j
what would the server do?
because if you want Android as a server, it may be just server UI
and delegate everything to Ktor
you really need an android device to host everything?
would it be possible for you to setup another device with Ktor?
a
I need to have a rest enpoint which calls my Android app
j
so I guess you need android to do something for you
a
Yes that was my first approach to make a ktor Server and communicate with Android via websockets
But i try to find out If i could do the Server directly on android
Without a Middleware
But self signed tls seems to be the Tricky Part to Set up
j
the main problem here is the environment where you will be running your server (Android)
a
Exactly
j
so, i would say fight against the monster (I would not recommend) or try to find a different approach
I’ve been doing projects in Android where I wanted Android as a dedicated device
a
Yeah lets see, If i find sth i can report it here
j
and I can tell you it is not designed for certain tasks
can the task that android have to do being done in other platform (linux, etc)?
v
@Adriano Celentano sorry if I misunderstood, but based on the requirements you mentioned - can't you take advantage of push notifications? That would allow you to send messages from the "outside" to an android device without having to run a dedicated server in your app
a
Yeah was my first solution as well. But i didnt know i also have to communicate back + the api is fixed so i would also need map the incoming request to a push request on firebase or similar
j
also keep in mind that push notif are not 100% guaranteed to arrive
a
We made it work by using a bks certificate :-)
👍 2