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
from dronekit import connect, VehicleMode, LocationGlobalRelative | |
from pymavlink import mavutil | |
import time | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--connect', default='127.0.0.1:14550') | |
args = parser.parse_args() | |
# Connect to the Vehicle |
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
implementation 'com.squareup.retrofit2:retrofit:2.7.2' | |
implementation 'com.squareup.retrofit2:converter-gson:2.7.1' | |
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2' | |
implementation 'com.google.code.gson:gson:2.8.6' | |
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3" | |
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3" | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61" |
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
interface UniService { | |
@GET("f_getData?siteKey=5B765FE7627B4BCEA73B723C5523789E&EID=4E00590053005F006D004C00500035005500720059003100") | |
suspend fun getFoodList(): FoodResponse | |
} |
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
data class FoodItems( | |
@SerializedName("items") val items: List<Food>?, | |
@SerializedName("kahvalti") val breakfast: List<Food>?, | |
@SerializedName("ogle") val lunch: List<Food>?, | |
@SerializedName("aksam") val dinner: List<Food>?, | |
@SerializedName("kumanya") val stores: List<Food>?, | |
@SerializedName("diyet") val diet: List<Food>?, | |
@SerializedName("vegan") val vegan: List<Food>?, | |
@SerializedName("cocuk") val child: List<Food>? | |
) |
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
data class Food( | |
@SerializedName("tarih") val date: String?, | |
@SerializedName("menu") val menu: String?, | |
@SerializedName("kalori") val calorie: 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
class RetrofitClient { | |
companion object { | |
private var uniService: UniService? = null | |
fun getUniService(): UniService { | |
if (uniService == null) { | |
uniService = Retrofit.Builder() | |
.baseUrl("https://service-cms.istanbul.edu.tr/api/webclient/") |
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
class MainActivity : AppCompatActivity() { | |
private val service = RetrofitClient.getUniService() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
GlobalScope.launch(Dispatchers.IO) { |
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
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
kotlinOptions { | |
jvmTarget = JavaVersion.VERSION_1_8 | |
} |
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
implementation fileTree(dir: "libs", include: ["*.jar"]) | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |
implementation 'androidx.core:core-ktx:1.2.0' | |
implementation 'androidx.appcompat:appcompat:1.1.0' | |
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | |
implementation 'androidx.recyclerview:recyclerview:1.1.0' | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | |
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:id="@+id/itemFoodMenu" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
OlderNewer