Android 3 calling WCF REST - android

I'd like to create a RESTful WCF service and then call it from an Android 3.2 or 4.0 app. I have this sample here, but it dates back to May 2010. I'd like to know if that is still the best way of doing this?
The WCF part is OK, I can handle it (since I'm a .NET guy), but I'm looking for the best (both performance and security) way of calling the service.
If you have any links, samples or even books to suggest, I'd be more than happy.

Have a look at this https://sites.google.com/site/androidosbeginning/cosuming-restful-webservice-in-android

As long as you can get the WSDL from the WCF service, you should be able to interact with it using something like AXIS for Java and use wsdl2java to generate the client stub to interact with the service... though AXIS is relatively heavy to use on Android devices. I've never done anything like that with Android, but that's how it's done with Java. Perhaps there are some lighter-weight libraries you can use.
Here's a similar post: How to Consume WCF Service with Android

Related

Android-RESTful Services

I have started working on a university project. I have to test various REST frameworks for Android and see which one is the most efficient/stable currently.
Which are most popular REST frameworks currently for Android? I have heard about Spring.
Secondly, how do you create a RESTful service for Android?
There a number of REST libraries that do more or less for you. Arguably, the most popular for Android are Retrofit (https://github.com/square/retrofit) and my personal favourite RoboSpice (https://github.com/stephanenicolas/robospice) for two simple reasons: runs as a service and works alongside Activity lifecycle.
Answering which one is the best would start a flame war.
Keep in mind that ANY library that can do a HTTP request with POST and GET can be "weaponised" as RESTful library, it's only a matter of how much boilerplate you want to write on your own and how much control over each aspect you require.

It might sound silly but why using frameworks like jersey in REST webservices in android?

I am very new to android and webservices.At first I saw only aynctask with http methods to retreive data from databases.I thought anything with http methods are rest.Now Iam seeing frameworks like jersey to do REST based webservices.What is the purpose of these frameworks?.Cant we do rest webservice in basic level?
PS:Sorry if question is too blunder.
Of course you can. The framework is doing it as well under the hood. If you feel the framework helps you to achieve your goals faster and with cleaner code use it, otherwise don't. Typically, frameworks support more advanced features like object marshalling, caching or asynchronous calls and can help with error handling.

Web Service Example - both Android and Server portions

I am looking to create a simple service to learn calling a service from android.
What I want to do is an app to call a system over the web provide some parameters and the system respond. Very simple (hopefully)
But I want to build both ends.. not just the android end.
What tools would the community recommend that are industry standard and hopefully easily accessible.
I am hoping TomCat can do the hosting, but don't know if this should be a JSP or EE application.
Can anyone point me to an email of setting this up, again with both sides.
Hopefully Tomcat is a decent enough server to be both easy to setup and robust enough if enough calls are made to it.
Once that is done then I only need to do the android portion with Ksoap or anything else that is recommended.
Thanks in advance and I hope this is not too general a question.
I recommend using Apache CXF for a server. It does pretty much everything that you need in a web service. It does have a client part, but so far, I have implemented web services on Android myself, rather than using libraries. But that was a while ago, maybe today libs are better customized for Android.

Architecture for webservices and android

I'm going to develope an application based on web services (axis2) and android (clients).
I'm now planning the logic architecture for my system and I supose that it should be like a SOA architecture. I have seen that a SOA architecture is based on layers.
So, this would be a "correct" logic architecture for my application? (with some changes of course)
http://geeks.ms/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/unai/DDD_5F00_NLAYER_5F00_ARCHITECTURE_5F00_SMALL_5F00_6ADA95E1.png
Android code (activities) would be on Presentation Layer?
EDIT
April 2014
Now, 3 years later with some more experience... REST is the best :)
Warning, it may that this answer is not at all an answer to you question but anyway, here is my thoughts.
I'm definitely not a SOA specialist but since SOA can be implemented with REST, it should not have any consequences on a SOA architecture. Android is REST-ready (see that Google IO 2010 session on REST) and there is only little SOAP support on android (afaik, but I may be wrong).
At some point, you'll have to evaluate the feasibility of the interop. between your Axis WS-* with any existing android SOAP support (the well-known ksoap2 project for example). The result could be not without impact on your architecture design.
The point here is: if you do use Rampart to use WS-Security, for example, on top of Axis2, it seems to me there are little chances that ksoap may interact at all (technically) with your service provider. On the one hand, if the service is simple and can be bound with ksoap2, great, go on. On the other hand, if you would use a not so simple security or authentication scheme, it could just be a nightmare to get the things done with the simple SOAP support on android. In the latest case and as the REST approach seems to be the preferred philosophy on android, you may be confronted to the decision to have a REST proxy dedicated to android between your Axis2 business WS and the android client-side application.
In the hope it may be of any help.
Perhaps you could even try SOAP. Android supports SOAP web services and provides ksoap2 libraries which you can use for sending request and getting response from your server easily.
For starters just check this out. Now, the latest version of ksoap also supports passing of Object Arrays.
For more information of ksoap2, I suggest to read this
Cheers
All the best

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)

Categories

Resources