mistake: (I want that my api without the CRUD database operations doing someting like)
I mean with the CRUD operation…, my api must perform these action:
-Génerate an image wich will be displayed in the mobile app
-Generate an excel (.xls) file as statistic downloadable by my android app user.
I don’t pretend for single source of truth and don’t know, sorry, your level of expierence, but I’ll try to give some advices.
Maybe it’s better to keep statistic data in database (DB). One can get the data of any time period. As for image, I’d advise to store image-file on server, but reference to the image-file in the DB. Let’s, for example, use MySQL. But it’s matter of DB design for your project.
To get the data from the DB you should make two main parts of work: backend (use Slim PHP framework) and frontend (this is Android).
Slim PHP framework handles queries to DB and sends responses to Android in format of JSON.
Android-app with such tools like Retrofit (HTTP-client for Java and Android http://square.github.io/retrofit/) and Picasso http://square.github.io/picasso/ or Glide https://github.com/bumptech/glide (libraries that helps to load image from server to Android-app) can get data from server (text and image, accordingly). To be correct, those image libs load references, because Android-app should not be over-bloated with image-files.
As for Excel-file in Android-app. I’m apologising, but to present the statistic data in such way it’s weird for Android-app. Please, use Android’s tools and ways to get and to show data to your Android-app’s users.
Well. I will try to explain as clearly as possible.
Make an API for your Android-app with Slim 3. For preliminary testing the API you can use local-server and Postman https://www.getpostman.com/.
The main purpose for the Postman is to test your server requests and responses. To evaluate those requests and responses (designed by you, by the way) you have to understand how Retrofit handles them. I think Retrofit’s docs are clear enough and there are a lot of tutorials in a net. Android-app and server should comunicate in JSON format (at least, in our case).
In Android-app you should design models (POJO classes) so that they can handle (fit to) the structure of the server responses. And to test it - the Postman for help.
If everything is OK, just put your server part (the API, your Slim-project) to real (I mean not local) server with FTP-client (FileZilla or WinSCP).
In Android-app you should specify correct path to those resources (I mean you PHP-files, that handles requests and produces responses). For example, www.yourdomain.com/myproject/someapi/ . And that will be a BASE_URL for Retrofit (again, see Retrofit’s docs).