Harry Burke

Greenhorn
+ Follow
since Jan 29, 2019
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Harry Burke

When I first began trying to get the database connected, I tried using JSON but got very confused because I've little knowledge of it so it was very frustrating.

However, maybe I was doing it totally wrong and would really appreciate it if you could suggest some source code if you can.

I'm using SQL database and accessing it through phpMyAdmin.

Thanks.
5 years ago
Ya I understand it must have been a bad example I chose.

Would you be able to suggest any source code that I could use to get the database set up on the app?

I appreciate your help!
5 years ago

Tim Moores wrote:
That looks like an Sun/Oracle-specific class that I'm not sure if it's available on Android. What library or piece of code needs that?



I really don't know Tim, I just found the source code and tried to swap in my database details.

Apologies
5 years ago

Tim Moores wrote:What do you have so far? The usual approach would be to connect via a REST web service running on your web server.



I'm currently getting an error on Build in the Run Tasks --> :app:transformClassesWithInstantRunForDebug

5 years ago
Hi,

Would anyone know any good tutorials (or have their own code) that I could follow to connect my SQL database to Android Studio.

I simply just want to log in a User.

I've been struggling to get this working for quite a while now.

Any help would be much appreciated.

Thanks.
5 years ago
Hi,

I have attached a picture of the error message that is now coming up in the LogCat.

Would anyone be able to let me know how I could go about fixing it?

Thanks
5 years ago
Unfortunately that didn't solve the issue, I'm still getting to the same point as before.

Would you have any other idea that I could possibly use?

Thanks

(Sorry about the delay in this response)
5 years ago
This is the LoginActivity.java page. The login form on the app is filled in, then it goes to a login.php page to see if it's in the database.

It's just that I don't understand JSON well enough to figure out the error I'm having.

5 years ago

Ron McLeod wrote:
It looks like this method is a handler for a response from a web service.

Make sure that you are asking for a JSON-formatted response in the request (Accept: application/json header).



Sorry to be basic at this but how would I go about doing that?

I appreciate your help!
5 years ago

Ron McLeod wrote:Where does the contents responseBody some from?



Here's the full function. This is the only place where "responsebody" is.

5 years ago

Ron McLeod wrote:
connected is not a valid JSON representation, so it is most likely throwing an exception (which you should see in the logcat log).

Simple test:




No I'm not getting any Information back from LogCat for 6.3.... would you know how I could possibly fix this?

Thanks
5 years ago

Ron McLeod wrote:

Harry Burke wrote:I'm getting to the Log 6.2 but I'm not getting Log 6.3, so I'm presuming the error is on line 4 above.


What is the value of response which is logged in line 2?

Does logcat show any exceptions raised for line 4?



Hi,

The value of 'response' in line 2 is the word -> connected.

No LogCat doesn't give anything back for line 4 unfortunately.

Thanks
5 years ago
Hi,

I'm using a friends code to help connect my app to my SQL database. However the app is stopping at a certain point. I know this because of the comments I have added.

I'd appreciate if somebody could help me and advice on how to fix it.



I'm getting to the Log 6.2 but I'm not getting Log 6.3, so I'm presuming the error is on line 4 above.

Thanks,
5 years ago

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
5 years ago
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

5 years ago