• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

android - login page

I have an android login page on my smartphone and I need to connect to the db and return back to the phone wherther they have successfully logged on or not....any ideas...
0
GlobaLevel
Asked:
GlobaLevel
  • 2
  • 2
1 Solution
 
589158Commented:
The best and most common way would be to use a webservice you can call from your device. Maybe written in php. Here is a nice tutorial explaining exactly how to do this.

But don't forget to think also about some security aspects like sql-injection, encrypting the data sent between the layers, how to store sensitive (user) data in the database, etc.
0
 
rkpuneCommented:
If you are using the db (sqllite) in the same application, then you may do it with simple database connection logic found in many articles around.

If you would like to connect to the database on any webserver over internet, then the best way is to use webservices. You may write code to receive a response from the webservice and know whether the connection was succesful.

Please let me know if need more clarifications. Also, if possible elaborate your question in detail.
0
 
GlobaLevelProgrammerAuthor Commented:
yes okay I like the web service adn I have one existing and it works so i can use that it is written in vb.net....

I really need two web services....one for the login....where I can send a useranem and password voer the WS and it return if the query has found their creds on the DB...if so route to another page...if not then send a message via textview that the username and password was not found...I dont have  SQLlite inside the app...

so I was curious if there is any code that is existing that I could use for this purpose.. that I could drop ito my app. thanks
0
 
589158Commented:
The only thing you need to handle is the way you communicate with the database. So of course you can use your existing .net-webservice. It doesn't matter if it is written in php, .net, jsp, etc.
The android device sends a request to the webservice by an http-request. The webservice handles the request and sends back a response. Your android app must handle the response. That's all.

In your case:
1. android app: send username/password by http request.
2. webservice: get the data, verify it with the database-data, send success-/failed-response
3. android app: process response from the server, show success-/failed-message

Of course you can use a second (and mostly some more) "service" to do more, for instance when login was sucessfull but the way of doing it stays the same:
request=>process=>response

So there are a lot of tutorials doing this. Surely you can snip out some code somewhere... But it always depends on the webservice and your app.
0
 
GlobaLevelProgrammerAuthor Commented:
Okay I used some code on the internet...but the issue...I'm having now is that...I'm getting alot of undefined errors, like soapobject undefined....its like I need to impot a DLL or somethinb
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now