I just wanted to ask to see if there is a way to connect to the sql server located on my server from my android application which will be installed onto other devices. Currently, this works for all devices which is connected to the same network as my server, however, when I for example use a hotspot or accesses the program from a public location it connection fails. Is it mandatory that I need to host my sql server on the cloud for this to work?

I have exhausted all of the resources(I think). I have tried:

  1. Allowing remote connection in SSMS.
  2. Enabling TCP/IP and setting the ipAll to port 1433.
  3. Adding an inbound rule in firewall for port 1433.
  4. Adding an inbound rule in firewall for the SQLEXPRESS.
  5. Enabling SQL Server Browser service.

If needed, please ask me for any additional information.

Also, is there a way to connect to MS SQL in android studio without the ipv4 address and just the server name instead?

Thanks in advance.


You really don’t want to give users direct access to a Microsoft SQL server, both for the sake of security and for licensing reasons. Write some kind of server software that gets called by your application and which alone has the necessary rights on the database.

  • Hi Mikael, Do you know where I can find information about how I can write the server software and would it fix the remote access problem? And how would the UI work with the server software to relay the data. I am currently developing in android studio in java. – user5761744 Jul 6 '20 at 11:10
  • The remote access problem would get solved in that this server software would present some kind of API over for example HTTPS. That protocol is way easier to handle in a safe and secure way. I guess by now this question is more on topic for StackOverflow than for ServerFault. – Mikael H Jul 6 '20 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.