I never worked so fast
This commit is contained in:
@@ -9,7 +9,7 @@ android {
|
||||
defaultConfig {
|
||||
applicationId = "com.example.myapp_1"
|
||||
minSdk = 24
|
||||
targetSdk = 33
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
@@ -31,7 +31,7 @@ android {
|
||||
dependencies {
|
||||
|
||||
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("com.google.android.gms:play-services-maps:18.2.0")
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
|
||||
@@ -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" />
|
||||
|
||||
28
app/src/main/java/com/example/myapp_1/FetchArrival.java
Normal file
28
app/src/main/java/com/example/myapp_1/FetchArrival.java
Normal 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user