Android Application, Client-Server communication - android

HeyHo,
which opportunities do I have to implement a client-server architecture for an android application. I simply want to transmit results from my database server to my application. I was researching on the internet and found different solutions but I ain't sure which one fits the best and is the simplest one:
- XML-RPC
- RESTlet
- REST + JSON
Maybe there is even a more simple way to do this and I haven't considered it yet.
Thanks for your helpful answers in advance
Cheers
Ei.Schinken

AFAIK, Rest+JSon is best option and simple to do and there are lot of references available for help.

Depends on yout server architecture, for example We have here a Mysql database with PHPmyadmin, so I'm using Json with PHP, and works fine for me.

Related

WCF - Oracle db - android

I'm trying to create a WCF (web service) in order to connect a oracle data base server and use it on a android app. Could someone tell me which language is the best in order to create a WCF? I know visual basic .Net is good for it. Is there other langague for it? And could someone show me a good tutorial in order to create this WCF? I don't want to create a ASMX, I think WCF is better.
Please Help!
Thanks in advance.
I'm not sure whether categorizing one vs. other as best is the right way to think about it. There is a ton of code out there written in both languages. Personally and because of my background - I use c# and all the .NET jobs I've had over the years have required c# knowledge and not VB.NET.
That being said - you can implement a WCF service in either language.
I'm sure you have investigated what WCF is. If not - you can start here: https://msdn.microsoft.com/en-us/library/ms731082(v=vs.110).aspx
The following tutorial should get you started:
http://www.tutorialspoint.com/wcf/
You will need a .NET library that allows you to connect to an Oracle Database. One that I've used is the Oracle Data Provider for .NET which is from Oracle.
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

How can I add chat to an Android app?

I have an android app, and I would like to allow my users to chat with each other.
Searching google, I found a tutorial on android socket programming, but it looks quite complicated and requires me to take care of the server side too.
Is there an easier solution that doesn't require me to basically write it all myself?
I would suggest using one of the free SDK like Scringo (www.scringo.com).
It is very easy to add - basically all you need is to call
Scringo.init(this);
at the end of your Activity's onCreate() method.
No need for server side programming at all.
Here's a screenshot of Scringo in action:
i would suggest using a WebView and using a node.js / now.js chat!
It's very simple to setup!
Another viable solution is to check xmpp protocol and asmack library . I gave it a try a while ago and managed to make it work with gtalk. You can also setup an xmpp server by yourself using their openfire server.
Still better than reinvent the wheel.

server javaEE technology

I want to build a server that communicates with an android phone
based on a request/response model
At first i thought i will use Httpservlets and communicate with the android
by Http messages. but i need to be able to access a pretty big object with every
request so i guess i cant really transfer the object to the servlet.
so i know this is a pretty newbish question but iv'e been searching for days
what kind of java EE tech should i use(i thought of EJB but as i understand they cant communicate with android)?
Thanks in advance
I think the right question is how to implement service layer for your android application:
Basically there are two options REST based web services and SOAP. Android's support for SOAP is inadequate and I personally prefer REST over soap any day. If you have decided to go with REST, your options in Java are Jersey, RESTlets or Spring Rest services. I will prefer Jersey, but you can also look in to Spring ( although not strictly complaint with the JSR).
(note: look in "SO" for comparison on various rest based frameworks in Java)

implement WebServices on Android

I have to integrate an existing javabased Framework (whith different components which communicate via SOAP) in my Android. Every Component needs to receive and send SOAP-Messages, needs to act as a Server.
Is it true that Android OS < 2.0 does not support Server functionalities? What would be the min. Version?
Which framework can i use? I only found a few kSOAP examples for the client side, but none for servers.
Thanks for every hint, link, idea... help:)
Fabi
You best bet would be to run e.g. jetty as a server on Android but I would seriously reconsider your architecture. Why do the devices need to act as server? Are they being contacted in a pull way by another device or server?
yeah you're right... reconsidering the architecture would be best. But i can't change the existing framework which comnponents i have to use.(yes, a pull way communication is implemented)
Thanks for your help. But i just decided to use the framework by implementing a polling-service. A lot of extra work... but it will do it:)
fabi

Accessing MySQL Directly from Android

I am currently developing an Android application. I want to be able to access MySQL from my website directory without needing to use JSON, SOAP or PHP in order to access MySQL. Is it possible to to import a MySQL connector into an android app.
Thanks for the help
You can use protoBufs instead by Google or use mySQL's connector example here but using the connector wouldn't be safe as #Shaun said in his answer. So it is possible.
Wow, I like how someone actually said its not possible. This is java we are working with isnt it? Its not easy is the answer. You can always take a java library already written for this in full out java, and rewrite it to work with android. The problem? Its not easy, thats why there is not a very well known library for it yet. Theres alot of connection issues, and security issues to think about when doing this from a phone. One, you dont have a dedicated stream of connection (meaning, your connectivity could drop at any moment) and your data could be corrupt, or, you query coudl have left out the LIMIT at the end you could whipe your database. Secondly, you have to worry about the security of your database. Phones are in no way the most secure devices out there, let alone android.
No this isn't possible. You'll require a web service front end.

Categories

Resources