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
@OptIn(ExperimentalMaterial3Api::class) | |
@Composable | |
fun RecipeTitle(navController: NavController) { | |
var recipeTitle by rememberSaveable { mutableStateOf("") } | |
Surface( | |
modifier = Modifier.fillMaxSize() | |
) |
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
import requests | |
import json | |
import string | |
def getTeamColorData(url): | |
r = requests.get(url) | |
data = r.json() | |
for item in data: | |
erasArray = item['eras'][0]['colors'] | |
print(item['name']) |
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
<?php | |
$value = $_POST["value"]; | |
$jsondata = '{ | |
"value": "request successfull" | |
}'; | |
if ($id != null) { | |
echo($jsondata); | |
} |
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
fun postString(context: Context?) { | |
val queue = Volley.newRequestQueue(context) | |
val sr: StringRequest = object : StringRequest( | |
Method.POST, "http://favor4u.xyz/calisma/samplepost.php", | |
Response.Listener { response -> | |
val res = JSONObject(response) | |
val value = res.getString("value") | |
Toast.makeText(context, "Successful", Toast.LENGTH_SHORT).show() | |
Log.i("value", value) | |
}, Response.ErrorListener { error -> |
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
fun getRequest() { | |
var url = "https://raw.githubusercontent.com/ibrahim4851/VolleyRequests/master/nestedjson.json" | |
val queue: RequestQueue = Volley.newRequestQueue(this) | |
val request = JsonObjectRequest( | |
Request.Method.GET, | |
url, | |
null, | |
{ response -> | |
val glossary = response.getJSONObject("glossary") | |
val GlossDiv = glossary.getJSONObject("GlossDiv") |
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
fun getJsonArray() { | |
val requestQueue: RequestQueue = Volley.newRequestQueue(this) | |
val jsonArrayRequest = | |
JsonArrayRequest("https://raw.githubusercontent.com/ibrahim4851/VolleyRequests/master/jsonarray.json", | |
{ response -> | |
for (i in 0 until response.length()) { | |
try { | |
val jsonObject = response.getJSONObject(i) | |
val title = jsonObject.getString("title") | |
val description = jsonObject.getString("description") |
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
private lateinit var getarray: Button | |
private lateinit var getobject: Button | |
private lateinit var postobject: Button | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
getarray = findViewById(R.id.getarray) | |
getobject = findViewById(R.id.getobject) |
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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:gravity="center" | |
tools:context=".MainActivity"> |
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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.ibrahim.volleyrequests"> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<application | |
android:usesCleartextTraffic="true" | |
... | |
</application> |
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
fun detectImage() { | |
val recognizer = TextRecognition.getClient() | |
bitmap?.let { | |
val image = InputImage.fromBitmap(it, 0) | |
recognizer.process(image) | |
.addOnSuccessListener { visionText -> | |
Toast.makeText(this, visionText.text, Toast.LENGTH_SHORT).show() | |
} | |
.addOnFailureListener { e -> | |
Toast.makeText(this, "Error: " + e.message, Toast.LENGTH_SHORT).show() |
NewerOlder