Soap Client on Android to access Salesforce APIs - android

I want to develop a application on Android platform to connect to salesforce. From what i have found salesforce provides service API's which can be used to connect to salesforce servers by creating a Web service from the client side application.
Salesforce developer site has examples of creating such a Web service by using Apache Axis as the SOAP client and using the WSDL file downloaded from the salesforce website. I want to know can this be done from Android platform?
Is there a version of Apache Axis ported for Android? I did some googling and could find that Android does not have a inbuilt SOAP client and usually Ksoap is used on Android.
But I have also read that KSOAP doesnt support WSDL.
I have seen the above question asked before but quite a while ago, As Android platform has emerged eversince I want to know what is the current situation and options of doing this.
Also, Since I am new to Android and development on Android if anyone can direct me to a sample code snippet, which creates a Web Service from android to connect to salesforce, I would be higly grateful.
Thanks in Advance.
Edit: Is there any other way to develop an Salesforce client on Android without the above approach? I am running out of ideas :(

Not really an answer, but...
There will be a webinar about REST API for Salesforce soon. With pure HTTP and JSON you might be able to avoid SOAP problems :)
It's a "developer preview", meaning that probably this functionality will be officially released this autumn/winter.
https://www.developerforce.com/events/rest_developer_preview/registration.php?d=70130000000FV4P

At the end of they day, SOAP is just XML over HTTP, Android (at least 2.1 and up, not sure about earlier versions) have built in XML parsers and serializers, so you could manually build/parser the relevant soap messages that you care about (this is probably not a big deal if you only need to make a few different types of calls, but will be a chunk of work to do them all). Depending on your timeframe, you could wait for the REST API, which'll let you do json instead of XML. (this is currently in pilot)

Related

developing an android application with servlet

