The api begins
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.myapp_1">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="@string/app_name"
|
||||
|
||||
20
app/src/main/java/com/example/myapp_1/DB/Arrival.java
Normal file
20
app/src/main/java/com/example/myapp_1/DB/Arrival.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.example.myapp_1.DB;
|
||||
|
||||
public class Arrival
|
||||
{
|
||||
public String getArrivalTime()
|
||||
{
|
||||
return arrivalTime;
|
||||
}
|
||||
|
||||
public void setArrivalTime(String arrivalTime)
|
||||
{
|
||||
this.arrivalTime = arrivalTime;
|
||||
}
|
||||
|
||||
private String arrivalTime;
|
||||
Arrival(String time) {
|
||||
this.arrivalTime = time;
|
||||
|
||||
}
|
||||
}
|
||||
17
app/src/main/java/com/example/myapp_1/DB/GetArrivals.java
Normal file
17
app/src/main/java/com/example/myapp_1/DB/GetArrivals.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.example.myapp_1.DB;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
public interface GetArrivals
|
||||
{
|
||||
//Specify the request type and pass the relative URL//
|
||||
|
||||
@GET("/users")
|
||||
|
||||
//Wrap the response in a Call object with the type of the expected result//
|
||||
|
||||
Call<List<Arrival>> getAllArrivals();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user