Android Question Connecting Android App to a MYSQL database

beelze69

Active Member
Licensed User
Longtime User
Hi Erel,

This is with reference to your Post

https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/page-2


I would like to test the above application on a Server which is on the open internet. I do not have any registered domain. I tried opening the HTTP PORT on my router/firewall but it does not seem to be working.

I tried to register on a site offering 'free website hosting', completed the formalities and got access to the site. I created the MYSQL database etc. and also uploaded your PHP script. But they are saying that 'they do not offer any interaction with mobile devices in the free version'.

In one of the responses to your post In your response to the above link, you have

mentioned that ...'you can test it on our server'.


Can you pl. give me the access to your 'test server' where I can test my application ?

Thanks in advance.

Sorry if I sound too basic.
 

KMatle

Expert
Licensed User
Longtime User
Can you pl. give me the access to your 'test server' where I can test my application ?

I'm not Erel, but I give you the answer: Noone will give you access to his/her webspace!

I tried to register on a site offering 'free website hosting', completed the formalities and got access to the site. I created the MYSQL database etc. and also uploaded your PHP script. But they are saying that 'they do not offer any interaction with mobile devices in the free version'.

So why don't you ask how you can solve this? By the way 5-10$/month for a reliable webspace is not too much.

Solution (not that safe - only for testing!)

1. Download and install XAMPP
2. Open a port on your router and route it to the machine where XAMPP runs (e.g. 192.168.1.22)
3. Your php script must be under /htdocs and use correct credentials to connect to MySQL
4. Get your Internet address which you are connected with (your router knows it). This is not static if you haven't one in your plan.
5. In your app call this address using OkHttpUtils

If you have questions how to do this or that: Use the forum search AND the WWW (as this is not B4x related).
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi,

Thanks.

I have created an account in Amazon Web Services (AWS).

Can you please guide me to a tutorial/video on

1) How to connect to a PHP/MYSQL Database set up in an AWS account from the B4A mobile application.

Thanks.
 
Upvote 0

Brandsum

Well-Known Member
Licensed User
Open a port on your router and route it to the machine where XAMPP runs (e.g. 192.168.1.22)
Or you can use wampp. It has "Put Online" option which will do all necessary steps. In wampp you can switch between different php version.

I have created an account in Amazon Web Services (AWS).
First setup your aws ec instance. Then login to that via ssh (Putty). Install all necessary package like Apache, MySql, phpmyadmin and connect all those. Then you can write php script to get or set data from your database.

If you are a beginner then I will suggest to use a ready to use server or you can say a shared server.
 
Upvote 0
Top