• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

don't know how to access data using retrofit

I'm writing an application that have to get data from this site: https://api.spacex.land/graphql/.

I'm using retrofit for the first time and I don't have idea how I have to set the API service to get, for example, the launchLatest from this site.

This is my model:

data class LaunchModel(
var details: String,
var id: String,
var isTentative: Boolean,
var launchDateLocal: Date,
var launchDateUnix: Date,
var launchDateUtc: Date,
var launchSite: LaunchSiteModel,
var launchSuccess: Boolean,
var launchYear: String,
var links: LaunchLinksModel,
var missionId: String,
var missionName: String,
var rocket: LaunchRocketModel,
var staticFireDateUnix: Date,
var staticFireDateUtc: Date,
var telemetry: LaunchTelemetryModel,
var tentativeMaxPrecision: String,
var upComing: Boolean,
var ships : ShipModel,
)

this is the RetroIstance, a class that instance the settings of retrofit:

class RetroInstance {
companion object{
private const val baseUrl = "https://api.spacex.land/"

fun getRetroInstance() : Retrofit {

val client = OkHttpClient.Builder()
return Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create())
.client(client.build())
.build()
}
}
}

this is my main activity:

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val retroInstance = RetroInstance.getRetroInstance().create(RetroService::class.java)
val retrofitData = retroInstance.getLastLaunch()
retrofitData.enqueue(object: Callback<LaunchModel> {
override fun onFailure(call: Call<LaunchModel>, t: Throwable) {
Toast.makeText(this@MainActivity, "call fail", Toast.LENGTH_LONG).show()
}

override fun onResponse(
call: Call<LaunchModel>,
response: Response<LaunchModel>
) {
val responseBody = response.body()

if(responseBody != null){
Toast.makeText(this@MainActivity, "${responseBody.id} + ${responseBody.details}", Toast.LENGTH_LONG).show()
}else {
Toast.makeText(this@MainActivity, "null calling! ${responseBody}", Toast.LENGTH_LONG).show()
}
}
})
}
}

and this is the interface where I try to set the method that get the launchLatest from the site:

interface RetroService {
@GET("graphql/")
fun getLastLaunch () : Call<LaunchModel>
}

I can't understand how to set this method to retrive the date from launchLatest. Can someone help me please? thanks

This is the output when a make the request from the browser:

{
"data": {
"launchLatest": {
"id": "109"
}
}
}

RD Connection problems

Hi. I have recently become the owner of a Samsun Galaxy Tab and have downloaded and installed the MS Remote Desktop client. When I try to connect to the server (8X.XXX.XXX.101) / Administrator I constantly get an error message that informs me that the Login Credentials are not correct. The server is running MS WInServer 2022 and remote connections from other machines are not a problem.. When I connect from my desktop PC with Win11 Home, a connection is established with the login credentials I always provide. When I connect from an iPhone, the connection is also established without problems. So I guess there is an issue with either the Android version of the App or the Android OS. Is there any known bug that is interfering with my login credentials being distorted or blocked?

Valu Event listener being skipped for firebase database

