Is it possible implement an Android application as a web service?
On the official site I've read:
Note: If you want to develop a server-side application, we recommend
that you implement your application as
a servlet running in a servlet engine
like Tomcat or full-blown JSEE
container like Geronimo. If you prefer
to implement a server-side application
based on our HttpService, we'll assume
that you know what you're doing and
that you don't need help in figuring
out which interceptors need to be
configured.
How can I implement this? Apache TOMCAT can run on Android?
Is it possible implement an Android
application as a web service?
You can create an Android service that will open up some server socket and will listen for HTTP requests. However, Android will eventually kill off that service, either automatically after it is unused or at user request. And, nobody will be able to access the service except on the same WiFi LAN.
IMHO, truly implementing a Web service on Android is pointless.
I think they're saying that you can write a server-side application for an Android user to access, not that you'd run Tomcat on the Android device itself.
Related
I have a web service for my android and Iphone application that connects to online database.
now we want to apply SSL on the web server. will this effect on my web service?
will the android and iphone applications keeps running or will be stopped? because in the applications they are linked to the web service like this
http://www.example.com/service/index.php
and now after applying SSL the website will be like
https://www.example.com
should I change my applications to
https://www.example.com/service/index.php
or its ok if I kept the old link in my applications (android and iphone)?
When we enable SSL in our server we can keep our unsecure http access or redirect it to secure https.
Use secure communication is always a good practice but it will cost you a bit more of effort.
As an Android developer I was able to use https REST webservices thanks to this answer.
For iOS I have no idea but this answer could be a good starting point.
i want to do a academic web-android project that named tour-trips planer. but web service part is not working in it. i want MySQL database to access my android app. how to work it without hosting? and i'm totally a beginner..
you need to your android application and web service in the same network
you can do this using one of these methods
using app to share network connectify
see this How can I access my localhost from my Android device?
and this How can I access my localhost from my Android device?
i hope this helps you
So I am planning on building a web service that an Android app will connect to. I am trying to come up with a way to secure this web service so it will only be used via the App.
I was thinking just passing a secret key along with each call I make. But this can easily be compromised with an http sniffer. Then the web service can be used with anyone at that point.
Are there any other ways to make this work?
Thank you!
I don't know that you can FORCE Android only. Whatever method you use can be worked around if they know what it is.
Depending on how the app is written, it should be simple enough to check the User-Agent of the request. Apps that use the HttpUrlConnection (as recommended by the Android docs) should have a user-agent string that says Android in it.
I'm posting this here because the thread I made on programmers stackexchange didn't get any answer and I need an answer for this rather fast, so here we go:
For a school project we are looking to implement push like technologies in our Android app, we need to send push messages from a server (Tomcat) to the Phone (Android).
After doing some research I've found that XMPP would be a good option for achieving this type of push notifications, now my problem is how I should integrate this with our Tomcat server where all the information and events will happen as well as where all our other pages are.
Is it at all possible to have a XMPP server or module running inside of Tomcat or can I build my own lightweight module(I was thinking something like a servlet) to handle this?
If you have any better ideas on how to achieve push notifications I would be really glad to hear them, whether it be using a totally different approach then XMPP (I've looked at long polling, MQTT and some other things) or some other way to integrate the solution into Tomcat.
The requirements we have is that we must use Tomcat and Android 2.1 (so C2DM is not an option) and set up push notifications between these.
You can probably run some servers within Tomcat, but I don't think you really gain anything from this setup with respect to XMPP. You will in effect have a server running inside of another server.
The only advantage I can see with this is if you want access to the server internals from some other web application, but for that I would either make the web app another client, or build a custom communication module in the xmpp server that the web app can use to communicate outside of standard XMPP.
I want to write an Firefox mobile addon, which needs to communicate or invoke some android program with some data. I want to know what is the best way to communicate between an Firefox addon and android process. One way I can think of is to write data on Clipboard from addon, and continuously poll for clipboard from the android process, but that is not the efficient way. So any other ideas, please.
Unfortunately, there isn't a public way to communicate between Firefox and Android. We have been discussing how to expose such a mechanism.
In the meantime, I have been able to communicate with other applications using sockets. For example, the Android Scripting Layer (http://code.google.com/p/android-scripting/) can act as a RPC server. I have been able to open a socket to the server and communicate that way.
The FoxToPhone allows to send data from the browser to android device. Could be a good example to follow.
In the meantime, the cloud to device allows to send data from the cloud to a phone.
Maybe a combination of both services could do the trick?
You could use WebSockets in your FF extension and Sockets in your android app.
Or another solution is to include a servlet (appengine) between the extension and the app.