how jsp-android web service work without hosting for testing - android

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

Related

How to host an android application without using localhost

I've developed an android application that uses a SQL database which is running successfully on localhost. Now I want to give a demo of my application that a user could run remotely. I need to send the apk to another person. I can access the app because I am on the localhost, but how can the remote person access it?
For android app your app hosting best solution is Andorid Firebase and this service is Free.
Firebase Hosting Referance
It's also work like a web app so another person can view the demo as you required.
Firebase also provide Storage, Database and so on feature that you should be like.
Thanks.
You only have to tell the other person to use the internet address of your router.
Then on your router forward the used port to the ip address of the pc where your service runs.
Please dont talk about localhost the way you do. Every device is its own localhost. So also your Android device is a localhost. And every pc is.

Sqlite database login system

I'm trying to create a login system for an android app and I would like to know if creating a Sqlite database solution would work across different devices. For example if I register in a device, could I access the app from another device with that same account without having to register again? If that does not work, what would be the solution? Thanks for the help :)
Ideal solution would be to connect the app to the server for authentication and authorization. The server can be build using any type of database whether it is sqlite or mysql etc. So it does not make any difference.
You can create a web service for the purpose of authentication using php, java or .net (your choice) and the android application can use any web service client framework such as service stack etc. for connecting to the web service.
What kind of authentication and other features you want will depend solely on your application design.
The best option is using a web server. I am doing the same and am using a .net web services for users authentication
For allowing same user to loggin in different devices with same credentials in the app you need to use central database .
Below is the link which will help you a lot.
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Note : Sqlite database is the local database , we can not use it for our central purpose or out of the specific device.

How an Android phone interacts with the server?

I have an app running fine in emulator but not in mobile. That is app basically fetch some records from server using webservice.(SOAP). Installation is successfull and i can open the first page.but not able to proceed further due to server communication. I need your help in making this app to work fine in my android phone too. Thanks in advance!!
You must be accessing the web service on your local network (localhost). An emulator can access a localhost web service, but a real device cannot. To test the app on an actual device, you need to expose your web service through a public IP address (public URL).

Manage Android Device through web browser from a laptop using WiFI

Requirement: I want to control my android phone through my laptop using WI-Fi. For this I need to run a web server and a "customized" web app that runs on the android phone over a particular port and the wifi adapter's ip address. For example , I can connect to the web application running on my phone through the browser in my laptop using : http://(ip address of the phone):port
Things I have tried: I evaluated a few webservers for android that lets me run java based servlets like (ijetty). There are others like TWJS , KWS , PAW etc. So far, I am able to run them on the phone and access the web server through my laptop.
My Question: Of all the resources and materials pertaining to developing apps for Android , I'm having a real hard time finding any useful and clear information on what web technology should I create a web application that can use the android APIs and effectively communicate with the phone just as any native Android application.
i-Jetty claims to support Web Applications that can use the android apis , but lacks any sincere documentation on how to build to such web application/servlets that uses Android APIs.
While,my requirement is similar to what to an existing application for Android does namely AirDroid, it is not open source and neither it discusses anything related to its implementation architecture. So, I am open to any suggestions that can help me create a web application for the managing the android phone wirelessly.
Giving a look at the i-jetty example application you can see that it's possible to retrieve the Context and ContentResolver objects:
android.content.ContentResolver resolver = (android.content.ContentResolver)config.getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");;
android.content.Context androidContext = (android.content.Context)config.getServletContext().getAttribute("org.mortbay.ijetty.context");
through which you can access system services, read and write preferences, execute queries to retrieve contacts etc. as if it was a normal android application.

Android application as Web Service

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.

Categories

Resources