-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from CrazyDude1994/uav-radar
Uav radar
- Loading branch information
Showing
13 changed files
with
250 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/crazydude/com/telemetry/api/AddLogRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class AddLogRequest( | ||
@SerializedName("session_id") val sessionId: String, | ||
@SerializedName("latitude") val latitude: Double, | ||
@SerializedName("longitude") val longitude: Double, | ||
@SerializedName("altitude") val altitude: Float, | ||
@SerializedName("heading") val heading: Float, | ||
@SerializedName("speed") val speed: Float | ||
) |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/crazydude/com/telemetry/api/AddLogResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class AddLogResponse(@SerializedName("status") val status: String) |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/crazydude/com/telemetry/api/ApiManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import retrofit2.converter.gson.GsonConverterFactory | ||
import retrofit2.Retrofit | ||
|
||
|
||
|
||
class ApiManager { | ||
|
||
companion object { | ||
|
||
const val API_URL = "https://uavradar.org/" | ||
|
||
private val retrofit = Retrofit.Builder() | ||
.baseUrl(API_URL) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
|
||
val apiService = retrofit.create(ApiService::class.java) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/crazydude/com/telemetry/api/ApiService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import retrofit2.Call | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
|
||
interface ApiService { | ||
|
||
@POST("api/session/create") | ||
fun createSession(@Body sessionCreateRequest: SessionCreateRequest): Call<SessionCreateResponse> | ||
|
||
@POST("api/data/add") | ||
fun sendData(@Body addLogRequest: AddLogRequest): Call<AddLogResponse> | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/crazydude/com/telemetry/api/SessionCreateRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class SessionCreateRequest( | ||
@SerializedName("callsign") val callsign: String, | ||
@SerializedName("model") val model: String | ||
) |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/crazydude/com/telemetry/api/SessionCreateResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package crazydude.com.telemetry.api | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class SessionCreateResponse( | ||
@SerializedName("status") val status: String, | ||
@SerializedName("session_id") val sessionId: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.