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...
LVL 10
GlobaLevelProgrammerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.