This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Java Log In and move to new page  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Brief Background into what I'm doing.
I'm making an Android App on Android Studio, which connects to a SQL database (through a php file. I'm using WAMP server). I simply want the app to have a log in page and allow the user to log in if their details are in the table in the database and then go to a new page.

Would anyone have any simple way of doing this?

Thanks in advance

 
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What part are you wondering about specifically? Creating the activity with the login page? Connecting to the DB over the net? Checking the results and starting a new activity or layout? Something else?
 
Harry Burke
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:What part are you wondering about specifically? Creating the activity with the login page? Connecting to the DB over the net? Checking the results and starting a new activity or layout? Something else?



Sorry should have said this.

The system begins on MainActivity.java, and then is sent to BackgroundWorker.java. In BackgroundWorker.java, I have the connection to the database all set up and the user is able to Log In on the app.

However I'm having an issue when I'm trying to get the information that the user has successfully / not successfully logging in back to the MainActivity.java so that then I can call a new page.

Thanks
 
Tim Moores
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is BackgroundWorker an Activity? if so, start it with startActivityForResult, and have your activity implement onActivityResult to receive any results back from it (via setResult).

If BackgroundWorker is an AsyncTask (which would be more suitable for a background job than an Activity) you would use its onProgressUpdate method to transfer results back to the starting Activity.
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!