Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the standard way to use RPC in Android?

Tags:

android

rpc

What is the standard way to use RPC in Android? The official way to do RPC in Android seems for me AIDL. Is that correct?

First of all I am quite new to Android. But the start is good. I am warming up with the functions I already know from Java. Now I want to go further and use some advanced techniques with some of my already existing software in Java.

Here’s the scenario. I have a little Java server which runs an object orientated version of RPCs called SIMON. Now I want to combine it with Android. Means on an Android device I want to run a little app as client which gets its information from my server.

I read some instructions to program a client and a server for android. But both are running on android which I don’t want to.

Does anybody know how to combine RPC between Android and Java? Maybe some links or hints in which direction I can search should do the trick. Right now I am a little bit lost and combine these two worlds.

I have already came across REST, JSON, XML-RPC, SOAP who needs external libraries I don’t want to use. I want to stick with the standard way of Android to keep it “Original” Android. Whatever. The pure Android code is my goal in this stage.

like image 827
user1127690 Avatar asked Nov 13 '22 06:11

user1127690


1 Answers

As far as I know, there is no "standard" way to do RPC to a server from Android. The AIDL that you mention is for doing RPC to another process on the same device.

As you have found, there is a plethora of serialization formats and libraries supporting them for doing communication between an Android app and a server - so take your pick.

I have no proof of this, but I would guess that a very large majority of developers would use JSON over HTTPS, possibly REST, possibly not. But there's also nothing wrong with using Avro, gRPC, Protocol Buffers, Apache android-json-rpc, or anything else - use whatever works best for your situation.

like image 83
GreyBeardedGeek Avatar answered Nov 16 '22 03:11

GreyBeardedGeek