🎯An exercise to work with Api and retrofit in kotlin
✔️step 1:
go to Xampp and Create new database(if you dont Xamp, you can install it)
create table like this:
I craete new database. Its name is Retrofit
and i create "user" table.
The rows of the table are shown in the photo below
✔️step 2
create "retrofit" folder on Xampp in in drive C
Go to the following directory and create the "retrofit" folder.
C:\xamp\htdocs
✔️step 3
go to retrofit folder and put your php code on it.
here, you can find php codes in "retrofit" folder ->https://github.com/TaghaviCe/LoginSignUpKotlin/tree/master/retrofit.
✔️step 4:
find your ip address on your pc
✔️step 5:
Now you can see the code folders you put in the Xampp folder with your IP address.
For example, if your IP is 198.168.X.X
your URL is: http://198.168.X.X/retrofit/ (use your url on your kotlin code -> https://github.com/TaghaviCe/LoginSignUpKotlin/blob/master/app/src/main/java/com/example/loginsignupkotlin/network/ApiParam.kt)
and you can see like this:arrow_down::
✔️step 6:
Now you can test your Kotlin code and connect to Xampp via Api
You can try these codes on the real host
attention!: that both your mobile (or your emulator) and your PC must be connected to the same Wi-Fi to be able to communicate with each other based on your IP.
important points in kotlin code:
- MVVM architecture
- Moshi, Retrofit, Coroutine
Good Luck :) :seedling: