1
votes

I have built an android app in Netbeans Codename one, using the Theme features. I used the "Sign in" demo to create the login/password form. However, I want to connect it to a MYSQL database that I have in a Joomla website.

What I want to do, is create a login system. -Put username and password in database in Joomla, press connect, if they exist and go main menu. -Register (insert in database, username password).

How do i proceed in this? Is there a relevant tutorial or demo?

I connect it successfully to php and other joomla databases, I want to do the same for the app.

<?php
$servername = "1.2.3.4";
$username = "user1";
$password = "pass1";

// Create connection
$conn = mysqli_connect($servername, $username, $password);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>
1

1 Answers

0
votes

This is the tutorial and it's even geared to PHP developers https://www.codenameone.com/blog/connecting-to-a-mysql-database.html

There is part 2 which is geared to Java developers https://www.codenameone.com/blog/connecting-to-a-mysql-database-part-2.html

The gist of it is that you do the exact same thing you do in PHP but open a webservice to your mobile app.