I never worked so fast

This commit is contained in:
2023-12-20 11:10:53 +02:00
parent 62e73fb0de
commit 8f724451c1
3 changed files with 37 additions and 3 deletions

View File

@@ -2,11 +2,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp_1">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<service
android:name=".FetchArrival"
android:enabled="true"
android:exported="true"></service>
<activity
android:name=".Predict"
android:exported="false" />

View File

@@ -0,0 +1,28 @@
package com.example.myapp_1;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import com.example.myapp_1.DB.GetArrivals;
import com.example.myapp_1.DB.RetrofitClient;
import retrofit2.Retrofit;
public class FetchArrival extends Service
{
private GetArrivals apiService = RetrofitClient.getRetrofitInstance().create(GetArrivals.class);
@Override
public int onStartCommand(Intent intent, int flags, int Startid) {
return START_NOT_STICKY;
}
@Override
public IBinder onBind(Intent intent)
{
// TODO: Return the communication channel to the service.
throw new UnsupportedOperationException("Not yet implemented");
}
}