I'm currently developing an android application. My application allows users to choose a picture from a gallery, add a comment and send it to the server. The server then saves it in database.
Currently I'm using HttpUrlConnection at client side and Dynamic Web Project with a servlet to process on server (I'm using eclipse with Apache Tomcat)
So the questions are:
Is it a proper use of this technology to develop my app. (does it violate any rules? Sorry I'm a newbie)
Does this technology affect anything if i want to expand my app?
Are there any better technologies to use in this situation and is it worth to use it?
No I think it is a better way to develop this. I have also develop a chat based app usign the same technologies.
It doesn't violate any rules. There are many apps in the market usign the same technologies.
Q-3.Are there any better technologies to use in this situation and is it worth to use it?
You can also use php or any other server side scripting language to do the same.
Because when you want to host your java app you may find difficulty for java hosting but for php and asp you can easily find hosting services.
I answer in order:
1- the client is different, the client is recomended create an android application.
2-You need have clear this: Android is an application, the server has to attend petition from android. The conection could be using webservices, API rest, or others ways.
3-Android need Java to be native, in the server side you can use, Ruby, PHP, Java, Python or any server programming languaje side. Is your choice.

Maximal reuse: Webservice, Android client, Web Client, how?

I need to build a simple web service in Java, the context is Google Application Engine.
Two clients are needed as well: Android and Web Page, for browser.
I consider something like Restlet, and want to re-use from it Android and GWT clients.
Could, you, please, give me a hint, whether it is a good way to go?
Could you advice others?
In particular, I could not find, how this technology coexists with WSDL, and if
I am going to be able to use it?
Restlet Framework is mainly used to develop RESTful web services, even though in practice you can also issue and receive SOAP calls to bridge with older systems (no WSDL support though).
For help on GWT and Android client sides, see:
http://wiki.restlet.org/docs_2.1/13-restlet/21-restlet/318-restlet/303-restlet.html
It depends a lot on whether you wish to build cross platform as in phonegap or keep it simple as in mobilewebapp example provided in sample folder in gwt zip file you download.
The mobilewebapp sample does not access smartphone features but will be accessible by browser on any mobile. phonegap or similar frameworks like titanium,sencha provide api to access smartphone features.
Fore more information -
http://www.sapandiwakar.in/technical/api-research-study-iphone-and-android-applications/
Sencha Touch 2 native build vs wrapping Sencha Touch 2 in Phonegap
Creating a mobile app using Google App Engine and GWT?

Recommendations for .NET Web Service Format/Protocol for Android, iPhone, etc. integration

I am building a web service for my ASP.NET MVC 3 website. Ideally I would like all clients (my web pages, iphone application, android application, windows phone 7 application, etc.) to use the same service layer to load and save data.
I am new to mobile development and was wondering if there is a preferred mechanism - SOAP/JSON/etc - to use a heterogeneous mobile device setup. Specifically I'm wondering if Android and iOS have better libraries/support for one protocol over another or if the main mobile platforms have strong support for all protocols. I am also wondering if all is even when it comes to securing said services.
Any advice would be much appreciated
Thanks
JP
I would suggest a REST(ful) service with JSON.
Both Android and iOS have libraries that support parsing XML and JSON, however the JSON libraries are a bit easier to use and are a little bit faster.
With a little more effort you could allow your service to provide/consume both XML and JSON.
It would be preferable to avoid SOAP as it is more verbose and not as suitable for the more bandwidth/battery sensitive mobile devices.
This would be a great opportunity for you to try out WCF Data services, together with Entity Framework. You can build it very fast, and it exposes your information model using the OData international standard in both XML and JSON flavor. The interface is accessible throught REST. No problems interacting with any front-end technology, fat, web or mobile clients.
AND, you have all the benefits of re-using your C# .NET knowledge, visual studio and created assemblies to also make more tighter integration with Windows applications if you need to. It certainly did the trick for me!
So:
Create your application model using Entity Framework. Either database first if you already have a physical datamodel, or model first is you are starting from scratch.
Expose the created information model using WCF dataservices (5 lines of code)
You can find a walkthrough at: http://msdn.microsoft.com/en-us/magazine/ee336128.aspx
Happy coding!
I have almost same situation and what am I doing is, I am making WCFrest services for android and iphone.
In terms of the security, I am using role based membership provider. So i have created a user for the mobile clients with the role of 'Mobile clients' and give the user id (guid) as an 'api key' to the android and iphone developer.
The iphone and android developer has to send the 'api key' in the header of the request.
so before executing any method in my wcf, i am checking the api key and also checking if the request is from an android or iphone device.
I hope this will help you a little to plan your development..:)
Try using ksoap2 and have your WCF services use the basicHTTP binding.
If you have only primitive types as parameters, this should very easy. With some work you can also use it for more complex types.

How should I approach making server-side software for an Android application?

In the past I have used Python for backend stuff along with Django for frontend stuff, but I don't know how well those two work with Android.
Can anyone recommend a good way to go about making server-side software that works well with Android?
Please take into account that I also want a web application as a frontend, so the backend should work with both the web app and the Android app.
Thanks for the help!
You might start by developing an HTTP API using Django, tornado, cherrypy, or any other web framework. This API may then be used by both your web frontend and your Android application.
In general, separating out the API from the application serves to clean up the code and make future changes easier. In this case, it also makes it easy for you to have multiple frontends without having to replicate the backend functionality.
If it's possible to create a web application version of your project, consider that it may be easiest just to create a version of that application which is formatted for the android screen, and allow Android users to use the same web application with appropriate styling.

wsimport and Android or any other ProxyGenerator for android?

I am currently developing an Android app i previously developed for IPhone. My Backend is built using WCF service with basichttpEndpoint, i also enabled RESTful methods for better support with other Mobile platforms as well.
Now i want to access my existing WCF service(SOAP/REST endpoint) on Android but i need some good ProxyGenerator to consume my services. I just google around for some solution and i found wsimport and wsdl2java(Axis) are two options in java domain. But i am still unable to find any solution related to Android. Can anyone suggest me the best practice in such scenario?
I'm not aware of any custom libraries. You can check out droid-fu. It has some httpclient helpers to send http requests and read response bodies. But I'm afraid you won't really find any beefy rest or soap client libraries for android.

Categories

Resources