Closed parth2545 closed 4 years ago
This is a kotlin library and wont work with Java because it uses Kotlin Coroutines among other kotlin only features
Hi,
Sorry to bother you, but I am new to android development. Your library is perfect for the app i am trying to develop. But my app is in java and i read everywhere that i can combine kotlin classes in java. So if i create a kotlin class and called it in maniactivity..it won't work???
I am sorry again but little bit guidance will help me lot.
Thank you and have a nice day.
On Tue, Oct 20, 2020, 17:37 tyczj notifications@github.com wrote:
This is a kotlin library and wont work with Java because it uses Kotlin Coroutines among other kotlin only features
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tyczj/Tweedle/issues/2#issuecomment-712991181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROMJSSLFFOL2NUGPMU33YLSLW4EVANCNFSM4SYSYOYA .
Yes you can use kotlin classes in Java but there are certain things in kotlin you cannot use in Java that this library uses
Ohh, Ohkay.. Thank you so much..i was trying from last two days to work with it. Thanks a lot.
On Tue, Oct 20, 2020, 18:42 tyczj notifications@github.com wrote:
Yes you can use kotlin classes in Java but there are certain things in kotlin you cannot use in Java that this library uses
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tyczj/Tweedle/issues/2#issuecomment-713028327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROMJSSYM3YXQMV23KBPFFDSLXDXXANCNFSM4SYSYOYA .
Hi, Sorry to bother you again. I used your library in the Kotlin project now. It is working excellent. But I was trying to find if there is a way to just remove tweet from multitweetpayload. I used ( It.data.data.text) but for some reason it is not working.
Do let me know. Thank you.
Also, With some changes , we can use this library for twitter API 1.1 all end points. I tried that and it worked.
On Tue, Oct 20, 2020 at 6:53 PM Parth Patankar parth2545@gmail.com wrote:
Ohh, Ohkay.. Thank you so much..i was trying from last two days to work with it. Thanks a lot.
On Tue, Oct 20, 2020, 18:42 tyczj notifications@github.com wrote:
Yes you can use kotlin classes in Java but there are certain things in kotlin you cannot use in Java that this library uses
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tyczj/Tweedle/issues/2#issuecomment-713028327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROMJSSYM3YXQMV23KBPFFDSLXDXXANCNFSM4SYSYOYA .
Not sure I understand what you are trying to do. Can you give an example
When I am using ( Response.success -> it.data ) I get this result
But I want to extract just tweet text from it . Therefore I am trying to use ( Response.Success -> it.data.data.text ) from your examples. But it is not working
So I am asking if there is a inbuilt way to extract tweet text from MultiTweetPayload or do I have to build another method to parse that json output.
On Sat, Oct 24, 2020 at 3:59 PM tyczj notifications@github.com wrote:
Not sure I understand what you are trying to do. Can you give an example
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tyczj/Tweedle/issues/2#issuecomment-715926911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROMJSW3SU4V66BXL6DD6MDSMLTUXANCNFSM4SYSYOYA .
I cannot see your images you are trying to post.
A MultiTweetPayload can have one or many results you will have to loop through the list to get all the tweets or a specific one
I have updated the last one.
Okay so for looping Multitweetpayload , I have to write different coroutine code ,right?
Sorry again to make it so confusing.
all you have to do is
it.data.data.forEach{tweetData ->
tweetData.text //your tweet text
}
Nothing to do with coroutines its basic looping
How can I use the function in kotlin in background?? For example : `fun Tweeter() { val token =" val query = "\"Now that Tesla FSD beta\"from:elonmusk"
var mainActivityViewModel = ViewModelProvider(this).get(MainViewModel::class.java)
val map = HashMap<String, String>()
val dal = mainActivityViewModel.getRecentTweets(token, query, map).observe(this, Observer {
when (it) {
is Response.Error -> {
it.exception
}
is Response.Success -> it.data.data.forEach { tweetdata -> tweetdata.text }
}
})
}`
I should be able to call this function in background even without oncreat? Is that possible?
it is already executing in the background. if you mean looping through the data you get back from the api then look up how to use kotlin coroutines or other threading methods
I meant , how can I use this function without app instance. Like without having app layout on UI??
For ex. My app takes photo , and find out twitter handle in and find if that twitter handle is verified? but once I take photo my app get closed . No app Interface is shown after that and then notification pops up once it checks if it is verified or not. So I want these functions to run in background but it opens the UI everytime or needs me to write oncreate method..
You will need to use a service or something, these questions are all questions more suited for stackoverflow as they dont really have anything to do with the library
I am trying to use this amazing library but I am not able to.There are various problems appearing.I am not that good at kotlin so can you help me out with how we can use this library with java android applications.