I get an error in the requests adapter saying list.size = null. When debugging, I noticed the value event listener is not being triggered and it jumps directly to the adapter = new request adapter I have used the same instantiation of the database reference in other parts of the code and it works so I am not sure why this is happening? help please! :(

public class Requests extends Fragment {


RecyclerView acted, unseen;
RecyclerView.Adapter adapter, adapter2;
ArrayList<Requestitem> requestitems;


public Requests() {
// Required empty public constructor
}
@override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_requests, container, false);

}
@override
public void onViewCreated(View view, @nullable Bundle savedInstanceState)
{
unseen = getView().findViewById(R.id.recunseen);
acted = getView().findViewById(R.id.reqacted);

unseen.setLayoutManager(new LinearLayoutManager(this.getContext()));
acted.setLayoutManager(new LinearLayoutManager(this.getContext()));
DatabaseReference userefdata = FirebaseDatabase.getInstance().getReference().child("Requests");
userefdata.addValueEventListener(new ValueEventListener() {

@override
public void onDataChange(@NonNull DataSnapshot snapshot) {


for (DataSnapshot snap : snapshot.getChildren()) {

Requestitem evt = new Requestitem(snap.child("name").getValue(String.class),
snap.child("major").getValue(String.class),
snap.child("time").getValue(String.class),
snap.child("riderid").getValue(String.class),
snap.child("driverid").getValue(String.class),
false
);

requestitems.add(evt);
}
adapter.notifyDataSetChanged();

}

@override
public void onCancelled(@NonNull DatabaseError error) {

}

});
adapter2 = new RequestAdapter(requestitems, new RequestAdapter.OnItemClickListener() {
@override
public void OnItemClick(Requestitem ev) {
showselected(new Profile(ev.getRiderid()));
}
});

adapter = new RequestAdapter(requestitems, new RequestAdapter.OnItemClickListener() {
@override
public void OnItemClick(Requestitem ev) {
showselected(new Profile(ev.getRiderid()));
}
});
acted.setAdapter(adapter2);
unseen.setAdapter(adapter);


}





private void showselected(Fragment f){

getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.cont, f)

.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)

.commit();

}
}

Help Telegram contacts question

Hi,

I think any of my contacts that login to telegram I will see something like this "John joined Telegram" screenshot https://i.imgur.com/O0DzP3u.png

Assume my name is John and I login to telegram today.

1. Will [Delete Synced Contacts] remove [John joined Telegram] message that appeared in my friend phone (friend number is in my phone contacts)?

2. How to prevent "John joined Telegram" message from appearing in my friend phone (friend number is in my phone contacts)?

3. What does [Delete Synced Contacts] in telegram do?

4. Does this "John joined Telegram" reappear in my friend phone (friend number is in my phone contacts) everytime i logout and relogin telegram?

5. Does pressing [Delete Synced Contacts] delete my existing added friend contact and chat history seen in my telegram?

6. Does pressing [Delete Synced Contacts] delete "John joined Telegram" that is already in my friend phone?

Thanks
-----
I saw some guides on Delete Synced Contacts
https://www.howtogeek.com/711226/how-to-use-telegram-without-sharing-your-contacts/
https://www.techmesto.com/whatsapp-adds-emoji-reactions-support-for-messages-how-to-use/

Help Can't see the notification in messaging for "read"

Once I went from my Note 8 to the Z Fold 4, using the stock messaging app in both cases, I lost the ability on the Z Fold to see that my wife has read texts that I have sent to her. I think that I have lost other notifications, possibly "delivered". I get nothing now. Is there any setting in the default messaging app to get these features back? So far, I have found nothing.

Danny

Best way to retrieve data or reset Galaxy S4 with broken screen

I have an old GS4, I want to either get my data off it OR factory reset it (whichever is easier).

The screen is broken, as in it doesn't display at all. The phone otherwise seems to function, as it turns on and makes noises and the LEDs light up.

I Googled and saw a few possible methods but they're mostly from 10 years ago and some links are broken, and I'm wondering if there is an easier/newer method (rather than messing with the PCB or trying to install the SDK & Droid Screen).

It seems USB debugging is not activated, as plugging the phone into my PC doesn't do anything.

U.S. Post Office

I think something is seriously messed up with the U.S. Postal Service, maybe it's regional or a fluke.

First case: I got my Home Depot bill. It was due in 12 days. I wrote a check and mailed it at the Post Office the same day. 3 weeks later it gets cashed. Yes exactly 3 weeks later it was cashed. I got a new bill from Home Depot with a late fee and interest ($60 total). I call Home Depot and they keep repeating they are not responsible for the mail service. I kept on repeating was it the mail service or is it your bank being behind processing mail in payments?. Finally they took off the late fee and interest and I closed the account.

