6 Replies - 371 Views - Last Post: 26 March 2018 - 09:06 PM

#1 Cplusplus_and_furious   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 24-August 17

Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 06:58 PM

For example via a socket? I have the MySQL running on an ubuntu server listening at certain port?

All I have to is to find either the kind of library or what Android already has to provide an ipaddress and a port number. Basically I'm sending formatted strings (with of course, username and pass included).

Is that possible?



I know the more "conventional" way of doing this is to first build a server with mysql AND php/java/c++ (usually php though) running on it listening to usually http traffic, receive the right data that my app sent to it (the php process), and then parse it, and then update/insert into the database. Seems a bit redundant, especially if you consider that there are scenarios where you don't need to upload a heap load of data?

Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to upload data from my Android app to MySQL "direct

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2874
  • View blog
  • Posts: 11,243
  • Joined: 03-December 12

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 06:59 PM

You can, it is a bad idea, but it is possible.
Was This Post Helpful? 0
  • +
  • -

#3 Cplusplus_and_furious   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 24-August 17

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 07:33 PM

View Postastonecipher, on 26 March 2018 - 06:59 PM, said:

You can, it is a bad idea, but it is possible.


Which begs the 2 apparent questions:

1. How?

2. Why bad? Insecure?

This post has been edited by Cplusplus_and_furious: 26 March 2018 - 07:33 PM

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15110
  • View blog
  • Posts: 60,436
  • Joined: 12-June 08

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 07:57 PM

Perhaps make a web service, or a json API?
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11578
  • View blog
  • Posts: 19,692
  • Joined: 19-March 11

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 08:47 PM

I'm curious about what sort of scenario makes you think "gee, I would really love it if I could execute SQL commands against my database from my phone". I mean, I'm looking for a use case and I can't think of one. Can you enlighten me?
Was This Post Helpful? 0
  • +
  • -

#6 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11578
  • View blog
  • Posts: 19,692
  • Joined: 19-March 11

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 09:00 PM

View PostCplusplus_and_furious, on 26 March 2018 - 09:33 PM, said:

1. How?


How? You're going to have to be a little more explicit about what you're trying to do. Describe the interaction you want to have.
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15110
  • View blog
  • Posts: 60,436
  • Joined: 12-June 08

Re: Is it possible to upload data from my Android app to MySQL "direct

Posted 26 March 2018 - 09:06 PM

Awww, ease up Jon. Probably a mind mapping bump between how local development connections go to dealing with the wild world of the internet.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1