Accessing mysql database without logging in (from android java application) (using php server side)
Applications often allow anonymous user access but relational databases should be accessed using a minimally privileged account as a best practice. 

With a public web application, end users do not access the database directly but through the remote web server, middleware, or other service. The data access layer should then connect to the database using a minimally privileged account.

In MySQL, execute CREATE USER and GRANT to setup the service account. Use those credentials to connect to the database in the data access layer.