I told this story to a friend and he told me you have to start paying electronically. Which I have started doing. I didn't want to start banking over the internet, but i decided to give it a try.

Second case: I got my Visa bill on December 5, 2022. The Visa Bill says it's due November 3, 2022 (See attached photo) . I called Visa to tell them my December 5th bill came and it is due November 3rd.

So at this point I think it's a post office problem. Anyone else run into an issue like this with the postal service?

creditcard.jpg

AugieTN

Greetings,

Nice Android forum you have here. The wireless site I was using kind of dried up with very few people posting anymore.

I started out with Palm phones and i was a moderator on one of the old Palm forums. After HP bought Palm I switched to Nokia phones. When Microsoft bought Nokia I used Window phones for a while. When Window phones died out I switched to Google phones. I currently have a Pixel 7.

I'm a retired IBEW electrician. I have a house in Illinois and a waterfront land plot in southern Tennessee for my travel trailer.

Help Alarm default volume

When I create a new alarm in the Android clock app, the default volume is too high. I've gone into settings in that app and under the Timer/Sound section, picked a new sound, and lowered the volume to the level I want. The new sound I chose is appearing as default when I create a new alarm, but the default volume is still way too loud - meaning I have to manually go into each new alarm lowering the volume or, more often than not, forget and get a noisy reminder the first time the alarm goes off.

How do I change the default alarm volume level, so that when I create a new alarm, its volume is set quiet by default?

Add Text to Photo: Text Image

SQ8LY0-2NNjjWPzHFM6ihUES7t5qf2IRwVCpzKUBoJ4aItfHnBjH16EsSeo5ytlqZlZg=w526-h296-rw
HWsJOIyRyYr3e0MdmWDywih5vS3n736NbdvutxAHH9mpDhxiJSt5220p4_1JR9HoLA=w526-h296-rw

v23Dp2YsXo-6FBYrimtavDjxoEl0-U2tv4pnQMrzp2YHizgkgAC1t5lJdiMe93k8=w240-h480-rw

In the text image app you can add text to photo. Text art – add text app provides different editing features that users can create image with text. In the Add text to image – add text to picture app you can add text and also resize you added text on photo. Add text to picture allows you to change the text color and text font as well.

Text on images – photo editor text gives you text shadow feature that you apply on any text with the help of text on photo app. add text to image and photo to text app provides the text opacity that you can easily increase and decrease the text opacity through text on pictures and pictures editor text app.
Features:
Add Text on Photos: In the text on images app, users can add text to photo easily.
Text Size: Add text to photo gives you text size, that you can easily resize your text size using photo editor text app.
Fonts: In the text art app, users can change the text fonts through add text to image app.
Change Text Color:Text over image allows user to change the text color for their choice.
Text Shadow:Text image provides you text shadow functionality.

I can't read screen information, please help

Hi all. I hope someone can help me. I have a problem that the information dialogue bubble (not sure of its real name) shows up on my screen as white text on a white background. I can't find where the settings are to correct it and can't find info from searching the web. The attached picture shows what i mean.... Basically i never know what any of those dialogue boxes ever say. Thanks in advance.

Attachments

  • Screenshot_20221210-113319.png
    Screenshot_20221210-113319.png
    541.8 KB · Views: 157

Shake awake

Is there something that way, especially if it's already built in, that would make it possible to switch a phone on just by shaking it? These side keys don't always work that well. I checked that assistant menu on the Samsung A02s but couldn't find any such thing.

Help sound message with no reason..

Hi,


I have a Samsung Galaxy S21 5G running the latest available software version (Android 13 + One UI 5.0) in my country, Portugal.

Recently, assume since last update, something strange happens 2 or 3 times a day. Even while in locked mode and not being used it says the message ”Sorry but I did not understand”. The message its in Portuguese and the sound is high even if the phone its muted.

It can happen during the night.

I’ve tried do turn off the google assistant but the problem persists. Any suggestion on how to solve that?


Thanks in advance.

Filter

Back
Top Bottom