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

@@ -9,7 +9,7 @@ android {
defaultConfig { defaultConfig {
applicationId = "com.example.myapp_1" applicationId = "com.example.myapp_1"
minSdk = 24 minSdk = 24
targetSdk = 33 targetSdk = 34
versionCode = 1 versionCode = 1
versionName = "1.0" versionName = "1.0"
@@ -31,7 +31,7 @@ android {
dependencies { dependencies {
implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0") implementation("com.google.android.material:material:1.11.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("com.google.android.gms:play-services-maps:18.2.0") implementation("com.google.android.gms:play-services-maps:18.2.0")
implementation("com.google.code.gson:gson:2.10.1") implementation("com.google.code.gson:gson:2.10.1")

View File

@@ -3,10 +3,16 @@
package="com.example.myapp_1"> package="com.example.myapp_1">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<service
android:name=".FetchArrival"
android:enabled="true"
android:exported="true"></service>
<activity <activity
android:name=".Predict" android:name=".Predict"
android:exported="false" /> 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");
}
}